public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] ethtool_ops
@ 2003-06-06 20:17 Feldman, Scott
  2003-06-07 19:09 ` Jeff Garzik
  2003-06-30 16:31 ` Matthew Wilcox
  0 siblings, 2 replies; 6+ messages in thread
From: Feldman, Scott @ 2003-06-06 20:17 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-kernel, linux-net

> Right now, each network driver which supports the ethtool 
> ioctl has its own implementation of everything from decoding 
> which ethtool ioctl it is, copying data to and from 
> userspace, marshalling and unmarshalling data from ethtool 
> packets, etc.  The current setup makes it impossible to use 
> alternative interfaces to get at the same data (eg sysfs) and 
> it's not exactly typesafe.

This is really cool!  Thanks for doing this Matthew.

Some questions:

* On get_gregs, for example, would it make sense to ->get_drvinfo
  so you'll know regdump_len and therefore can kmalloc an ethtool_regs
  with enough space to pass to ->get_regs?  Keep the kmalloc and
  kfree together.  Same for self_test, get_strings, and get_stats.
  For get_strings, size = max{n_stats, testinfo_len)*sizeof(u64).

* If the above is done, can we have one function type for the
ethtool_ops
  functions?  int f(struct netdev *, struct ethtool_cmd *).  The 
  drawback is the driver needs to cast to the specific ethtool_* struct.

* Can we get an HAVE_ETHTOOL_OPS defined in netdevice.h to support
  backward compat?

-scott

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: [PATCH] ethtool_ops
@ 2003-06-30 18:46 Feldman, Scott
  0 siblings, 0 replies; 6+ messages in thread
From: Feldman, Scott @ 2003-06-30 18:46 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: linux-kernel, linux-net

> On Fri, Jun 06, 2003 at 01:17:46PM -0700, Feldman, Scott wrote:
> > * On get_gregs, for example, would it make sense to ->get_drvinfo
> >   so you'll know regdump_len and therefore can kmalloc an 
> ethtool_regs
> >   with enough space to pass to ->get_regs?  Keep the kmalloc and
> >   kfree together.  Same for self_test, get_strings, and get_stats.
> >   For get_strings, size = max{n_stats, testinfo_len)*sizeof(u64).
> 
> That would be one possibility, but get_drvinfo is quite 
> heavyweight. I think I'd prefer to not do that unless there's 
> a strong feeling about thing.

I'm pretty sure you want to do this.  The less work done in the drivers,
the better.  See Jeff's response on this as well.
 
> > * Can we get an HAVE_ETHTOOL_OPS defined in netdevice.h to support
> >   backward compat?
> 
> I'm hoping to avoid that by getting compatibility code merged 
> into 2.4.22.

I'm not sure what compatibility code you're referring to.  We need to
target older kernels with the same code base, so a simple
HAVE_ETHTOOL_OPS would make this easy.  I'd really like to move over to
ethtool_ops for e100/e1000/ixgb, but it's problematic if we need to
manage multiple code bases.

-scott

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] ethtool_ops
@ 2003-06-06 14:29 Matthew Wilcox
  2003-06-06 14:31 ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Wilcox @ 2003-06-06 14:29 UTC (permalink / raw)
  To: linux-kernel, linux-net


The patch is 40k, so I'm not going to post it inline.
http://ftp.linux.org.uk/pub/linux/willy/patches/ethtool.diff

Right now, each network driver which supports the ethtool ioctl has its
own implementation of everything from decoding which ethtool ioctl it is,
copying data to and from userspace, marshalling and unmarshalling data
from ethtool packets, etc.  The current setup makes it impossible to
use alternative interfaces to get at the same data (eg sysfs) and it's
not exactly typesafe.

This patch introduces ethtool_ops and converts tg3 to use it.
Drivers don't access userspace on their own under this scheme; they
just do the requested operation and return the appropriate value(s).
Compile-tested only; design approved by jgarzik.  Comments welcomed.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-06-30 18:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-06 20:17 [PATCH] ethtool_ops Feldman, Scott
2003-06-07 19:09 ` Jeff Garzik
2003-06-30 16:31 ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2003-06-30 18:46 Feldman, Scott
2003-06-06 14:29 Matthew Wilcox
2003-06-06 14:31 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox