netdev
[Top] [All Lists]

Re: When are net_device names changed/changeable?

To: Andrew Morton <andrewm@xxxxxxxxxx>
Subject: Re: When are net_device names changed/changeable?
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Wed, 11 Oct 2000 09:14:01 -0700
Cc: linux-net <linux-net@xxxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
Organization: Candela Technologies
References: <39E419A1.DAE3F651@xxxxxxxxxxxxxxx> <39E47A2B.AE794422@xxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
Andrew Morton wrote:
> 
> Ben Greear wrote:
> >
> > I'm trying to write a hash structure that will hold the devices,
> > hashed by both name and index.
> >
> > It seems that the devices are first named generically: eth%d,
> > and at some later date, are initialized correctly.  This, of course,
> > completely screws up any name-based hashing I might have had...
> >
> > If names can change at any time, then I'll just quit trying to
> > hash on them.  However, if they only change up to some certain
> > step, then I'll be able to just initialize the hash list after that.
> >
> > Are the device names (for the devices in dev_base) un-changable after
> > some point?  What is this point?  (Would 'at-the-first-dev-add' be ok?)
> >
> > If this is un-workable, I can still hash on ifindex I think, it's
> > immutable, right?
> 
> Can you not simply add and remove the hashtable entries in
> register_netdevice() and unregister_netdevice()?

Yes, but I was worried about devices that exist before anything
is added (loopback dev is what dev_base is initialized to...)

However, I found that if I initialize on the first register_netdevice,
then everything seems to work OK.  The way I wrote the code, if it's
not initialized yet, then it just uses the old way of searching the dev_base
list.

I was able to do an ifconfig -a on a list of 4000 VLAN devices in about 16 
seconds
on a Celeron 500, so it does seem to speed things up considerably!!

I should have a cleaned up patch (with VLAN multicast and MAC settability)
available in a few days.

-- 
Ben Greear (greearb@xxxxxxxxxxxxxxx)  http://www.candelatech.com
Author of ScryMUD:  scry.wanfear.com 4444        (Released under GPL)
http://scry.wanfear.com               http://scry.wanfear.com/~greear

<Prev in Thread] Current Thread [Next in Thread>