Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: drv-net: Limit the max number of queues in procfs_downup_hammer

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>
Link: https://patch.msgid.link/20251111225319.3019542-1-dimitri.daskalakis1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Dimitri Daskalakis and committed by
Jakub Kicinski
f766f8cd e9498247

+3 -2
+3 -2
tools/testing/selftests/drivers/net/stats.py
··· 263 263 Reading stats via procfs only holds the RCU lock, drivers often try 264 264 to sleep when reading the stats, or don't protect against races. 265 265 """ 266 - # Max out the queues, we'll flip between max and 1 266 + # Set a large number of queues, 267 + # we'll flip between min(max_queues, 64) and 1 267 268 channels = ethnl.channels_get({'header': {'dev-index': cfg.ifindex}}) 268 269 if channels['combined-count'] == 0: 269 270 rx_type = 'rx' 270 271 else: 271 272 rx_type = 'combined' 272 273 cur_queue_cnt = channels[f'{rx_type}-count'] 273 - max_queue_cnt = channels[f'{rx_type}-max'] 274 + max_queue_cnt = min(channels[f'{rx_type}-max'], 64) 274 275 275 276 cmd(f"ethtool -L {cfg.ifname} {rx_type} {max_queue_cnt}") 276 277 defer(cmd, f"ethtool -L {cfg.ifname} {rx_type} {cur_queue_cnt}")