netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Matthew Wilcox <willy@debian.org>,
	netdev@oss.sgi.com, "David S. Miller" <davem@redhat.com>,
	Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Subject: Re: [PATCH] netdev_ops
Date: Fri, 11 Jul 2003 12:51:24 -0700	[thread overview]
Message-ID: <3F0F153C.4040506@candelatech.com> (raw)
In-Reply-To: <20030711193215.GH16037@gtf.org>

Jeff Garzik wrote:
> Comments:
> 
> 1) The _ops are either too limited in scope, or too wide in scope.
> 
> We have a bunch of function pointers in struct net_device.
> We are adding a bunch more func ptrs in a new struct foo_ops.
> 
> If it is called ethtool_ops, I can support the addition of
> 	struct ethtool_ops *etops;
> to struct net_device.
> 
> However, if we call it netdev_ops, the structure's name no longer
> describes its purpose.  If we call it netdev_ops, we should move ALL the
> function pointers in struct net_device into netdev_ops as well, and deal
> with the associated driver breakage.
> 
> So, either change the name back to ethtool_ops, or go all the way.
> The current name to me implies a job half-done.
> 
> Personally, I would prefer the more radical "move all funcptrs into
> netdev_ops".  This is closer to other Linux kernel APIs.

Either way, I'd vote for netdev_ops, because I want to add generic
'ioctls' that work on struct net_device, not necessarily just ethernet
devices.  However, it's a minor issue since the code will work
regardless.

> 3) The func ptrs _count() are totally bogus.  We have an unconditional
> indirect reference to a function call which does nothing but return a
> driver constant.
> 
> I personally think that having ethtool_ops members manually calling
> the ->get_drvinfo hook is a _lot_ cleaner than 10,000 foo_count hooks.
> 
> 3.a) Further, we will inevitably be adding more counts in the future.
> If we wanted to be truly expandable, and you really don't like the
> counts being in struct ethtool_gdrvinfo, then create a struct
> ethtool_counts that puts all the constants in one place.

Suppose we do this, how will we make a user-space app that tries to
read this be backwards/forwards compatible?  This is one of the reasons
I was hoping for some versioning information that could be probed at
run-time from user-space.  Could bump the version each time we change
something that is difficult to detect in user-space.  (ie, adding a
new ethtool-cmd is easy to detect because we'll get EINVAL or something
when it's not there, and a success when it is, but getting a different
sized struct, or a struct who's members have changed their meaning, will
be more difficult to detect I believe.)

Programs that do not wish to deal with the cruft of versioning can just
ignore it, but ones that are designed to be very robust can do the extra
work to deal with the different versions.


> 
> 
> 4) I don't see why ethtool.h suddenly needs to include linux/types.h,
> when it hasn't needed it in all this time until now.

If we're changing lots of stuff...it would be nice to change the u32
etc to something that user-space can easily handle, as ethtool.h is
(for better or worse) being included from user-space.  Minor issue
again as it can be dealt with via type-defs etc.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear

  reply	other threads:[~2003-07-11 19:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-08 16:30 [PATCH] netdev_ops Matthew Wilcox
2003-07-08 20:44 ` Ben Greear
2003-07-08 21:25   ` Matthew Wilcox
2003-07-08 22:08     ` David S. Miller
2003-07-09 16:15       ` Matthew Wilcox
2003-07-09 17:11         ` Ben Greear
2003-07-09 17:25           ` Matthew Wilcox
2003-07-09 18:14           ` Jeff Garzik
2003-07-09 18:24             ` Ben Greear
2003-07-11 19:32         ` Jeff Garzik
2003-07-11 19:51           ` Ben Greear [this message]
2003-07-11 19:58             ` Jeff Garzik
2003-07-11 20:07               ` Ben Greear
2003-07-11 20:04           ` Matthew Wilcox
2003-07-14  5:53             ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2003-07-10  7:47 Feldman, Scott
2003-07-10  7:42 ` David S. Miller
2003-07-10 11:21 ` Matthew Wilcox
2003-07-10 13:06   ` Jeff Garzik
2003-07-10  8:18 Feldman, Scott
2003-07-10 20:37 ` David S. Miller
2003-07-11  0:53   ` 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=3F0F153C.4040506@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=acme@conectiva.com.br \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=willy@debian.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).