diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-10-13 22:03:45 +0100 |
|---|---|---|
| committer | Pavel Begunkov <asml.silence@gmail.com> | 2026-01-14 02:13:36 +0000 |
| commit | 7073bb4b696f5593c1f2e0b9451f0120ca624182 (patch) | |
| tree | a7c5dc9a773f830a616eab1b1cd8fe25ddb48dcc /net/core/netdev_rx_queue.c | |
| parent | 0f61b1860cc3f52aef9036d7235ed1f017632193 (diff) | |
| download | lwn-7073bb4b696f5593c1f2e0b9451f0120ca624182.tar.gz lwn-7073bb4b696f5593c1f2e0b9451f0120ca624182.zip | |
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@gmail.com>
Diffstat (limited to 'net/core/netdev_rx_queue.c')
| -rw-r--r-- | net/core/netdev_rx_queue.c | 10 |
1 files 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); } |
