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: allow more noise on default context

As predicted by David running the test on a machine with a single
interface is a bit unreliable. We try to send 20k packets with
iperf and expect fewer than 10k packets on the default context.
The test isn't very quick, iperf will usually send 100k packets
by the time we stop it. So we're off by 5x on the number of iperf
packets but still expect default context to only get the hardcoded
10k. The intent is to make sure we get noticeably less traffic
on the default context. Use half of the resulting iperf traffic
instead of the hard coded 10k.

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

+10 -6
+10 -6
tools/testing/selftests/drivers/net/hw/rss_ctx.py
··· 174 174 GenerateTraffic(cfg, port=ports[i]).wait_pkts_and_stop(20000) 175 175 cnts = _get_rx_cnts(cfg, prev=cnts) 176 176 177 - ksft_lt(sum(cnts[ :2]), 10000, "traffic on main context:" + str(cnts)) 178 - ksft_ge(sum(cnts[2+i*2:4+i*2]), 20000, f"traffic on context {i}: " + str(cnts)) 177 + directed = sum(cnts[2+i*2:4+i*2]) 178 + 179 + ksft_lt(sum(cnts[ :2]), directed / 2, "traffic on main context:" + str(cnts)) 180 + ksft_ge(directed, 20000, f"traffic on context {i}: " + str(cnts)) 179 181 ksft_eq(sum(cnts[2:2+i*2] + cnts[4+i*2:]), 0, "traffic on other contexts: " + str(cnts)) 180 182 181 183 if requested_ctx_cnt != ctx_cnt: ··· 235 233 cnts = _get_rx_cnts(cfg, prev=cnts) 236 234 237 235 if ctx[i]: 238 - ksft_lt(sum(cnts[ :2]), 10000, "traffic on main context:" + str(cnts)) 239 - ksft_ge(sum(cnts[2+i*2:4+i*2]), 20000, f"traffic on context {i}: " + str(cnts)) 236 + directed = sum(cnts[2+i*2:4+i*2]) 237 + ksft_lt(sum(cnts[ :2]), directed / 2, "traffic on main context:" + str(cnts)) 238 + ksft_ge(directed, 20000, f"traffic on context {i}: " + str(cnts)) 240 239 ksft_eq(sum(cnts[2:2+i*2] + cnts[4+i*2:]), 0, "traffic on other contexts: " + str(cnts)) 241 240 else: 242 241 ksft_ge(sum(cnts[ :2]), 20000, "traffic on main context:" + str(cnts)) ··· 331 328 GenerateTraffic(cfg, port=port).wait_pkts_and_stop(20000) 332 329 cnts = _get_rx_cnts(cfg, prev=cnts) 333 330 334 - ksft_lt(sum(cnts[ :2]), 7000, "traffic on main context: " + str(cnts)) 335 - ksft_ge(sum(cnts[2:4]), 20000, "traffic on extra context: " + str(cnts)) 331 + directed = sum(cnts[2:4]) 332 + ksft_lt(sum(cnts[ :2]), directed / 2, "traffic on main context: " + str(cnts)) 333 + ksft_ge(directed, 20000, "traffic on extra context: " + str(cnts)) 336 334 if other_ctx == 0: 337 335 ksft_eq(sum(cnts[4: ]), 0, "traffic on other queues: " + str(cnts)) 338 336