From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Ilya Maximets <i.maximets@ovn.org>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Donald Hunter <donald.hunter@gmail.com>,
Shuah Khan <shuah@kernel.org>,
Adrian Moreno <amorenoz@redhat.com>, Jiri Benc <jbenc@redhat.com>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Matteo Perin <matteo.perin@canonical.com>
Subject: Re: [PATCH net 3/5] net: netlink: don't set nsid on local notifications
Date: Mon, 18 May 2026 17:41:19 +0200 [thread overview]
Message-ID: <ef3b3583-253e-4e83-8bab-31672effb9ab@6wind.com> (raw)
In-Reply-To: <f695ac3a-aec9-41fd-a3d3-9537ea4c50f1@ovn.org>
Le 18/05/2026 à 16:06, Ilya Maximets a écrit :
> On 5/18/26 2:56 PM, Nicolas Dichtel wrote:
>> Le 18/05/2026 à 14:46, Ilya Maximets a écrit :
>>
>> [snip]
>>
>>> True and also not really. The main problem is that ID can be allocated
>>> at any point in time, so the application needs to listen for NEW messages
>>> on the same socket that it is listening for the events that are interesting
>>> to it (to avoid races), if it doesn't want to make a separate GET request
>>> per notification or track all the IDs that were previously checked. It's a
>>> non-trivial amount of code depending on the application structure.
>> iproute2 handles it ;-)
>
> I don't think it does. If I run this in one terminal:
>
> ip netns add test-ns
> ip netns exec test-ns ip monitor link all-nsid
>
> And then in the other terminal:
>
> ip -n test-ns link add dummy1 type dummy
> ip netns exec test-ns ip netns set test-ns 100
> ip -n test-ns link add dummy2 type dummy
> ip netns del test-ns
>
> I see the following events:
>
> [nsid current]2: dummy1: <BROADCAST,NOARP> ...
> [nsid 100]3: dummy2: <BROADCAST,NOARP> ...
>
> Which is confusing to the user (myself) and shows that iproute2 doesn't
> know or doesn't care (which may be fine for this particular command) that
> 100 is the ID of the current namespace.
Right, it doesn't update its cache. I thought I fixed this :D
[snip]
>> I need to make some tests with your series.
>
> Note: sashiko points out that it may be possible to have stale values reported, so
> re-setting the nsid_is_set flag unconditionally before the check may be required,
> e.g.:
>
> + NETLINK_CB(p->skb2).nsid_is_set = false;
> if (!net_eq(sock_net(sk), p->net)) {
> NETLINK_CB(p->skb2).nsid = peernet2id(sock_net(sk), p->net);
> if (NETLINK_CB(p->skb2).nsid != NETNSA_NSID_NOT_ASSIGNED)
> NETLINK_CB(p->skb2).nsid_is_set = true;
> }
>
> I'll include that in v2.
I will wait for the v2 to test the series.
Regards,
Nicolas
next prev parent reply other threads:[~2026-05-18 15:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 20:19 [PATCH net 0/5] netlink: fixes for cross-namespace nsid reporting Ilya Maximets
2026-05-15 20:19 ` [PATCH net 1/5] net: rtnetlink: fix link nsid reported when the link is local Ilya Maximets
2026-05-18 6:21 ` Jiri Benc
2026-05-18 12:11 ` Ilya Maximets
2026-05-18 12:46 ` Nicolas Dichtel
2026-05-18 13:55 ` Ilya Maximets
2026-05-18 14:59 ` Nicolas Dichtel
2026-05-18 12:26 ` Nicolas Dichtel
2026-05-18 13:45 ` Ilya Maximets
2026-05-15 20:19 ` [PATCH net 2/5] selftests: net: add a test case for cross-namespace peer netns Ilya Maximets
2026-05-15 20:19 ` [PATCH net 3/5] net: netlink: don't set nsid on local notifications Ilya Maximets
2026-05-18 12:14 ` Nicolas Dichtel
2026-05-18 12:46 ` Ilya Maximets
2026-05-18 12:56 ` Nicolas Dichtel
2026-05-18 14:06 ` Ilya Maximets
2026-05-18 15:41 ` Nicolas Dichtel [this message]
2026-05-15 20:19 ` [PATCH net 4/5] tools: ynl: support listening on all nsids Ilya Maximets
2026-05-20 0:11 ` Jakub Kicinski
2026-05-15 20:19 ` [PATCH net 5/5] selftests: net: add a test case for nsid in all nsid notifications Ilya Maximets
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=ef3b3583-253e-4e83-8bab-31672effb9ab@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=amorenoz@redhat.com \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=jbenc@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=matteo.perin@canonical.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.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