Mitchell Blank Jr wrote:
>
> > The ppp component itself could keep track of things itself too, and
> > just never call the dev_alloc_name, perhaps with a list as you mentioned...
>
> Good point. The only place this falls down is if two unrelated network
> devices are using the same naming scheme (like they both want to use
> "abc0", "abc1", etc). It will still work, of course, but will have
> lots of collisions so it will tend towards N^2 performance just like
> now. As long as only one of the contenders wants to make a lot
> of devices, it's just fine. So you're right, this is the way to go.
With a little thought and community effort, we should be able to not
have any such collisions as well...untill someone implements the ability
to (re)name devices from user-space :)
> So if we can get the inet_select_addr() thing sorted then the entire
> impact of this change is to add two btrees to core/dev.c -- one
> for looking up net_devices by name, another for looking them up by
> ifindex. Since these lookups are abstracted through the
> __dev_get_by_{name,index}() calls we could even make this
> CONFIG_SUPPORT_LOTSA_NET_DEVICES without too much gross code.
Seems a hashtable would be nice for the ifindex....
Also, if it takes out a linear search in a critical path (with seemingly
minimal overhead), then I don't even think it should be a configurable
option, just *IN* there!
>
> -Mitch
--
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
|