Skip to content

Commit 0b87745

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8c5a9f2 commit 0b87745

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tools/testing/selftests/drivers/net/hw/rss_ctx.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ def test_rss_context(cfg, ctx_cnt=1, create_with_cfg=None):
174174
GenerateTraffic(cfg, port=ports[i]).wait_pkts_and_stop(20000)
175175
cnts = _get_rx_cnts(cfg, prev=cnts)
176176

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))
179181
ksft_eq(sum(cnts[2:2+i*2] + cnts[4+i*2:]), 0, "traffic on other contexts: " + str(cnts))
180182

181183
if requested_ctx_cnt != ctx_cnt:
@@ -233,8 +235,9 @@ def check_traffic():
233235
cnts = _get_rx_cnts(cfg, prev=cnts)
234236

235237
if ctx[i]:
236-
ksft_lt(sum(cnts[ :2]), 10000, "traffic on main context:" + str(cnts))
237-
ksft_ge(sum(cnts[2+i*2:4+i*2]), 20000, f"traffic on context {i}: " + str(cnts))
238+
directed = sum(cnts[2+i*2:4+i*2])
239+
ksft_lt(sum(cnts[ :2]), directed / 2, "traffic on main context:" + str(cnts))
240+
ksft_ge(directed, 20000, f"traffic on context {i}: " + str(cnts))
238241
ksft_eq(sum(cnts[2:2+i*2] + cnts[4+i*2:]), 0, "traffic on other contexts: " + str(cnts))
239242
else:
240243
ksft_ge(sum(cnts[ :2]), 20000, "traffic on main context:" + str(cnts))
@@ -328,8 +331,9 @@ def test_rss_context_overlap(cfg, other_ctx=0):
328331
GenerateTraffic(cfg, port=port).wait_pkts_and_stop(20000)
329332
cnts = _get_rx_cnts(cfg, prev=cnts)
330333

331-
ksft_lt(sum(cnts[ :2]), 7000, "traffic on main context: " + str(cnts))
332-
ksft_ge(sum(cnts[2:4]), 20000, "traffic on extra context: " + str(cnts))
334+
directed = sum(cnts[2:4])
335+
ksft_lt(sum(cnts[ :2]), directed / 2, "traffic on main context: " + str(cnts))
336+
ksft_ge(directed, 20000, "traffic on extra context: " + str(cnts))
333337
if other_ctx == 0:
334338
ksft_eq(sum(cnts[4: ]), 0, "traffic on other queues: " + str(cnts))
335339

0 commit comments

Comments
 (0)