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

2016-09-16 Thread Nicolas Dichtel
Le 16/09/2016 à 15:18, Anton Aksola a écrit : [snip] > Nicolas, > This seems to be caused by netns_add calling unshare(CLONE_NEWNET). > If we initialize the socket for nsid after that it doesn't seem to work. > > Unfortunately I'm not an expert in these details. Should we separate the > socket and

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

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

2016-09-16 Thread Vadim Kochan
On Fri, Sep 16, 2016 at 2:21 PM, Anton Aksola wrote: > Ok, I will post a new patch version. Should tests be posted in a separate > patch? > > 2016-09-16 12:44 GMT+03:00 Nicolas Dichtel : >> >> Le 16/09/2016 à 11:23, Vadim Kochan a écrit : >> [snip] >> > Would it be useful to add test for this case

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

2016-09-16 Thread Nicolas Dichtel
Le 16/09/2016 à 11:23, Vadim Kochan a écrit : [snip] > Would it be useful to add test for this case into testsuite/ ? Yes, it's a good idea. Regards, Nicolas

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

2016-09-16 Thread Vadim Kochan
On Fri, Sep 16, 2016 at 12:13 PM, Nicolas Dichtel wrote: > Le 16/09/2016 à 09:22, Anton Aksola a écrit : >> 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 t

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

2016-09-16 Thread Nicolas Dichtel
Le 16/09/2016 à 09:22, Anton Aksola a écrit : > 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

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

2016-09-16 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