Thread (10 messages) 10 messages, 4 authors, 2025-01-10

Re: [PATCH v1 net 2/3] gtp: Destroy device along with udp socket's netns dismantle.

From: Kuniyuki Iwashima <hidden>
Date: 2025-01-08 09:03:03

From: Xiao Liang <redacted>
Date: Wed, 8 Jan 2025 16:55:16 +0800
On Wed, Jan 8, 2025 at 2:29 PM Kuniyuki Iwashima [off-list ref] wrote:
[...]
quoted
@@ -2480,6 +2480,11 @@ static void __net_exit gtp_net_exit_batch_rtnl(struct list_head *net_list,
        list_for_each_entry(net, net_list, exit_list) {
                struct gtp_net *gn = net_generic(net, gtp_net_id);
                struct gtp_dev *gtp, *gtp_next;
+               struct net_device *dev;
+
+               for_each_netdev(net, dev)
+                       if (dev->rtnl_link_ops == &gtp_link_ops)
+                               gtp_dellink(dev, dev_to_kill);
I'm not sure, but do we usually have to clean up devices
in the netns being deleted? Seems default_device_ops
can handle it.
default_device_ops handles netns dismantle, but we still
need this because the module is unloadable.

I have a patch that moves default_device_ops stuff after
some ->exit_batch_rtnl() to save one RTNL dance, which will
make it clear when default_device_ops is executed.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help