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

2016-09-19 Thread Anton Aksola
: time seq 1 1000 | xargs -n 1 ip netns add real0m16.832s user0m1.350s sys0m15.029s patched: time seq 1 1000 | xargs -n 1 ip netns add real0m3.859s user0m0.132s sys0m3.205s Signed-off-by: Anton Aksola --- ip/ip_common.h| 1 + ip/ipmonitor.c

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

2016-09-16 Thread Anton Aksola
On Fri, Sep 16, 2016 at 11:13:11AM +0200, Nicolas Dichtel wrote: > There is still some differences: > $ cat test.batch > netns add foo > netns set foo 1234 > netns list-id > > Before your patch: > $ ip -b test.batch > nsid 1234 (iproute2 netns name: foo) > > After your patch: > $ ip -b test.batch >

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

2016-09-16 Thread Anton Aksola
On Fri, Sep 16, 2016 at 02:25:40PM +0300, Vadim Kochan wrote: > Anton, I just looked into tests after when I did post here. I am not > sure it will be trivial, > currently tests are running within separated network namespace by > default (which I did) via > 'unshare' tool, and now I see that it is

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

2016-09-16 Thread Anton Aksola
: time seq 1 1000 | xargs -n 1 ip netns add real0m16.832s user0m1.350s sys0m15.029s patched: time seq 1 1000 | xargs -n 1 ip netns add real0m3.859s user0m0.132s sys0m3.205s Signed-off-by: Anton Aksola --- ip/ipnetns.c | 14 +- 1 file changed, 9 insertions

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.

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

2016-09-15 Thread Anton Aksola
: time seq 1 1000 | xargs -n 1 ip netns add real0m16.832s user0m1.350s sys0m15.029s patched: time seq 1 1000 | xargs -n 1 ip netns add real0m3.859s user0m0.132s sys0m3.205s Signed-off-by: Anton Aksola --- ip/ipnetns.c | 6 +++--- 1 file changed, 3 insertions(+), 3