[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <374b055a2119076d43336008817248854774668e.1764542851.git.asml.silence@gmail.com>
Date: Sun, 30 Nov 2025 23:35:18 +0000
From: Pavel Begunkov <asml.silence@...il.com>
To: netdev@...r.kernel.org
Cc: "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Jonathan Corbet <corbet@....net>,
Michael Chan <michael.chan@...adcom.com>,
Pavan Chebbi <pavan.chebbi@...adcom.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Shuah Khan <shuah@...nel.org>,
Mina Almasry <almasrymina@...gle.com>,
Stanislav Fomichev <sdf@...ichev.me>,
Pavel Begunkov <asml.silence@...il.com>,
Yue Haibing <yuehaibing@...wei.com>,
David Wei <dw@...idwei.uk>,
Haiyue Wang <haiyuewa@....com>,
Jens Axboe <axboe@...nel.dk>,
Joe Damato <jdamato@...tly.com>,
Simon Horman <horms@...nel.org>,
Vishwanath Seshagiri <vishs@...com>,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org,
linux-kselftest@...r.kernel.org,
io-uring@...r.kernel.org,
dtatulea@...dia.com
Subject: [PATCH net-next v7 3/9] net: memzero mp params when closing a queue
Instead of resetting memory provider parameters one by one in
__net_mp_{open,close}_rxq, memzero the entire structure. It'll be used
to extend the structure.
Signed-off-by: Pavel Begunkov <asml.silence@...il.com>
---
net/core/netdev_rx_queue.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/core/netdev_rx_queue.c b/net/core/netdev_rx_queue.c
index c7d9341b7630..a0083f176a9c 100644
--- a/net/core/netdev_rx_queue.c
+++ b/net/core/netdev_rx_queue.c
@@ -139,10 +139,9 @@ int __net_mp_open_rxq(struct net_device *dev, unsigned int rxq_idx,
rxq->mp_params = *p;
ret = netdev_rx_queue_restart(dev, rxq_idx);
- if (ret) {
- rxq->mp_params.mp_ops = NULL;
- rxq->mp_params.mp_priv = NULL;
- }
+ if (ret)
+ memset(&rxq->mp_params, 0, sizeof(rxq->mp_params));
+
return ret;
}
@@ -179,8 +178,7 @@ void __net_mp_close_rxq(struct net_device *dev, unsigned int ifq_idx,
rxq->mp_params.mp_priv != old_p->mp_priv))
return;
- rxq->mp_params.mp_ops = NULL;
- rxq->mp_params.mp_priv = NULL;
+ memset(&rxq->mp_params, 0, sizeof(rxq->mp_params));
err = netdev_rx_queue_restart(dev, ifq_idx);
WARN_ON(err && err != -ENETDOWN);
}
--
2.52.0
Powered by blists - more mailing lists