netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: David Miller <davem@davemloft.net>,
	Jeff Garzik <jgarzik@pobox.com>,
	netdev@vger.kernel.org
Subject: Re: [RFC] netdevice ops
Date: Thu, 17 May 2007 21:23:16 -0700	[thread overview]
Message-ID: <464D2A34.5000303@candelatech.com> (raw)
In-Reply-To: <20070517210737.17d88401@localhost>

Stephen Hemminger wrote:
> I want to take all the function pointers of 'struct net_device' and
> move them to 'struct net_device_ops'. This will save memory for the
> case of lots of devices, as well as reduce initialization code.
>
> Rough plan:
> 1. Introduce inline accessors so protocols don't dereference dev->XXX directly.
> 2. Fix protocols to use #1
> 3. Add ops field to net_device, and netdevice_register will fill in old values
>    in 'struct net_device'.
> 4...1300 Fix all network devices to use ops field
> 1301 Change accessors to use ops, get rid of old 'struct net_device' function pointers.
>
> It isn't rocket science just another code exercise. I'll patch bomb it into something
> like 2.6.23-mm first.
>
> This should really help the people who like to do 1000's of vlans etc.
>   
Vlan code uses several of the methods, so I'm not sure how it will save 
any memory unless
you will somehow have a variable sized net_device_ops structure, or 
maybe only move a
certain subset of methods into the ops struct?

Also, this will be a new chunk of memory to keep in cache and 
allocate/deallocate..wouldn't it be more efficient to
keep it local to the netdevice struct?

And there is an extra cost to dereference the point to the ops before 
calling methods?

Thanks,
Ben
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>   


-- 
Ben Greear <greearb@candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com



  reply	other threads:[~2007-05-18  4:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-18  4:07 [RFC] netdevice ops Stephen Hemminger
2007-05-18  4:23 ` Ben Greear [this message]
2007-05-18  4:49   ` David Miller
2007-05-18  6:42     ` Ben Greear
2007-05-18  4:50 ` David Miller
2007-05-18  4:54 ` Jeff Garzik
2007-05-18  5:05   ` David Miller
2007-05-18  5:58     ` Stephen Hemminger
2007-05-19 14:18       ` Andi Kleen

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=464D2A34.5000303@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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).