From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Benc Subject: Re: [PATCH net-next 0/5] rtnetlink: add IFA_IF_NETNSID for RTM_GETADDR Date: Mon, 3 Sep 2018 15:50:20 +0200 Message-ID: <20180903155020.6112f773@redhat.com> References: <20180828231859.29758-1-christian@brauner.io> <20180829181303.4sacopk7y3p5xyou@gmail.com> <81379a4f-7149-10ff-2453-886314d0b0c4@virtuozzo.com> <20180830144544.tpross4jd6awou4u@gmail.com> <20180901013427.tj3t2mlik4t7hlt5@gmail.com> <2319a029-7aca-b7aa-2e8f-4dfdeedcb6df@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Christian Brauner , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, pombredanne@nexb.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, dsahern@gmail.com, fw@strlen.de, lucien.xin@gmail.com, jakub.kicinski@netronome.com, nicolas.dichtel@6wind.com To: Kirill Tkhai Return-path: In-Reply-To: <2319a029-7aca-b7aa-2e8f-4dfdeedcb6df@virtuozzo.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, 3 Sep 2018 16:41:45 +0300, Kirill Tkhai wrote: > But this is a synthetic test, while I asked about real workflow. > Is this real problem for lxd, and there is observed performance > decrease? It's actually not as much a performance problem but rather the only way to get the data in some situations. Namely, when you have only netnsid. This happens e.g. when you want to query a veth peer in another netns. setns() requires a file descriptor which you don't have. Nor there is a way to convert netnsid to a fd. While developing the IFLA_IF_NETNSID patch, I was first thinking about implementing an API doing the conversion. The problem is there's no good place to put this into. It can't be done over netlink: netlink is unreliable and you can't have the kernel open a fd for you and lose it. There's no ioctl to use. So we'd be left with a procfs/sysfs or a syscall. Using netnsid to refer to the target netns seems to be a nice solution - after all, netnsid is the identifier to use in netlink. Jiri