Re: [PATCH v1] vxcan: Support per-netns device unregistration.

Oliver Hartkopp <[email protected]>
Newsgroups org.kernel.vger.linux-can,dev.linux.lists.sashiko-reviews
Message-ID <[email protected]>

On 12.07.26 23:34, [email protected] wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] The patch calls the undefined function `unregister_netdevice_queue_net()`, resulting in a compilation error.
> --
> 
> --- Patch [1]: [PATCH v1] vxcan: Support per-netns device unregistration. ---
> commit 882fcd31630d9ce6b0a57cc99738c2ad0579763f
> Author: Kuniyuki Iwashima <[email protected]>
> 
> vxcan: Support per-netns device unregistration.
> 
> This commit updates vxcan_dellink() to unregister local and peer devices
> safely across different namespaces by using xchg(). The change aims to
> prevent double-queuing of device destruction when RTNL is removed.
> 
>> diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c
>> --- a/drivers/net/can/vxcan.c
>> +++ b/drivers/net/can/vxcan.c
> 
> [ ... ]
> 
>> @@ -281,24 +284,25 @@ static int vxcan_newlink(struct net_device *dev,
>>   
>>   static void vxcan_dellink(struct net_device *dev, struct list_head *head)
>>   {
> 
> [ ... ]
> 
>>   	unregister_netdevice_queue(dev, head);
>>   
>> -	if (peer) {
>> -		priv = netdev_priv(peer);
>> -		RCU_INIT_POINTER(priv->peer, NULL);
>> -		unregister_netdevice_queue(peer, head);
>> -	}
>> +	priv = netdev_priv(peer);
>> +	dev = unrcu_pointer(xchg(&priv->peer, NULL));
>> +	if (dev)
>> +		unregister_netdevice_queue_net(dev_net(dev), peer, head);
> 
> [Severity: Low]
> Is this missing a prerequisite patch? It appears that
> unregister_netdevice_queue_net() is not defined anywhere in the kernel
> tree, which leads to a compilation error when building vxcan.c.

The referenced veth.c patch was applied to net-next:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=d7fda2c776b2a969b9d78c5ad00e30824df43add

where also unregister_netdevice_queue_net() exists.

So this is a net-next resp. can-next patch.

Regards,
Oliver


> 
>> +
>> +	netdev_put(peer, peer_tracker);
>> +	netdev_put(dev, &priv->peer_tracker);
>>   }
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.