Re: [PATCH] iproute2: build nsid-name cache only for commands that need it

2016-09-15 Thread Anton Aksola
On Thu, Sep 15, 2016 at 03:26:18PM +0200, Nicolas Dichtel wrote: [snip] > 'ip netns' (ip netns list) also need it. Thanks, I missed your other commit that introduced it. Sending an updated patch.

Re: [PATCH] iproute2: build nsid-name cache only for commands that need it

2016-09-15 Thread Nicolas Dichtel
Le 15/09/2016 à 10:23, Anton Aksola a écrit : [snip] > --- a/ip/ipnetns.c > +++ b/ip/ipnetns.c > @@ -775,8 +775,6 @@ static int netns_monitor(int argc, char **argv) > > int do_netns(int argc, char **argv) > { > - netns_map_init(); > - > if (argc < 1) > return netns_list(

[PATCH] iproute2: build nsid-name cache only for commands that need it

2016-09-15 Thread Anton Aksola
The calling of netns_map_init() before command parsing introduced a performance issue with large number of namespaces. As commands such as add, del and exec do not need to iterate through /var/run/netns it would be good not no build the cache before executing these commands. Example: unpatched: t