netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: drv-net: Limit the max number of queues in procfs_downup_hammer
@ 2025-11-11 22:53 Dimitri Daskalakis
  2025-11-13  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitri Daskalakis @ 2025-11-11 22:53 UTC (permalink / raw)
  To: David S . Miller
  Cc: Jakub Kicinski, Eric Dumazet, Paolo Abeni, Andrew Lunn,
	Shuah Khan, netdev

For NICs with a large (1024+) number of queues, this test can cause
excessive memory fragmentation. This results in OOM errors, and in the
worst case driver/kernel crashes. We don't need to test with the max number
of queues, just enough to create a high likelihood of races between
reconfiguration and stats getting read.

Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/testing/selftests/drivers/net/stats.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/stats.py b/tools/testing/selftests/drivers/net/stats.py
index 04d0a2a13e73..b08e4d48b15c 100755
--- a/tools/testing/selftests/drivers/net/stats.py
+++ b/tools/testing/selftests/drivers/net/stats.py
@@ -263,14 +263,15 @@ def procfs_downup_hammer(cfg) -> None:
     Reading stats via procfs only holds the RCU lock, drivers often try
     to sleep when reading the stats, or don't protect against races.
     """
-    # Max out the queues, we'll flip between max and 1
+    # Set a large number of queues,
+    # we'll flip between min(max_queues, 64) and 1
     channels = ethnl.channels_get({'header': {'dev-index': cfg.ifindex}})
     if channels['combined-count'] == 0:
         rx_type = 'rx'
     else:
         rx_type = 'combined'
     cur_queue_cnt = channels[f'{rx_type}-count']
-    max_queue_cnt = channels[f'{rx_type}-max']
+    max_queue_cnt = min(channels[f'{rx_type}-max'], 64)
 
     cmd(f"ethtool -L {cfg.ifname} {rx_type} {max_queue_cnt}")
     defer(cmd, f"ethtool -L {cfg.ifname} {rx_type} {cur_queue_cnt}")
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] selftests: drv-net: Limit the max number of queues in procfs_downup_hammer
  2025-11-11 22:53 [PATCH net-next] selftests: drv-net: Limit the max number of queues in procfs_downup_hammer Dimitri Daskalakis
@ 2025-11-13  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-13  2:10 UTC (permalink / raw)
  To: Dimitri Daskalakis
  Cc: davem, kuba, edumazet, pabeni, andrew+netdev, shuah, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 11 Nov 2025 14:53:19 -0800 you wrote:
> For NICs with a large (1024+) number of queues, this test can cause
> excessive memory fragmentation. This results in OOM errors, and in the
> worst case driver/kernel crashes. We don't need to test with the max number
> of queues, just enough to create a high likelihood of races between
> reconfiguration and stats getting read.
> 
> Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: drv-net: Limit the max number of queues in procfs_downup_hammer
    https://git.kernel.org/netdev/net-next/c/f766f8cdde01

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-13  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 22:53 [PATCH net-next] selftests: drv-net: Limit the max number of queues in procfs_downup_hammer Dimitri Daskalakis
2025-11-13  2:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).