When using pseudo network devices, and really big machines; there is sometimes a need to have a lot of network devices. This replaces the existing 2.6.1 limit of 100 entries an was O(n^2) with a algo
I think your code has different semantics than exist currently. For example, let's use the example of asking for "slip%d" then "eth%d". The existing code would hand out "slip0" then "eth0", but your
It uses the output format string for the sscanf match, and since sscanf formats have to match. sscanf("eth0", "slip%d", &i) returns 0 so eth0 would be skipped
Stephen Hemminger wrote: When using pseudo network devices, and really big machines; there is sometimes a need to have a lot of network devices. This replaces the existing 2.6.1 limit of 100 entries
I have a patch for name hashing, but don't know if it's needed. Even without it I can add 9 thousand bridge entries, and each one takes longer to start the command than add the entry now.
Stephen Hemminger wrote: On Tue, 13 Jan 2004 16:23:25 -0800 Ben Greear <greearb@xxxxxxxxxxxxxxx> wrote: Stephen Hemminger wrote: When using pseudo network devices, and really big machines; there is s
Unfortunately sscanf("eth0-not-allocated", "eth%d", &i) fools it. Which may or may not be worth worrying about. -- Matt Mackall : http://www.selenic.com : Linux development and consulting
I found some other fast-path'ish cases of dev_get_by_name(), one of which is atalk_rcv()'s handling of IP over DDP packets. I didn't even search around for __dev_get() and dev_get_by_index() cases. T
David S. Miller wrote: Therefore, I think it's wise to just do this right from the start and use a hash. Stephen can you test up and submit the netdev name hash patch you have? In case it proves usef
Hmmm, the old code would have assigned "eth0" in that case, new code would assign "eth1". Other difference is in the case of whitespace. scanf("white space0", "white space%d", &i) because any whites
I think it's probably easier to just add O(1) lookup and then do explicit lookups on eth0..ethx. As Dave's pointed out, fast lookups are wanted elsewhere. I made a quick hack to make the sscanf trick
My only concern right now is that, since we're in the middle of 2.6.x, we not break semantics of such a core routine like this one. Although I'm willing to accept that certain cases are just rediculi
You may want to be careful about buffer overflow in '%d' with a most 2 char ('0' to '99'). The new code may create overflow for device names such as : 'reallylongname%d' And you don't seem the catch
This should make it match the existing semantics more exactly. It will skip the false positive matchs from sscanf trailing chars or blanks. diff -Nru a/net/core/dev.c b/net/core/dev.c -- a/net/core/d
Ok, but... I thought we had decided to move towards the hashing based patch you said you had so we can kill two birds with one stone? At least, that is the conclusion I thought we had arrived at.
When using pseudo network devices, and really big machines; there is sometimes a need to have a lot of network devices. This replaces the existing 2.6.1 limit of 100 entries an was O(n^2) with a algo
I think your code has different semantics than exist currently. For example, let's use the example of asking for "slip%d" then "eth%d". The existing code would hand out "slip0" then "eth0", but your
It uses the output format string for the sscanf match, and since sscanf formats have to match. sscanf("eth0", "slip%d", &i) returns 0 so eth0 would be skipped