netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Thomas Graf <tgraf@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>,
	Stephen Hemminger <shemminger@vyatta.com>,
	NetDev <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>
Subject: Re: the future of ethtool
Date: Tue, 16 Nov 2010 00:10:30 +0000	[thread overview]
Message-ID: <1289866230.2586.65.camel@bwh-desktop> (raw)
In-Reply-To: <20101115233335.GB24292@canuck.infradead.org>

On Mon, 2010-11-15 at 18:33 -0500, Thomas Graf wrote:
> On Mon, Nov 15, 2010 at 05:49:33PM -0500, Jeff Garzik wrote:
> > s/only//   I don't think Stephen is suggesting sending _some_ ops
> > through netlink and others through old-ioctl.  That's just silly.
> > Any new netlink interface should transit all existing ETHTOOL_xxx
> > commands/structures.
> > 
> > But presumably, one would have the ability to send multiple
> > ETHTOOL_xxx bundled together into a single netlink transaction,
> > facilitating the kernel's calling of struct ethtool_ops'
> > 	->begin()
> > 	... first operation specified by userspace via netlink ...
> > 	... second operation specified by userspace via netlink ...
> > 	... etc.
> > 	->end()
> > 
> > The underlying struct ethtool_ops remains unchanged; you're only
> > changing the transit method.
> > 
> > Thus, the ethtool userspace utility would switch entirely to
> > netlink, while the ioctl processing code remains for binary
> > compatibility.
> > 
> > Or... ethtool userspace utility could remain unchanged, and a new
> > 'nictool' utility provides the same features but with (a) a new CLI
> > and (b) exclusively uses netlink rather than ioctl.
> 
> I actually have code for this including userspace. I never submitted
> it because I wasn't confident it is the way to go since it literally
> duplicates all ethtool code in the kernel.
> 
> There is one major problem with bundling multiple requests though. If
> one change request fails but other changes have been committed already
> we can't really undo them without causing lots of races. We have to
> leave the device in a somewhat inconsistent state. It's even difficult
> to tell what has been comitted and what hasn't. It also makes error
> reporting more difficult as a -ERANGE error code could apply to any
> of the values to be changed.
[...]

I think it's hopeless to make this truly transactional.  Unless the
ethtool core maintains all the settings in one giant structure and
passes them over to the driver to check and apply then there is no way
driver authors are going to get it right in general.  And if the ethtool
core does that then, as you say, error reporting is going to be
terrible.  There will be even more need to go look in the kernel log to
see the driver's explanation of why the settings are invalid which was
too long to fit in this margin^Wreturn code.

I would expect to treat each operation in a multiple-set as conditional
on the success of all previous operations.  ethtool or other utilities
should then take care to put operations in a sensible order (e.g. enable
TX checksum before TSO, if those remain separate operations).  Error
reporting in the core is then as simple as reporting how many operations
were successful plus the error code for the one that failed.

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.


  parent reply	other threads:[~2010-11-16  0:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-15 19:41 the future of ethtool Jeff Garzik
2010-11-15 20:18 ` Ben Hutchings
2010-11-15 20:44   ` Stephen Hemminger
2010-11-15 21:14     ` Ben Hutchings
2010-11-15 21:14       ` Stephen Hemminger
2010-11-15 21:52         ` Ben Hutchings
2010-11-15 22:49           ` Jeff Garzik
2010-11-15 23:33             ` Thomas Graf
2010-11-16  0:07               ` Jeff Garzik
2010-11-16  0:10               ` Ben Hutchings [this message]
2010-11-16  6:25                 ` Thomas Graf
2010-11-16  2:02               ` David Miller
2010-11-16  6:17                 ` Thomas Graf
2010-11-15 21:03   ` Jeff Garzik

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=1289866230.2586.65.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=tgraf@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).