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.

Merge branch 'selftests-drv-net-iou-zcrx-improve-stability-and-make-the-large-chunk-test-work'

Jakub Kicinski says:

====================
selftests: drv-net: iou-zcrx: improve stability and make the large chunk test work

The iou-zcrx test hasn't been passing in NIPA, I assumed it's because
we're missing iouring changes, but it's still failing after the merge
window. Turns out there was a bug in the implementation which was fixed
separately via the iouring tree. With that out of the way the tests
are passing but flaky. Patch 1 deals with the flakiness.

While looking at this I also noticed that the large chunk test isn't
running at all. So fix and enable it (patches 2 and 3).
====================

Link: https://patch.msgid.link/20260227171305.2848240-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+31 -26
+31 -26
tools/testing/selftests/drivers/net/hw/iou-zcrx.py
··· 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 4 import re 5 + import time 5 6 from os import path 6 7 from lib.py import ksft_run, ksft_exit, KsftSkipEx, ksft_variants, KsftNamedVariant 7 8 from lib.py import NetDrvEpEnv 8 9 from lib.py import bkg, cmd, defer, ethtool, rand_port, wait_port_listen 9 - from lib.py import EthtoolFamily 10 + from lib.py import EthtoolFamily, NetdevFamily 10 11 11 12 SKIP_CODE = 42 13 + 14 + 15 + def mp_clear_wait(cfg): 16 + """Wait for io_uring memory providers to clear from all device queues.""" 17 + deadline = time.time() + 5 18 + while time.time() < deadline: 19 + queues = cfg.netnl.queue_get({'ifindex': cfg.ifindex}, dump=True) 20 + if not any('io-uring' in q for q in queues): 21 + return 22 + time.sleep(0.1) 23 + raise TimeoutError("Timed out waiting for memory provider to clear") 24 + 12 25 13 26 def create_rss_ctx(cfg): 14 27 output = ethtool(f"-X {cfg.ifname} context new start {cfg.target} equal 1").stdout ··· 59 46 'tcp-data-split': 'unknown', 60 47 'hds-thresh': hds_thresh, 61 48 'rx': rx_rings}) 49 + defer(mp_clear_wait, cfg) 62 50 63 51 cfg.target = channels - 1 64 52 ethtool(f"-X {cfg.ifname} equal {cfg.target}") ··· 87 73 'tcp-data-split': 'unknown', 88 74 'hds-thresh': hds_thresh, 89 75 'rx': rx_rings}) 76 + defer(mp_clear_wait, cfg) 90 77 91 78 cfg.target = channels - 1 92 79 ethtool(f"-X {cfg.ifname} equal {cfg.target}") ··· 135 120 136 121 cfg.require_ipver('6') 137 122 138 - combined_chans = _get_combined_channels(cfg) 139 - if combined_chans < 2: 140 - raise KsftSkipEx('at least 2 combined channels required') 141 - (rx_ring, hds_thresh) = _get_current_settings(cfg) 142 - port = rand_port() 123 + hp_file = "/proc/sys/vm/nr_hugepages" 124 + with open(hp_file, 'r+', encoding='utf-8') as f: 125 + nr_hugepages = int(f.read().strip()) 126 + if nr_hugepages < 64: 127 + f.seek(0) 128 + f.write("64") 129 + defer(lambda: open(hp_file, 'w', encoding='utf-8').write(str(nr_hugepages))) 143 130 144 - ethtool(f"-G {cfg.ifname} tcp-data-split on") 145 - defer(ethtool, f"-G {cfg.ifname} tcp-data-split auto") 146 - 147 - ethtool(f"-G {cfg.ifname} hds-thresh 0") 148 - defer(ethtool, f"-G {cfg.ifname} hds-thresh {hds_thresh}") 149 - 150 - ethtool(f"-G {cfg.ifname} rx 64") 151 - defer(ethtool, f"-G {cfg.ifname} rx {rx_ring}") 152 - 153 - ethtool(f"-X {cfg.ifname} equal {combined_chans - 1}") 154 - defer(ethtool, f"-X {cfg.ifname} default") 155 - 156 - flow_rule_id = _set_flow_rule(cfg, port, combined_chans - 1) 157 - defer(ethtool, f"-N {cfg.ifname} delete {flow_rule_id}") 158 - 159 - rx_cmd = f"{cfg.bin_local} -s -p {port} -i {cfg.ifname} -q {combined_chans - 1} -x 2" 160 - tx_cmd = f"{cfg.bin_remote} -c -h {cfg.addr_v['6']} -p {port} -l 12840" 131 + single(cfg) 132 + rx_cmd = f"{cfg.bin_local} -s -p {cfg.port} -i {cfg.ifname} -q {cfg.target} -x 2" 133 + tx_cmd = f"{cfg.bin_remote} -c -h {cfg.addr_v['6']} -p {cfg.port} -l 12840" 161 134 162 135 probe = cmd(rx_cmd + " -d", fail=False) 163 136 if probe.ret == SKIP_CODE: 164 - raise KsftSkipEx(probe.stdout) 137 + raise KsftSkipEx(probe.stdout.strip()) 165 138 166 139 with bkg(rx_cmd, exit_wait=True): 167 - wait_port_listen(port, proto="tcp") 140 + wait_port_listen(cfg.port, proto="tcp") 168 141 cmd(tx_cmd, host=cfg.remote) 169 142 170 143 ··· 162 159 cfg.bin_remote = cfg.remote.deploy(cfg.bin_local) 163 160 164 161 cfg.ethnl = EthtoolFamily() 162 + cfg.netnl = NetdevFamily() 165 163 cfg.port = rand_port() 166 - ksft_run(globs=globals(), cases=[test_zcrx, test_zcrx_oneshot], args=(cfg, )) 164 + ksft_run(globs=globals(), cases=[test_zcrx, test_zcrx_oneshot, 165 + test_zcrx_large_chunks], args=(cfg, )) 167 166 ksft_exit() 168 167 169 168