From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932438AbeARUz6 (ORCPT ); Thu, 18 Jan 2018 15:55:58 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:36149 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753153AbeARUz5 (ORCPT ); Thu, 18 Jan 2018 15:55:57 -0500 X-Google-Smtp-Source: ACJfBovNrfkz38/B15WlrjxsvmglvnjikEFjcuoIdFQov/7+veeiSSCrqJ97yn3MG7P2bmcxiuR3TQ== Date: Thu, 18 Jan 2018 21:55:53 +0100 From: Christian Brauner To: Jiri Benc Cc: Christian Brauner , davem@davemloft.net, dsahern@gmail.com, fw@strlen.de, daniel@iogearbox.net, lucien.xin@gmail.com, mschiffer@universe-factory.net, jakub.kicinski@netronome.com, vyasevich@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stephen@networkplumber.org Subject: Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd Message-ID: <20180118205552.jm7shzcojbumax2k@gmail.com> References: <20180118202124.21616-1-christian.brauner@ubuntu.com> <20180118202124.21616-2-christian.brauner@ubuntu.com> <20180118212914.74878b82@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180118212914.74878b82@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 18, 2018 at 09:29:14PM +0100, Jiri Benc wrote: > On Thu, 18 Jan 2018 21:21:24 +0100, Christian Brauner wrote: > > In such scenarios setting a netns id property is > > not really wanted > > Why? I think that's what you should do if you want to avoid setns. Just > use netnsid. I don't see any problem with that and you didn't provide > any explanation. Ah, sorry, maybe I was to brief. When creating and destroying a lot of short-lived network namespaces it seems unnecessary to give them all label/netns id. Using a netns id makes much more sense when you want a persistent, long-living network namespace. For example, iproute2 where you want to create a persistent network namespace that sticks around via ip netns add bla && ip netns set bla 5. A more concrete scenario is creating a network namespace, moving a device into it via RTM_SETLINK which also supports IFLA_NET_NS_{FD,PID} and then wanting to query the device. This would be very easy to do if one could reuse the IFLA_NET_NS_{FD,PID} without having to set a netnsid. Christian