| 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@osdl.org> |
| References: | <20040113154610.38f5934c.shemminger@osdl.org> <20040113155921.342db463.davem@redhat.com> <20040113161303.20f1159d.shemminger@osdl.org> <20040114071303.GG28521@waste.org> <20040114113734.4e9a0865.shemminger@osdl.org> |
| 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
|
| Previous by Date: | Re: [PATCH] support for large number of network devices., Stephen Hemminger |
|---|---|
| Next by Date: | Re: [PATCH] support for large number of network devices., David S. Miller |
| Previous by Thread: | Re: [PATCH] support for large number of network devices., Stephen Hemminger |
| Next by Thread: | Re: [PATCH] support for large number of network devices., David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |