netdev
[Top] [All Lists]

Re: 802.1q Was (Re: Plans for 2.5 / 2.6 ???

To: "Benjamin C.R. LaHaise" <blah@xxxxxxxxx>
Subject: Re: 802.1q Was (Re: Plans for 2.5 / 2.6 ???
From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Mon, 05 Jun 2000 18:48:56 -0700
Cc: Mitchell Blank Jr <mitch@xxxxxxxxxx>, jamal <hadi@xxxxxxxxxx>, rob@xxxxxxxxxxx, buytenh@xxxxxxx, netdev@xxxxxxxxxxx, gleb@xxxxxxxxxxxxxxxxxxxxx
Organization: Candela Technologies
References: <Pine.LNX.3.96.1000605142426.587A-100000@kanga.kvack.org>
Sender: owner-netdev@xxxxxxxxxxx
"Benjamin C.R. LaHaise" wrote:
> 
> On Mon, 5 Jun 2000, Mitchell Blank Jr wrote:
> 
> > Ben Greear wrote:
> > > Seems a hashtable would be nice for the ifindex....
> >
> > The problemn with using a hashtable: how big should it be?  After all
> > you want it small enough that there isn't much memory waste if you
> > have 3 devices, yet we can efficiently do a lookup on 10000 devices.
> > That's why I'm thinking a B+ tree or something would be more
> > appropriate.
> 
> Before going that far, why not just take advantage of the fact that
> network devices have a structure to their name: class<number>?  Since the
> numbers are typically contiguous starting at zero, just have an array
> pointing to the device structs hanging off of the class name.  That way
> memory can be saved on device names too.
> 
>                 -ben

VLAN devices are not numbered contigiously, for one.  An array is
also worse than a hashtable at allowing growth.  We could have a dynamicly
re-sized array or hashtable though, based on the if_index field....  Doesn't
help finding a device by name though...

Ben

-- 
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>