Messages in this thread Patch in this message | | | From | Kevin Mitchell <> | Subject | [PATCH] netdevice: don't warn when capping txqueue 0 | Date | Fri, 30 Sep 2022 18:00:41 -0700 |
| |
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@arista.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
| |