* [PATCH net v3 2/2] selftests: drv-net: rss_ctx: Add test for ntuple rule
2024-11-27 22:58 [PATCH net v3 0/2] bnxt: Fix failure to report RSS context in ntuple rule Daniel Xu
@ 2024-11-27 22:58 ` Daniel Xu
2024-11-30 22:20 ` [PATCH net v3 0/2] bnxt: Fix failure to report RSS context in " patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Xu @ 2024-11-27 22:58 UTC (permalink / raw)
To: andrew+netdev, pabeni, davem, edumazet, shuah, kuba, michael.chan,
martin.lau, pavan.chebbi, ecree.xilinx
Cc: netdev, linux-kselftest, linux-kernel, kernel-team
Extend the rss_ctx test suite to test that an ntuple action that
redirects to an RSS context contains that information in `ethtool -n`.
Otherwise the output from ethtool is highly deceiving. This test helps
ensure drivers are compliant with the API.
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
| 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
index 0b49ce7ae678..ca8a7edff3dd 100755
--- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
+++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
@@ -3,7 +3,8 @@
import datetime
import random
-from lib.py import ksft_run, ksft_pr, ksft_exit, ksft_eq, ksft_ne, ksft_ge, ksft_lt
+import re
+from lib.py import ksft_run, ksft_pr, ksft_exit, ksft_eq, ksft_ne, ksft_ge, ksft_lt, ksft_true
from lib.py import NetDrvEpEnv
from lib.py import EthtoolFamily, NetdevFamily
from lib.py import KsftSkipEx, KsftFailEx
@@ -96,6 +97,13 @@ def _send_traffic_check(cfg, port, name, params):
f"traffic on inactive queues ({name}): " + str(cnts))
+def _ntuple_rule_check(cfg, rule_id, ctx_id):
+ """Check that ntuple rule references RSS context ID"""
+ text = ethtool(f"-n {cfg.ifname} rule {rule_id}").stdout
+ pattern = f"RSS Context (ID: )?{ctx_id}"
+ ksft_true(re.search(pattern, text), "RSS context not referenced in ntuple rule")
+
+
def test_rss_key_indir(cfg):
"""Test basics like updating the main RSS key and indirection table."""
@@ -459,6 +467,8 @@ def test_rss_context(cfg, ctx_cnt=1, create_with_cfg=None):
ntuple = ethtool_create(cfg, "-N", flow)
defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
+ _ntuple_rule_check(cfg, ntuple, ctx_id)
+
for i in range(ctx_cnt):
_send_traffic_check(cfg, ports[i], f"context {i}",
{ 'target': (2+i*2, 3+i*2),
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v3 0/2] bnxt: Fix failure to report RSS context in ntuple rule
2024-11-27 22:58 [PATCH net v3 0/2] bnxt: Fix failure to report RSS context in ntuple rule Daniel Xu
2024-11-27 22:58 ` [PATCH net v3 2/2] selftests: drv-net: rss_ctx: Add test for " Daniel Xu
@ 2024-11-30 22:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-30 22:20 UTC (permalink / raw)
To: Daniel Xu
Cc: pavan.chebbi, netdev, kalesh-anakkur.purayil, linux-kselftest,
michael.chan, linux-kernel, kuba, martin.lau, ecree.xilinx,
kernel-team
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 27 Nov 2024 15:58:28 -0700 you wrote:
> This patchset fixes a bug where bnxt driver was failing to report that
> an ntuple rule is redirecting to an RSS context. First commit is the
> fix, then second commit extends selftests to detect if other/new drivers
> are compliant with ntuple/rss_ctx API.
>
> === Changelog ===
>
> [...]
Here is the summary with links:
- [net,v3,1/2] bnxt_en: ethtool: Supply ntuple rss context action
https://git.kernel.org/netdev/net/c/be75cda92a65
- [net,v3,2/2] selftests: drv-net: rss_ctx: Add test for ntuple rule
https://git.kernel.org/netdev/net/c/7078d43b2374
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