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: rss_ctx: use Netlink for timed reconfig

The rss_ctx test has gotten pretty flaky after I increased
the queue count in NIPA 2->3. Not 100% clear why. We get
a lot of failures in the rss_ctx.test_hitless_key_update case.

Looking closer it appears that the failures are mostly due
to startup costs. I measured the following timing for ethtool -X:
- python cmd(shell=True) : 150-250msec
- python cmd(shell=False) : 50- 70msec
- timed in bash : 45- 55msec
- YNL Netlink call : 2- 4msec
- .set_rxfh callback : 1- 2msec

The target in the test was set to 200msec. We were mostly measuring
ethtool startup cost it seems. Switch to YNL since it's 100x faster.

Lower the pass criteria to 150msec, no real science behind this number
but we removed some overhead, drivers which previously passed 200msec
should easily pass 150msec now.

Separately we should probably follow up on defaulting to shell=False,
when script doesn't explicitly ask for True, because the overhead
is rather significant.

Switch from _rss_key_rand() to random.randbytes(), YNL takes a binary
array rather than array of ints.

Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250901173139.881070-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+4 -3
+4 -3
tools/testing/selftests/drivers/net/hw/rss_ctx.py
··· 335 335 data = get_rss(cfg) 336 336 key_len = len(data['rss-hash-key']) 337 337 338 - key = _rss_key_rand(key_len) 338 + ethnl = EthtoolFamily() 339 + key = random.randbytes(key_len) 339 340 340 341 tgen = GenerateTraffic(cfg) 341 342 try: 342 343 errors0, carrier0 = get_drop_err_sum(cfg) 343 344 t0 = datetime.datetime.now() 344 - ethtool(f"-X {cfg.ifname} hkey " + _rss_key_str(key)) 345 + ethnl.rss_set({"header": {"dev-index": cfg.ifindex}, "hkey": key}) 345 346 t1 = datetime.datetime.now() 346 347 errors1, carrier1 = get_drop_err_sum(cfg) 347 348 finally: 348 349 tgen.wait_pkts_and_stop(5000) 349 350 350 - ksft_lt((t1 - t0).total_seconds(), 0.2) 351 + ksft_lt((t1 - t0).total_seconds(), 0.15) 351 352 ksft_eq(errors1 - errors1, 0) 352 353 ksft_eq(carrier1 - carrier0, 0) 353 354