netdev
[Top] [All Lists]

Re: [PATCH] support for large number of network devices.

To: Stephen Hemminger <shemminger@xxxxxxxx>
Subject: Re: [PATCH] support for large number of network devices.
From: Matt Mackall <mpm@xxxxxxxxxxx>
Date: Wed, 14 Jan 2004 13:51:57 -0600
Cc: "David S. Miller" <davem@xxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20040114113734.4e9a0865.shemminger@xxxxxxxx>
References: <20040113154610.38f5934c.shemminger@xxxxxxxx> <20040113155921.342db463.davem@xxxxxxxxxx> <20040113161303.20f1159d.shemminger@xxxxxxxx> <20040114071303.GG28521@xxxxxxxxx> <20040114113734.4e9a0865.shemminger@xxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Wed, Jan 14, 2004 at 11:37:34AM -0800, Stephen Hemminger wrote:
> 
> > Unfortunately sscanf("eth0-not-allocated", "eth%d", &i) fools it.
> > Which may or may not be worth worrying about.
> 
> 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 whitespace matches multiple whitespace characters.
> 
> Is it worth making a separate explicit match routine?

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
work (try scanning for "eth%d%c" and insisting that %c not get parsed)
but it was not pretty.

-- 
Matt Mackall : http://www.selenic.com : Linux development and consulting

<Prev in Thread] Current Thread [Next in Thread>