summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/drivers
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-03-17 20:38:18 -0700
committerJakub Kicinski <kuba@kernel.org>2026-03-19 16:57:28 -0700
commitff1cb3ad2abce4d03eaf3e8d5f38a7a5dfd36e79 (patch)
tree1fc3aaac4bc0824610e640db32fdd70aefbb64e6 /tools/testing/selftests/drivers
parentba5d4128fca8d141cced21f7ed10d14582cd5c1c (diff)
selftests: drv-net: gro: add test for packet ordering
Add a test to check if the NIC reorders packets if the hit GRO. Link: https://patch.msgid.link/20260318033819.1469350-6-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/drivers')
-rwxr-xr-xtools/testing/selftests/drivers/net/hw/gro_hw.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/tools/testing/selftests/drivers/net/hw/gro_hw.py b/tools/testing/selftests/drivers/net/hw/gro_hw.py
index 3bca19e8f339..10e08b22ee0e 100755
--- a/tools/testing/selftests/drivers/net/hw/gro_hw.py
+++ b/tools/testing/selftests/drivers/net/hw/gro_hw.py
@@ -10,7 +10,7 @@ import glob
import re
from lib.py import ksft_run, ksft_exit, ksft_pr
-from lib.py import ksft_eq, ksft_ge
+from lib.py import ksft_eq, ksft_ge, ksft_variants
from lib.py import NetDrvEpEnv, NetdevFamily
from lib.py import KsftSkipEx
from lib.py import bkg, cmd, defer, ethtool, ip
@@ -78,7 +78,8 @@ def _setup_isolated_queue(cfg):
return test_queue
-def _run_gro_test(cfg, test_name, num_flows=None, ignore_fail=False):
+def _run_gro_test(cfg, test_name, num_flows=None, ignore_fail=False,
+ order_check=False):
"""Run gro binary with given test and return output."""
if not hasattr(cfg, "bin_remote"):
cfg.bin_local = cfg.net_lib_dir / "gro"
@@ -98,6 +99,8 @@ def _run_gro_test(cfg, test_name, num_flows=None, ignore_fail=False):
]
if num_flows:
base_args.append(f"--num-flows {num_flows}")
+ if order_check:
+ base_args.append("--order-check")
args = " ".join(base_args)
@@ -257,13 +260,33 @@ def test_gro_stats_full(cfg):
expect_wire=gro_coalesced * 2)
+@ksft_variants([4, 32, 512])
+def test_gro_order(cfg, num_flows):
+ """
+ Test that HW GRO preserves packet ordering between flows.
+
+ Packets may get delayed until the aggregate is released,
+ but reordering between aggregates and packet terminating
+ the aggregate and normal packets should not happen.
+
+ Note that this test is stricter than truly required.
+ Reordering packets between flows should not cause issues.
+ This test will also fail if traffic is run over an ECMP fabric.
+ """
+ _setup_hw_gro(cfg)
+ _setup_isolated_queue(cfg)
+
+ _run_gro_test(cfg, "capacity", num_flows=num_flows, order_check=True)
+
+
def main() -> None:
""" Ksft boiler plate main """
with NetDrvEpEnv(__file__, nsim_test=False) as cfg:
cfg.netnl = NetdevFamily()
ksft_run([test_gro_stats_single,
- test_gro_stats_full], args=(cfg,))
+ test_gro_stats_full,
+ test_gro_order], args=(cfg,))
ksft_exit()