On Sun, 2010-10-31 at 04:40 +0100, Michał Mirosław wrote:
> While writing and debugging driver for StorLink's Gemini ethernet
> "card" I couldn't not notice that ethtool support had accumulated a lot
> of dust and "aah, let's just copy that from another driver"-generated
> code.  There are things that are reimplemented in more-or-less same way
> in multiple network drivers, there are logic bugs or unexpected
> variations among the implementations, and there is a lot of boilerplate
> code needed to be written by a person who wants to support ethtool
> in his driver.  I'm concentrating on offload feature setting here as
> that's what I needed for my driver.

I agree; I've fixed a few of these variations but I'm aware there are
many left.  Thanks for taking on some of this cleanup work.

[...]
> My proposal is to implement a offload feature setting that needs
> (almost) no code in network driver.  The idea is to add two
> ethtool-specific fields to struct net_device:
> 
>  - hw_features
>       offloads supported by the netdev (togglable by user)
>  - features_requested
>       offloads currently requested by user; this will be superset of
>       (features & hw_features) when i.e. current MTU or other external
>       conditions disable some offloads
> 
> ... and use them to implement changing of offloads in ethtool core.
> Since get_*() for TX offloads is just a bit test on netdev->features,
> corresponding ethtool entry points could be removed.

Right.

It also might be worth defining a standard feature flag for RX checksum
offload, since currently every driver has to maintain its own private
flag.  Though we're running short of feature flags on 32-bit machines.

[...]
> * sfc
>       assumed: constant efx->type->offload_features
[...]

This is correct.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to