Thread (10 messages) flat view 10 messages, 5 authors, 2025-02-07

Re: [PATCH net 1/2] net: advertise 'netns local' property via netlink

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-02-07 19:35:36
Also in: stable

On Fri, 7 Feb 2025 10:10:49 +0100 Nicolas Dichtel wrote:
Le 07/02/2025 à 00:39, Jakub Kicinski a écrit :
quoted
On Thu,  6 Feb 2025 17:50:26 +0100 Nicolas Dichtel wrote:  
quoted
Since the below commit, there is no way to see if the netns_local property
is set on a device. Let's add a netlink attribute to advertise it.  
I think the motivation for the change may be worth elaborating on.
It's a bit unclear to me what user space would care about this
information, a bit of a "story" on how you hit the issue could
be useful perhaps? The uAPI is new but the stable tag indicates
regression..  
To make it short: we were trying a new NIC with a custom distro provided by a
vendor (with out of tree drivers). We were unable to move the interface in
another netns. Thanks to ethtool we were able to confirm that the 'netns-local'
flag was set. Having this information helps debugging.
Thanks, makes sense. Still a bit unsure if this is a stable candidate,
if you don't mind net-next that'd be my preference. If you do mind,
I'll live with it :)
quoted
quoted
@@ -2041,6 +2042,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb,
 		       netif_running(dev) ? READ_ONCE(dev->operstate) :
 					    IF_OPER_DOWN) ||
 	    nla_put_u8(skb, IFLA_LINKMODE, READ_ONCE(dev->link_mode)) ||
+	    nla_put_u8(skb, IFLA_NETNS_LOCAL, dev->netns_local) ||  
Maybe nla_put_flag() ? Or do you really care about false being there?  
It depends if the commit is backported or not. If it won't be backported, having
the false value helps to know that the kernel support this attribute (and so
that the property is not set).
Wish we had a good solution for this, it's always the argument against
flags :(
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help