netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: Christian Brauner <christianvanbrauner@gmail.com>,
	netdev@vger.kernel.org, ebiederm@xmission.com,
	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, linux-kernel@vger.kernel.org,
	w.bumiller@proxmox.com,
	Christian Brauner <christian.brauner@ubuntu.com>
Subject: Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK
Date: Fri, 26 Jan 2018 09:36:29 +0100	[thread overview]
Message-ID: <20180126093629.142e2a74@redhat.com> (raw)
In-Reply-To: <3b916ec7-3aca-13a7-7a48-7a7e8822e488@6wind.com>

On Fri, 26 Jan 2018 00:34:51 +0100, Nicolas Dichtel wrote:
> Why meaningful? The user knows that the answer is like if if was done in another
> netns. It enables to have only one netlink socket instead of one per netns. But
> the code using it will be the same.  

Because you can't use it to query the linked interface. You can't even
use it as an opaque value to track interfaces (netnsid+ifindex) because
netnsids are not unique across net name spaces. You can easily have two
interfaces that have all the ifindex, ifname, netnsid (and basically
everything else) identical but being completely different interfaces.
That's really not helpful.

> I fear that with your approach, it will results to a lot of complexity in the
> kernel.  

The complexity is (at least partly) already there. It's an inevitable
result of the design decision to have relative identifiers.

I agree that we should think about how to make this easy to implement.
I like your idea of doing this somehow generically. Perhaps it's
possible to do while keeping the netnsids valid in the caller's netns?

> What is really missing for me, is a way to get a fd from an nsid. The user
> should be able to call RTM_GETNSID with an fd and a nsid and the kernel performs
> the needed operations so that the fd points to the corresponding netns.  

That's what I was missing, too. I even looked into implementing it. But
opening a fd on behalf of the process and returning it over netlink is a
wrong thing to do. Netlink messages can get lost. Then you have a fd
leak you can do nothing about.

Given that we have netnsids used for so much stuff already (like
NETLINK_LISTEN_ALL_NSID) you need to track them anyway. And if you need
to track them, why bother with another identifier? It would be better
if netnsid can be used universally for anything. Then there will be no
need for the conversion.

 Jiri

  reply	other threads:[~2018-01-26  8:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 14:26 [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK Christian Brauner
2018-01-24 14:26 ` [PATCH net-next 1/3 V1] rtnetlink: enable IFLA_IF_NETNSID in do_setlink() Christian Brauner
2018-01-24 14:26 ` [PATCH net-next 2/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_SETLINK Christian Brauner
2018-01-24 14:26 ` [PATCH net-next 3/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_DELLINK Christian Brauner
2018-01-24 15:24 ` [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK Nicolas Dichtel
2018-01-24 16:35   ` Jiri Benc
2018-01-25 14:20     ` Nicolas Dichtel
2018-01-25 22:30       ` Jiri Benc
2018-01-25 23:34         ` Nicolas Dichtel
2018-01-26  8:36           ` Jiri Benc [this message]
2018-01-26  9:28             ` Nicolas Dichtel
2018-01-25 12:59 ` Christian Brauner
2018-01-26 11:33   ` Christian Brauner
2018-01-29 16:31 ` David Miller
2018-01-29 17:09   ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180126093629.142e2a74@redhat.com \
    --to=jbenc@redhat.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=christianvanbrauner@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=fw@strlen.de \
    --cc=jakub.kicinski@netronome.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=mschiffer@universe-factory.net \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=vyasevich@gmail.com \
    --cc=w.bumiller@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).