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: Xiao Liang <hidden>
Date: 2025-01-08 08:55:55

On Wed, Jan 8, 2025 at 2:29 PM Kuniyuki Iwashima [off-list ref] wrote:
[...]
quoted hunk ↗ jump to hunk
@@ -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.
                list_for_each_entry_safe(gtp, gtp_next, &gn->gtp_dev_list, list)
                        gtp_dellink(gtp->dev, dev_to_kill);
--
2.39.5 (Apple Git-154)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help