Skip to content

Commit a70f891

Browse files
TaeheeYookuba-moo
authored andcommitted
net: devmem: do not WARN conditionally after netdev_rx_queue_restart()
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 <[email protected]> Reviewed-by: Mina Almasry <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 87dd285 commit a70f891

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/core/devmem.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ void net_devmem_unbind_dmabuf(struct net_devmem_dmabuf_binding *binding)
109109
struct netdev_rx_queue *rxq;
110110
unsigned long xa_idx;
111111
unsigned int rxq_idx;
112+
int err;
112113

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

121122
rxq_idx = get_netdev_rx_queue_index(rxq);
122123

123-
WARN_ON(netdev_rx_queue_restart(binding->dev, rxq_idx));
124+
err = netdev_rx_queue_restart(binding->dev, rxq_idx);
125+
WARN_ON(err && err != -ENETDOWN);
124126
}
125127

126128
xa_erase(&net_devmem_dmabuf_bindings, binding->id);

0 commit comments

Comments
 (0)