public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: drv-net: rss: Add retries to test_rss_key_indir to reduce flakes
@ 2026-03-09 20:42 Dimitri Daskalakis
  2026-03-10  4:23 ` Pavan Chebbi
  2026-03-11  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dimitri Daskalakis @ 2026-03-09 20:42 UTC (permalink / raw)
  To: David S . Miller
  Cc: Jakub Kicinski, Eric Dumazet, Paolo Abeni, Andrew Lunn,
	Simon Horman, Shuah Khan, Nimrod Oren, Gal Pressman, Pavan Chebbi,
	netdev, linux-kselftest

The test generates 16 flows, and verifies that traffic is distributed
across two queues via the NICs RSS indirection table. The likelihood of the
flows skewing to a single queue is high, so we retry sending traffic up to
3 times.

Alternatively, we could increase the number of generated flows. But
debug kernels may struggle to ramp this many flows.

During manual testing, the test passed for 10,000 consecutive runs.

Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 .../selftests/drivers/net/hw/rss_ctx.py       | 29 +++++++++++++++----
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
index d7cb30306368..51f4e7bc3e5d 100755
--- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
+++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
@@ -166,9 +166,17 @@ def test_rss_key_indir(cfg):
     ksft_eq(1, max(data['rss-indirection-table']))
 
     # Check we only get traffic on the first 2 queues
-    cnts = _get_rx_cnts(cfg)
-    GenerateTraffic(cfg).wait_pkts_and_stop(20000)
-    cnts = _get_rx_cnts(cfg, prev=cnts)
+
+    # Retry a few times in case the flows skew to a single queue.
+    attempts = 3
+    for attempt in range(attempts):
+        cnts = _get_rx_cnts(cfg)
+        GenerateTraffic(cfg).wait_pkts_and_stop(20000)
+        cnts = _get_rx_cnts(cfg, prev=cnts)
+        if cnts[0] >= 5000 and cnts[1] >= 5000:
+            break
+        ksft_pr(f"Skewed queue distribution, attempt {attempt + 1}/{attempts}: " + str(cnts))
+
     # 2 queues, 20k packets, must be at least 5k per queue
     ksft_ge(cnts[0], 5000, "traffic on main context (1/2): " + str(cnts))
     ksft_ge(cnts[1], 5000, "traffic on main context (2/2): " + str(cnts))
@@ -178,9 +186,18 @@ def test_rss_key_indir(cfg):
     # Restore, and check traffic gets spread again
     reset_indir.exec()
 
-    cnts = _get_rx_cnts(cfg)
-    GenerateTraffic(cfg).wait_pkts_and_stop(20000)
-    cnts = _get_rx_cnts(cfg, prev=cnts)
+    for attempt in range(attempts):
+        cnts = _get_rx_cnts(cfg)
+        GenerateTraffic(cfg).wait_pkts_and_stop(20000)
+        cnts = _get_rx_cnts(cfg, prev=cnts)
+        if qcnt > 4:
+            if sum(cnts[:2]) < sum(cnts[2:]):
+                break
+        else:
+            if cnts[2] >= 3500:
+                break
+        ksft_pr(f"Skewed queue distribution, attempt {attempt + 1}/{attempts}: " + str(cnts))
+
     if qcnt > 4:
         # First two queues get less traffic than all the rest
         ksft_lt(sum(cnts[:2]), sum(cnts[2:]),
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] selftests: drv-net: rss: Add retries to test_rss_key_indir to reduce flakes
  2026-03-09 20:42 [PATCH net-next] selftests: drv-net: rss: Add retries to test_rss_key_indir to reduce flakes Dimitri Daskalakis
@ 2026-03-10  4:23 ` Pavan Chebbi
  2026-03-11  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Pavan Chebbi @ 2026-03-10  4:23 UTC (permalink / raw)
  To: Dimitri Daskalakis
  Cc: David S . Miller, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
	Andrew Lunn, Simon Horman, Shuah Khan, Nimrod Oren, Gal Pressman,
	netdev, linux-kselftest

