Skip to content

Commit

Permalink
net: devmem: do not WARN conditionally after netdev_rx_queue_restart()
Browse files Browse the repository at this point in the history
When devmem socket is closed, netdev_rx_queue_restart() is called to
reset queue by the net_devmem_unbind_dmabuf(). But callback may return
-ENETDOWN if the interface is down because queues are already freed
when the interface is down so queue reset is not needed.
So, it should not warn if the return value is -ENETDOWN.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Link: https://patch.msgid.link/20250309134219.91670-8-ap420073@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Taehee Yoo authored and Jakub Kicinski committed Mar 10, 2025
1 parent 87dd285 commit a70f891
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/core/devmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void net_devmem_unbind_dmabuf(struct net_devmem_dmabuf_binding *binding)
struct netdev_rx_queue *rxq;
unsigned long xa_idx;
unsigned int rxq_idx;
int err;

if (binding->list.next)
list_del(&binding->list);
Expand All @@ -120,7 +121,8 @@ void net_devmem_unbind_dmabuf(struct net_devmem_dmabuf_binding *binding)

rxq_idx = get_netdev_rx_queue_index(rxq);

WARN_ON(netdev_rx_queue_restart(binding->dev, rxq_idx));
err = netdev_rx_queue_restart(binding->dev, rxq_idx);
WARN_ON(err && err != -ENETDOWN);
}

xa_erase(&net_devmem_dmabuf_bindings, binding->id);
Expand Down

0 comments on commit a70f891

Please sign in to comment.