aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/devmem.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-04-03 01:34:05 +0000
committerJakub Kicinski <[email protected]>2025-04-04 14:35:38 +0000
commit34f71de3f548eba0604c9cbabc1eb68b2f81fa0f (patch)
treec0a716edce465be07a682f8162bc292e596f248e /net/core/devmem.c
parentnet: move mp dev config validation to __net_mp_open_rxq() (diff)
downloadkernel-34f71de3f548eba0604c9cbabc1eb68b2f81fa0f.tar.gz
kernel-34f71de3f548eba0604c9cbabc1eb68b2f81fa0f.zip
net: avoid false positive warnings in __net_mp_close_rxq()
Commit under Fixes solved the problem of spurious warnings when we uninstall an MP from a device while its down. The __net_mp_close_rxq() which is used by io_uring was not fixed. Move the fix over and reuse __net_mp_close_rxq() in the devmem path. Acked-by: Stanislav Fomichev <[email protected]> Fixes: a70f891e0fa0 ("net: devmem: do not WARN conditionally after netdev_rx_queue_restart()") Reviewed-by: Mina Almasry <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/devmem.c')
-rw-r--r--net/core/devmem.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/core/devmem.c b/net/core/devmem.c
index f2ce3c2ebc97..6e27a47d0493 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -116,21 +116,19 @@ 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);
xa_for_each(&binding->bound_rxqs, xa_idx, rxq) {
- WARN_ON(rxq->mp_params.mp_priv != binding);
-
- rxq->mp_params.mp_priv = NULL;
- rxq->mp_params.mp_ops = NULL;
+ const struct pp_memory_provider_params mp_params = {
+ .mp_priv = binding,
+ .mp_ops = &dmabuf_devmem_ops,
+ };
rxq_idx = get_netdev_rx_queue_index(rxq);
- err = netdev_rx_queue_restart(binding->dev, rxq_idx);
- WARN_ON(err && err != -ENETDOWN);
+ __net_mp_close_rxq(binding->dev, rxq_idx, &mp_params);
}
xa_erase(&net_devmem_dmabuf_bindings, binding->id);