[-- Attachment #1: Type: text/plain, Size: 3019 bytes --]

On Tue, Mar 10, 2026 at 2:12 AM Dimitri Daskalakis
<dimitri.daskalakis1@gmail.com> wrote:
>
> The test generates 16 flows, and verifies that traffic is distributed
> across two queues via the NICs RSS indirection table. The likelihood of the
> flows skewing to a single queue is high, so we retry sending traffic up to
> 3 times.
>
> Alternatively, we could increase the number of generated flows. But
> debug kernels may struggle to ramp this many flows.
>
> During manual testing, the test passed for 10,000 consecutive runs.
>
> Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  .../selftests/drivers/net/hw/rss_ctx.py       | 29 +++++++++++++++----
>  1 file changed, 23 insertions(+), 6 deletions(-)
>

LGTM.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>

> diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> index d7cb30306368..51f4e7bc3e5d 100755
> --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> @@ -166,9 +166,17 @@ def test_rss_key_indir(cfg):
>      ksft_eq(1, max(data['rss-indirection-table']))
>
>      # Check we only get traffic on the first 2 queues
> -    cnts = _get_rx_cnts(cfg)
> -    GenerateTraffic(cfg).wait_pkts_and_stop(20000)
> -    cnts = _get_rx_cnts(cfg, prev=cnts)
> +
> +    # Retry a few times in case the flows skew to a single queue.
> +    attempts = 3
> +    for attempt in range(attempts):
> +        cnts = _get_rx_cnts(cfg)
> +        GenerateTraffic(cfg).wait_pkts_and_stop(20000)
> +        cnts = _get_rx_cnts(cfg, prev=cnts)
> +        if cnts[0] >= 5000 and cnts[1] >= 5000:
> +            break
> +        ksft_pr(f"Skewed queue distribution, attempt {attempt + 1}/{attempts}: " + str(cnts))
> +
>      # 2 queues, 20k packets, must be at least 5k per queue
>      ksft_ge(cnts[0], 5000, "traffic on main context (1/2): " + str(cnts))
>      ksft_ge(cnts[1], 5000, "traffic on main context (2/2): " + str(cnts))
> @@ -178,9 +186,18 @@ def test_rss_key_indir(cfg):
>      # Restore, and check traffic gets spread again
>      reset_indir.exec()
>
> -    cnts = _get_rx_cnts(cfg)
> -    GenerateTraffic(cfg).wait_pkts_and_stop(20000)
> -    cnts = _get_rx_cnts(cfg, prev=cnts)
> +    for attempt in range(attempts):
> +        cnts = _get_rx_cnts(cfg)
> +        GenerateTraffic(cfg).wait_pkts_and_stop(20000)
> +        cnts = _get_rx_cnts(cfg, prev=cnts)
> +        if qcnt > 4:
> +            if sum(cnts[:2]) < sum(cnts[2:]):
> +                break
> +        else:
> +            if cnts[2] >= 3500:
> +                break
> +        ksft_pr(f"Skewed queue distribution, attempt {attempt + 1}/{attempts}: " + str(cnts))
> +
>      if qcnt > 4:
>          # First two queues get less traffic than all the rest
>          ksft_lt(sum(cnts[:2]), sum(cnts[2:]),
> --
> 2.52.0
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] selftests: drv-net: rss: Add retries to test_rss_key_indir to reduce flakes
  2026-03-09 20:42 [PATCH net-next] selftests: drv-net: rss: Add retries to test_rss_key_indir to reduce flakes Dimitri Daskalakis
  2026-03-10  4:23 ` Pavan Chebbi
@ 2026-03-11  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-11  2:40 UTC (permalink / raw)
  To: Dimitri Daskalakis
  Cc: davem, kuba, edumazet, pabeni, andrew+netdev, horms, shuah, noren,
	gal, pavan.chebbi, netdev, linux-kselftest

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  9 Mar 2026 13:42:15 -0700 you wrote:
> The test generates 16 flows, and verifies that traffic is distributed
> across two queues via the NICs RSS indirection table. The likelihood of the
> flows skewing to a single queue is high, so we retry sending traffic up to
> 3 times.
> 
> Alternatively, we could increase the number of generated flows. But
> debug kernels may struggle to ramp this many flows.
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: drv-net: rss: Add retries to test_rss_key_indir to reduce flakes
    https://git.kernel.org/netdev/net-next/c/690043b95c18

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-11  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 20:42 [PATCH net-next] selftests: drv-net: rss: Add retries to test_rss_key_indir to reduce flakes Dimitri Daskalakis
2026-03-10  4:23 ` Pavan Chebbi
2026-03-11  2:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox