Subject: Re: [PATCH] iproute2: initialize the ll_map only once

From: Denys Fedoryshchenko <[email-masked]>
Date: Fri, 17 Dec 2010 15:06:41 +0200

On Friday 10 December 2010 21:38:09 Stephen Hemminger wrote:
> On Fri, 10 Dec 2010 16:59:50 +0200
> 
> Octavian Purdila <[email-masked]> wrote:
> > Avoid initializing the LL map (which involves a costly RTNL dump)
> > multiple times. This can happen when running in batch mode.
> > 
> > Signed-off-by: Octavian Purdila <[email-masked]>
> 
> applied
There is some longstanding bug related to current hashing system.
To "workaround" it i did my own "flush" command, to flush hashes, but with 
this patch it becomes more difficult to handle this situation.
Here is how to reproduce it:

ip -force -batch -
link add link eth0 name new0 type macvlan
link show dev new0
link delete dev new0 type macvlan
link add link eth0 name new0 type macvlan
link show dev new0

Last command will not show link, because index of old one is stored in hash.

I guess it is more bugreport for old problem, than problem with current patch.
Sure it is possible to flush hash on del/add operations, but additionally 
during batch run it is possible that interfaces can appear/disappear (NAS with 
thousands of ppp interfaces). Maybe still as an idea i can do patch with flag 
to dump rtnl before each command and additional "flush hash" command?