All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: bhutchings@solarflare.com, rick.jones2@hp.com,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] Make possible speeds known to ethtool
Date: Fri, 09 Jan 2009 00:30:21 -0500	[thread overview]
Message-ID: <4966E0ED.9090905@pobox.com> (raw)
In-Reply-To: <20090109051500.GA12836@gondor.apana.org.au>

Herbert Xu wrote:
> On Fri, Jan 09, 2009 at 12:03:57AM -0500, Jeff Garzik wrote:
>> I think you misunderstand.  You don't have touch any drivers at all...  
>> see attached demonstration patch.
>>
>> The more general point is that it is silly to add two ethtool ioctls  
>> each time you want to twiddle a single boolean flag (whatever that flag  
>> may be, generic or driver-specific or whatnot).
>>
>> If you still desire separation from ->{get,set}_flags() ops, then at  
>> least create an ETHTOOL_[GS]STACK_FLAGS.
> 
> OK, however I'm still not convinced that this is a good idea.
> First of all we don't have a shortage in the ethtool name space,
> we've only used up two hex digits worth of a 32-bit integer field.
> 
> More importantly, making multiple bit changes at the same time
> may create semantic nightmares in future.
> 
> For example, imagine if we started out with this generic flag
> function and TX checksum offload, SG, TSO were done using it.
> Now the user issues a request changing all of these bits, we'd
> then have to either validate it for contradictory settings, or
> devise some ad-hoc ordering in which the settings are applied.

Actually it's just the opposite -- _the_ most common complaint from 
users and driver developers of the ethtool interface, over the years, 
has been that there is no way to collect all the modifications and then 
commit it to hardware all in one go.

Each new ethtool command added often winds up pausing and resetting the 
hardware completely, and ETHTOOL_SGRO is no exception.

Now consider what happens when you have a lot of settings to tweak... 
reset, reset, reset, reset, reset.  That's a lot of needless hardware 
banging.

If I could redesign everything from scratch, I would make the interface 
flexible enough to input a list of changed settings, and then commit 
those all at once.  Lists of flags make that possible to a limited 
extent, at least.


> This just seems to be unnecessary penny-pinching that doesn't
> save much but may end up costing us down the road.

This sort of interface was added because the current "multi-reset" 
interface has already cost us.

A multi-flag interface is also more flexible and future-proof, as you 
can deploy new flags without having to update any userland utility... 
ethtool can permit input of the raw value as well as a more refined 
command interface.

That's another facet of the driver-private flag interfaces, too.  The 
ETHTOOL_[GS]PFLAGS interface is flexible enough to permit a wide variety 
of feature flags to be exported by various drivers; userland ethtool 
automatically supports all flags a driver supports, and never needs 
updating even if the list of supported driver-private flags change.

	Jeff




  reply	other threads:[~2009-01-09  5:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09  4:19 [PATCH] Make possible speeds known to ethtool Herbert Xu
2009-01-09  5:00 ` David Miller
2009-01-09  5:05   ` Jeff Garzik
2009-01-09  5:03 ` Jeff Garzik
2009-01-09  5:15   ` Herbert Xu
2009-01-09  5:30     ` Jeff Garzik [this message]
2009-01-09  5:35       ` Herbert Xu
2009-01-09  6:28         ` Jeff Garzik
2009-01-09  6:30           ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2009-01-09  3:48 Herbert Xu
2009-01-09  3:58 ` Jeff Garzik
2009-01-08  2:03 Rick Jones
2009-01-08  3:14 ` Ben Hutchings
2009-01-08  3:12   ` Jeff Garzik
2009-01-08 19:11     ` Rick Jones
2009-01-08 19:25       ` Ben Hutchings
2009-01-08 19:50         ` Rick Jones
2009-01-09  2:52     ` Herbert Xu
2009-01-09  3:20       ` Jeff Garzik
2009-03-06 11:19       ` Jeff Garzik
2009-03-06 13:52         ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4966E0ED.9090905@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.