>From looking at the 2.4.test9 code in dev.c, the device lookups by
both name and index are linear on the number of devices. It
seems to me that hashing them would make more sense, especially
since VLAN, ATM, FrameRelay and other technologies requires a potentially
large number of interfaces...
I was thinking of leaving the dev_base list alone, but keeping a hashtable
for lookup_by_name and lookup_by_index too. I can add a small piece of code
near the code that currently inserts into the dev_base list that will also
insert the device into the hash tables. Code to remove them will be put
in place too.
Then, in methods like dev.c's: struct net_device * __dev_get_by_index(int
ifindex)
I'll use a hashed lookup instead of the linear list search currently used...
So, does this seem like something worth doing?
Is there some generic hash-table code already in the kernel somewhere,
or do I get to build my own? (It shouldn't be too difficult :))
Any problems you see, or think I should be wary of?
Thanks,
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
|