From: Tony Lu <tonylu@linux.alibaba.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, rostedt@goodmis.org, mingo@redhat.com,
Lorenz Bauer <lmb@cloudflare.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: add net namespace inode for all net_dev events
Date: Wed, 10 Mar 2021 17:33:29 +0800 [thread overview]
Message-ID: <YEiSaR/8MEBEHNzQ@TonyMac-Alibaba> (raw)
In-Reply-To: <203c49a3-6dd8-105e-e12a-0e15da0d4df7@gmail.com>
On Tue, Mar 09, 2021 at 09:12:45PM +0100, Eric Dumazet wrote:
>
>
> On 3/9/21 5:43 AM, Tony Lu wrote:
> > There are lots of net namespaces on the host runs containers like k8s.
> > It is very common to see the same interface names among different net
> > namespaces, such as eth0. It is not possible to distinguish them without
> > net namespace inode.
> >
> > This adds net namespace inode for all net_dev events, help us
> > distinguish between different net devices.
> >
> > Output:
> > <idle>-0 [006] ..s. 133.306989: net_dev_xmit: net_inum=4026531992 dev=eth0 skbaddr=0000000011a87c68 len=54 rc=0
> >
> > Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
> > ---
> >
>
> There was a proposal from Lorenz to use netns cookies (SO_NETNS_COOKIE) instead.
>
> They have a guarantee of being not reused.
>
> After 3d368ab87cf6681f9 ("net: initialize net->net_cookie at netns setup")
> net->net_cookie is directly available.
It looks better to identify ns with net_cookie rather than inode, and
get the value with NS_GET_COOKIE. I will switch net_inum to net_cookie
in the next patch.
Cheers,
Tony Lu
>
prev parent reply other threads:[~2021-03-10 9:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 4:43 [PATCH] net: add net namespace inode for all net_dev events Tony Lu
2021-03-09 17:40 ` Steven Rostedt
2021-03-09 19:53 ` David Ahern
2021-03-09 20:02 ` Steven Rostedt
2021-03-09 20:17 ` David Ahern
2021-03-09 20:20 ` Alexei Starovoitov
2021-03-09 20:35 ` Steven Rostedt
2021-03-09 20:39 ` Alexei Starovoitov
2021-03-09 20:18 ` Alexei Starovoitov
2021-03-10 9:03 ` Tony Lu
2021-03-10 16:31 ` Steven Rostedt
2021-03-11 6:39 ` Tony Lu
2021-03-10 16:49 ` Steven Rostedt
2021-03-09 20:12 ` Eric Dumazet
2021-03-10 9:22 ` Lorenz Bauer
2021-03-10 12:01 ` Tony Lu
2021-03-10 9:33 ` Tony Lu [this message]
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=YEiSaR/8MEBEHNzQ@TonyMac-Alibaba \
--to=tonylu@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lmb@cloudflare.com \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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