> > Surely there are no critical paths that access the list linearly???
> All the places where result of device lookup is not cached.
> IP tries to cache it, but not everywhere.
If those are in the critical path, then things like virtual web servers
(say with 20 virtual ip interfaces on them), should see a noticable drop
in performance, eh? I haven't looked at the IP code enough to know
the reasons, but it would seem that the need to linearly search the
device list should be few and far between, at least once a port is
bound to an IP.
> I am sorry, when list of thousands elements is scanned and strcmp()ed,
> it is visible even in not very critical paths.
True. If someone wants to run 2000 VLANs, or 2000 tunnels, or 2000 PVCs,
they will have a slow time of running ifconfig -a. Hopefully, as Linux
finds it's way into these kinds of devices, someone will optimize it to
better handle the large number of interfaces...
> So, either you tell that list of devices must fit to single screen,
> or you hide them skillfully, so that nobody ever saw them
> occasionally and user doing "ifconfig" always saw some finite list.
ifconfig is definately not critical path. If a faster interface is needed
into the kernel, I'm sure someone can build one.
> > interfaces use pseudo-devices, what about Frame-Relay PVCs? ATM PVCs?
> I remember, we have already talked about this. Do you remember? (NBMA 8))
Vaguely, but I don't think I was satisfied with the answer then either.
I can't think up any way to give an interface to the user, and yet not put
an interface into the kernel. People shouldn't have to care what low layer
interface their code uses, so that implies to me that VLANs, PVCs or whatever
else must look, and in fact be, interfaces as far as the kernel is concerned.
How else could you offer, say VLANs, without using interfaces?
> Look, someone could find some merits in assigning special "eth666"
> to each MAC address on the wire. People do not make this usually.
> Why? Because it is inconvenient! When some amount exceeds dozen,
Layer 3 (IP & ARP) takes care of it for them. VLANs and PVCs are at lower
which are generally presented to the users as interfaces.
> That's why dev_alloc_name() is limited to two digits.
> And the maximum is not 99, as people extending it to 999 think,
> but 15. (When output of "ip link ls" still fits to one screen 8)8))
I know of a box that is running 50 virtual IP interfaces. It seems to
run just fine, so it seems the code supports more interfaces...
Btw, I was planning on using source-routing (ie the ip command) in a
PC with 20 real ethernet interfaces. Does this mean that the ip command
will not support that?
Ben Greear (greearb@xxxxxxxxxxxxxxx) http://www.candelatech.com
Author of ScryMUD: scry.wanfear.com 4444 (Released under GPL)