netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [CFT] 2.6.x experimental net driver updates
Date: Thu, 20 Nov 2003 05:47:29 +0000	[thread overview]
Message-ID: <20031120054729.GC24159@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <3FBC4FE0.2020705@pobox.com>

On Thu, Nov 20, 2003 at 12:23:44AM -0500, Jeff Garzik wrote:
> viro@parcelfarce.linux.theplanet.co.uk wrote:
> >On Wed, Nov 19, 2003 at 12:33:08PM -0500, Jeff Garzik wrote:
> >
> >>Ok, Al Viro's net driver refcounting work is pretty much complete, and 
> >
> >
> >The hell it is.  We are through with legacy probes, we are through with
> >init_etherdev(), we are practically through with static struct net_device.
> 
> hehe :)  I don't mean to suggest that all is clean and pure :)
> 
> 
> >However, we still have weird allocators (I've got almost all of them
> >done by now, will submit in the next batch) and we still have struct
> >net_device embedded as a field of other structures in several drivers.
> 
> Some of that will be interesting.  ns83820 for example embedded 
> net_device on purpose...  Ben seemed to think at the time it gave him 
> some speed, a few less pointer derefs and such.

That's fine, but 83820 should be doing that the other way round.

Note that for objects allocated by alloc_netdev() we have
	(char*) dev->priv == (char *)dev + const
and constant can be found at compile time _if_ we pad in front of
net_device and add a pointer to allocated block into net_device.

So we can have exactly the same structure (modulo padding) and no extra
dereferencing.  All we need is inlined void *net_priv(struct net_device *);

That, BTW, would be a win for other drivers using alloc_...() and not
reassigning ->priv (i.e. majority of those beasts).

      reply	other threads:[~2003-11-20  5:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19 17:33 [CFT] 2.6.x experimental net driver updates Jeff Garzik
2003-11-20  2:54 ` viro
2003-11-20  5:23   ` Jeff Garzik
2003-11-20  5:47     ` viro [this message]

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=20031120054729.GC24159@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.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 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).