lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221001010039.269004-1-kevmitch@arista.com>
Date:   Fri, 30 Sep 2022 18:00:41 -0700
From:   Kevin Mitchell <kevmitch@...sta.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     kevmitch@...sta.com, "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Antoine Tenart <atenart@...nel.org>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] netdevice: don't warn when capping txqueue 0

With commit d7dac083414e ("net-sysfs: update the queue counts in the
unregistration path"), we started seeing the following warning message
during our stress test that streams packets out of a device while
registering and unregistering it:

et3_11_1 selects TX queue 0, but real number of TX queues is 0

The issue is that remove_queue_kobjects() is setting real_num_tx_queues
to 0 before the last few packets are queued. When netdev_cap_txqueue()
is called to cap queue = 0, it emits this message.

However, when queue == real_num_tx_queues == 0, this message doesn't
make much sense because 0 is the fallback value returned
anyway. Therefore, omit the warning when queue is already the fallback
value of 0.

Fixes: d7dac083414e ("net-sysfs: update the queue counts in the unregistration path")
Link: https://lore.kernel.org/r/YzOjEqBMtF+Ib72v@chmeee/
Signed-off-by: Kevin Mitchell <kevmitch@...sta.com>
---
 include/linux/netdevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 05d6f3facd5a..3fd1e50b6bf5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3493,7 +3493,7 @@ static inline void netdev_reset_queue(struct net_device *dev_queue)
  */
 static inline u16 netdev_cap_txqueue(struct net_device *dev, u16 queue_index)
 {
-	if (unlikely(queue_index >= dev->real_num_tx_queues)) {
+	if (unlikely(queue_index > 0 && queue_index >= dev->real_num_tx_queues)) {
 		net_warn_ratelimited("%s selects TX queue %d, but real number of TX queues is %d\n",
 				     dev->name, queue_index,
 				     dev->real_num_tx_queues);
-- 
2.37.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