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

Kuniyuki Iwashima <[email protected]>
Newsgroups org.kernel.vger.linux-can,dev.linux.lists.sashiko-reviews
Message-ID <CAAVpQUBy2Ws8iuvv4WBBcCHQkkQLL5E2Nu=_dnvxR=ehN6gXkg@mail.gmail.com>
On Mon, Jul 13, 2026 at 9:57 AM Oliver Hartkopp <[email protected]> wrote:
> 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.

Yes, I meant this is for can-next, but I was not sure how frequently
the tree is synced against net-next and what's the best approach here.
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.