[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1288645525.2231.60.camel@achroite.uk.solarflarecom.com>
Date: Mon, 01 Nov 2010 21:05:25 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: netdev@...r.kernel.org, e1000-devel@...ts.sourceforge.net,
Steve Glendinning <steve.glendinning@...c.com>,
Greg Kroah-Hartman <gregkh@...e.de>,
Rasesh Mody <rmody@...cade.com>,
Debashis Dutt <ddutt@...cade.com>,
Kristoffer Glembo <kristoffer@...sler.com>,
linux-driver@...gic.com, linux-net-drivers@...arflare.com
Subject: Re: [PATCH 0/4] Ethtool: cleanup strategy
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists