[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250306072422.3303386-6-ap420073@gmail.com>
Date: Thu, 6 Mar 2025 07:24:21 +0000
From: Taehee Yoo <ap420073@...il.com>
To: davem@...emloft.net,
kuba@...nel.org,
pabeni@...hat.com,
edumazet@...gle.com,
andrew+netdev@...n.ch,
michael.chan@...adcom.com,
pavan.chebbi@...adcom.com,
horms@...nel.org,
shuah@...nel.org,
netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org
Cc: almasrymina@...gle.com,
asml.silence@...il.com,
willemb@...gle.com,
kaiyuanz@...gle.com,
skhawaja@...gle.com,
sdf@...ichev.me,
gospo@...adcom.com,
somnath.kotur@...adcom.com,
dw@...idwei.uk,
ap420073@...il.com
Subject: [PATCH v2 net 5/6] 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 <ap420073@...il.com>
---
v2:
- Patch added.
net/core/devmem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/core/devmem.c b/net/core/devmem.c
index 3bba3f018df0..0e5a2c672efd 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -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);
@@ -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);
--
2.34.1
Powered by blists - more mailing lists