[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65dc8bd105e2573b3bd41bd35c73913392590a87.1760364551.git.asml.silence@gmail.com>
Date: Mon, 13 Oct 2025 15:54:22 +0100
From: Pavel Begunkov <asml.silence@...il.com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Jakub Kicinski <kuba@...nel.org>,
davem@...emloft.net,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Donald Hunter <donald.hunter@...il.com>,
Michael Chan <michael.chan@...adcom.com>,
Pavan Chebbi <pavan.chebbi@...adcom.com>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Stanislav Fomichev <sdf@...ichev.me>,
Joshua Washington <joshwash@...gle.com>,
Harshitha Ramamurthy <hramamurthy@...gle.com>,
Jian Shen <shenjian15@...wei.com>,
Salil Mehta <salil.mehta@...wei.com>,
Jijie Shao <shaojijie@...wei.com>,
Sunil Goutham <sgoutham@...vell.com>,
Geetha sowjanya <gakula@...vell.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
hariprasad <hkelam@...vell.com>,
Bharat Bhushan <bbhushan2@...vell.com>,
Saeed Mahameed <saeedm@...dia.com>,
Tariq Toukan <tariqt@...dia.com>,
Mark Bloch <mbloch@...dia.com>,
Leon Romanovsky <leon@...nel.org>,
Alexander Duyck <alexanderduyck@...com>,
kernel-team@...a.com,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Joe Damato <joe@...a.to>,
David Wei <dw@...idwei.uk>,
Willem de Bruijn <willemb@...gle.com>,
Mina Almasry <almasrymina@...gle.com>,
Pavel Begunkov <asml.silence@...il.com>,
Breno Leitao <leitao@...ian.org>,
Dragos Tatulea <dtatulea@...dia.com>,
linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-rdma@...r.kernel.org,
Jonathan Corbet <corbet@....net>
Subject: [PATCH net-next v4 20/24] net: wipe the setting of deactived queues
From: Jakub Kicinski <kuba@...nel.org>
Clear out all settings of deactived queues when user changes
the number of channels. We already perform similar cleanup
for shapers.
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Reviewed-by: Mina Almasry <almasrymina@...gle.com>
Signed-off-by: Pavel Begunkov <asml.silence@...il.com>
---
net/core/dev.c | 5 +++++
net/core/dev.h | 2 ++
net/core/netdev_config.c | 13 +++++++++++++
3 files changed, 20 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 5f92425dfdbd..b253e7e29ffa 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3188,6 +3188,8 @@ int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
if (dev->num_tc)
netif_setup_tc(dev, txq);
+ netdev_queue_config_update_cnt(dev, txq,
+ dev->real_num_rx_queues);
net_shaper_set_real_num_tx_queues(dev, txq);
dev_qdisc_change_real_num_tx(dev, txq);
@@ -3233,6 +3235,9 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
rxq);
if (rc)
return rc;
+
+ netdev_queue_config_update_cnt(dev, dev->real_num_tx_queues,
+ rxq);
}
dev->real_num_rx_queues = rxq;
diff --git a/net/core/dev.h b/net/core/dev.h
index a203b63198e7..63192dbb1895 100644
--- a/net/core/dev.h
+++ b/net/core/dev.h
@@ -101,6 +101,8 @@ void __netdev_queue_config(struct net_device *dev, int rxq,
struct netdev_queue_config *qcfg, bool pending);
int netdev_queue_config_revalidate(struct net_device *dev,
struct netlink_ext_ack *extack);
+void netdev_queue_config_update_cnt(struct net_device *dev, unsigned int txq,
+ unsigned int rxq);
/* netdev management, shared between various uAPI entry points */
struct netdev_name_node {
diff --git a/net/core/netdev_config.c b/net/core/netdev_config.c
index ede02b77470e..c5ae39e76f40 100644
--- a/net/core/netdev_config.c
+++ b/net/core/netdev_config.c
@@ -64,6 +64,19 @@ int netdev_reconfig_start(struct net_device *dev)
return -ENOMEM;
}
+void netdev_queue_config_update_cnt(struct net_device *dev, unsigned int txq,
+ unsigned int rxq)
+{
+ size_t len;
+
+ if (rxq < dev->real_num_rx_queues) {
+ len = (dev->real_num_rx_queues - rxq) * sizeof(*dev->cfg->qcfg);
+
+ memset(&dev->cfg->qcfg[rxq], 0, len);
+ memset(&dev->cfg_pending->qcfg[rxq], 0, len);
+ }
+}
+
void __netdev_queue_config(struct net_device *dev, int rxq,
struct netdev_queue_config *qcfg, bool pending)
{
--
2.49.0
Powered by blists - more mailing lists