Thread (6 messages) 6 messages, 2 authors, 2026-01-07

Re: [PATCH net-next v7 1/2] net: refactor set_rx_mode into snapshot and deferred I/O

From: I Viswanath <hidden>
Date: 2026-01-06 10:28:30
Also in: lkml, virtualization

quoted hunk ↗ jump to hunk
+static void netif_free_cleanup_work(struct net_device *dev)
+{
+       if (!dev->cleanup_work)
+               return;
+
+       cancel_work_sync(&dev->cleanup_work->work);
+       kfree(dev->cleanup_work);
+       dev->cleanup_work = NULL;
+}
+
@@ -1682,6 +1882,16 @@ static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
        if (!ret && ops->ndo_open)
                ret = ops->ndo_open(dev);

+       if (!ret && dev->needs_cleanup_work) {
+               if (!dev->cleanup_work)
+                       ret = netif_alloc_cleanup_work(dev);
+               else
+                       cancel_work_sync(&dev->cleanup_work->work);
+       }
+
+       if (!ret && ops->ndo_write_rx_mode)
+               ret = netif_alloc_rx_mode_ctx(dev);
+
        netpoll_poll_enable(dev);
This is the response to the AI review. Honestly impressed by how good
the AI review is

My bad, It should be flush_work() not cancel_work_sync() in
__dev_open() and also in
netif_free_cleanup_work(). These are the only places where execution
needs to wait
for completion of the cleanup work

It's ok to just cancel rx_mode work so this issue is only with the cleanup work
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help