Skip to contentSkip to conversation

selftests: drv-net: split up gro.py

PATCH Applied Jakub Kicinski 2 participants 5 messages Sep 1 – Sep 3

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

v2 cover selftests: drv-net: split up gro.py

gro.py runs its full set of cases three times over - against SW GRO, HW GRO and LRO. It's our test with the longest runtime. The 318 cases take 12m30s on mlx5 with a debug kernel.

We will likely add more subcases here as the time goes on, so it's time to start splitting it up. Long runtime wastes time on retries (if any of the 300+ cases fails we try to check if it's a real failure or flake an re-run the whole thing). It also forces us to increase timeout for the whole test suite.

v2:
- [patch 2] reorder import lines to make ruff check happy
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (3):
selftests: drv-net: hw: rename gro_hw.py to gro_stats.py
selftests: drv-net: split gro.py into one test per coalescing mode
selftests: drv-net: bump the timeout to 15min

 tools/testing/selftests/drivers/net/Makefile  |  9 ++-
 .../testing/selftests/drivers/net/hw/Makefile |  2 +-
 tools/testing/selftests/drivers/net/gro_hw.py | 13 ++++
 .../drivers/net/{gro.py => gro_lib.py}        | 68 +++++++++----------
 .../testing/selftests/drivers/net/gro_lro.py  | 14 ++++
 tools/testing/selftests/drivers/net/gro_sw.py | 13 ++++
 .../net/hw/{gro_hw.py => gro_stats.py}        |  0
 .../selftests/drivers/net/pppoe_gro.py        | 45 ++++++++++++
 tools/testing/selftests/drivers/net/settings  |  2 +-
 .../selftests/net/lib/ksft_setup_loopback.sh  |  2 +-
 10 files changed, 127 insertions(+), 41 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/gro_hw.py
 rename tools/testing/selftests/drivers/net/{gro.py => gro_lib.py} (92%)
 mode change 100755 => 100644
 create mode 100755 tools/testing/selftests/drivers/net/gro_lro.py
 create mode 100755 tools/testing/selftests/drivers/net/gro_sw.py
 rename tools/testing/selftests/drivers/net/hw/{gro_hw.py => gro_stats.py} (100%)
 create mode 100755 tools/testing/selftests/drivers/net/pppoe_gro.py
Signature · 1 line
2.55.0
author maintainer
#1 lore raw

PATCH v2 1/3 selftests: drv-net: hw: rename gro_hw.py to gro_stats.py

We need to free up the gro_hw.py name for the HW-GRO half of gro.py, which we need to split by mode (sw / hw / lro). The file checks mostly qstat counters, so name it after stats.

---
 tools/testing/selftests/drivers/net/hw/Makefile                 | 2 +-
 .../selftests/drivers/net/hw/{gro_hw.py => gro_stats.py}        | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename tools/testing/selftests/drivers/net/hw/{gro_hw.py => gro_stats.py} (100%)
tools/testing/selftests/drivers/net/hw/Makefile +1 -1
index 78bb0169350b..6105be8e590f 100644
@@ -27,7 +27,7 @@ TEST_PROGS = \
 	ethtool_mm.sh \
 	ethtool_rmon.sh \
 	ethtool_std_stats.sh \
-	gro_hw.py \
+	gro_stats.py \
 	hw_stats_l3.sh \
 	hw_stats_l3_gre.sh \
 	iou-zcrx.py \
tools/testing/selftests/drivers/net/hw/gro_stats.py renamed from tools/testing/selftests/drivers/net/hw/gro_hw.py +0 -0
similarity index 100%
rename from tools/testing/selftests/drivers/net/hw/gro_hw.py
rename to tools/testing/selftests/drivers/net/hw/gro_stats.py
Signature · 1 line
2.55.0
author maintainer
#2 lore raw

PATCH v2 2/3 selftests: drv-net: split gro.py into one test per coalescing mode

In reply to Jakub Kicinski

gro.py runs its full set of cases three times over - against SW GRO, HW GRO and LRO. It's our test with the longest runtime. The 318 cases take 12m30s on mlx5 with a debug kernel.

Bumping the timeout for all tests feels wrong when we can so easily split the GRO test by execution mode. Shorter runtime also helps retry just the failing portion / mode (we retry failing tests to try to detect flakes vs real failures).

Move the main logic to gro_lib.py and add one program per mode - gro_sw.py, gro_hw.py and gro_lro.py, 102 cases each. Move PPPoE to a dedicated test. It has been tacked onto the tests in an ugly way, and it only runs against SW GRO anyway.

Note that unfortunately this will case a rename of all test cases. The mode moves from the case name to the test name

gro.py test.sw_ipv4_data_same

becomes

gro_sw.py test.ipv4_data_same

---
v2:
- reorder lines to make ruff check happy

We also saw 20min runs on gve, but those may have been errors. The GVE runner is very flaky and even when it runs it doesn't seem to execute the gro test. Perhaps because the test times out?

---
 tools/testing/selftests/drivers/net/Makefile  |  9 ++-
 tools/testing/selftests/drivers/net/gro_hw.py | 13 ++++
 .../drivers/net/{gro.py => gro_lib.py}        | 68 +++++++++----------
 .../testing/selftests/drivers/net/gro_lro.py  | 14 ++++
 tools/testing/selftests/drivers/net/gro_sw.py | 13 ++++
 .../selftests/drivers/net/pppoe_gro.py        | 45 ++++++++++++
 .../selftests/net/lib/ksft_setup_loopback.sh  |  2 +-
 7 files changed, 125 insertions(+), 39 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/gro_hw.py
 rename tools/testing/selftests/drivers/net/{gro.py => gro_lib.py} (92%)
 mode change 100755 => 100644
 create mode 100755 tools/testing/selftests/drivers/net/gro_lro.py
 create mode 100755 tools/testing/selftests/drivers/net/gro_sw.py
 create mode 100755 tools/testing/selftests/drivers/net/pppoe_gro.py
tools/testing/selftests/drivers/net/Makefile +8 -1
index d5bf4cb638a8..1f21e17d8c22 100644
@@ -11,13 +11,16 @@ TEST_GEN_FILES := \
 # end of TEST_GEN_FILES
 
 TEST_PROGS := \
-	gro.py \
+	gro_hw.py \
+	gro_lro.py \
+	gro_sw.py \
 	hds.py \
 	macsec.py \
 	napi_id.py \
 	napi_threaded.py \
 	netpoll_basic.py \
 	ping.py \
+	pppoe_gro.py \
 	psp.py \
 	queues.py \
 	ring_reconfig.py \
@@ -27,6 +30,10 @@ TEST_PROGS := \
 	xdp.py \
 # end of TEST_PROGS
 
+TEST_FILES := \
+	gro_lib.py \
+# end of TEST_FILES
+
 # YNL files, must be before "include ..lib.mk"
 YNL_GEN_FILES := psp_responder
 TEST_GEN_FILES += $(YNL_GEN_FILES)
tools/testing/selftests/drivers/net/gro_hw.py new file +13 -0
new file mode 100755
index 000000000000..06b980220835
@@ -0,0 +1,13 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+"""
+GRO conformance tests against the HW GRO implementation (rx-gro-hw).
+
+See gro_lib.py for the list of test cases.
+"""
+
+from gro_lib import gro_main
+
+if __name__ == "__main__":
+    gro_main(__file__, "hw")
tools/testing/selftests/drivers/net/gro_lib.py renamed from tools/testing/selftests/drivers/net/gro.py +31 -37

111 lines not on this page · raw message

tools/testing/selftests/drivers/net/gro_lro.py new file +14 -0
new file mode 100755
index 000000000000..63428d4aa749
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+"""
+GRO conformance tests against the LRO implementation
+(large-receive-offload).
+
+See gro_lib.py for the list of test cases.
+"""
+
+from gro_lib import gro_main
+
+if __name__ == "__main__":
+    gro_main(__file__, "lro")
tools/testing/selftests/drivers/net/gro_sw.py new file +13 -0
new file mode 100755
index 000000000000..b682c092faad
@@ -0,0 +1,13 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+"""
+GRO conformance tests against the SW GRO implementation.
+
+See gro_lib.py for the list of test cases.
+"""
+
+from gro_lib import gro_main
+
+if __name__ == "__main__":
+    gro_main(__file__, "sw")
tools/testing/selftests/drivers/net/pppoe_gro.py new file +45 -0

45 lines not on this page · raw message

tools/testing/selftests/net/lib/ksft_setup_loopback.sh +1 -1
index 3defbb1919c5..9ec4c3616795 100755
@@ -12,7 +12,7 @@
 #
 # Example use:
 #   export NETIF=eth0
-#   ./net/lib/ksft_setup_loopback.sh ./drivers/net/gro.py
+#   ./net/lib/ksft_setup_loopback.sh ./drivers/net/gro_sw.py
 
 if [ -z "$NETIF" ]; then
     echo "Error: NETIF variable not set"
Signature · 1 line
2.55.0
author maintainer
#3 lore raw

PATCH v2 3/3 selftests: drv-net: bump the timeout to 15min

In reply to Jakub Kicinski

The XDP test takes 9m30s on the slowest NIC with debug kernel. Let's give ourselves a 50% margin and set the timeout to 15min.

---
CC: [email protected]
CC: [email protected]

---
 tools/testing/selftests/drivers/net/settings | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/drivers/net/settings +1 -1
index eef533824a3c..e2206265f67c 100644
@@ -1 +1 @@
-timeout=360
+timeout=900
Signature · 1 line
2.55.0
#4 lore raw
In reply to Jakub Kicinski
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Tue, 1 Sep 2026 13:07:25 -0700 you wrote:

gro.py runs its full set of cases three times over - against SW GRO, HW GRO and LRO. It's our test with the longest runtime. The 318 cases take 12m30s on mlx5 with a debug kernel.

We will likely add more subcases here as the time goes on, so it's time to start splitting it up. Long runtime wastes time on retries (if any of the 300+ cases fails we try to check if it's a real failure or flake an re-run the whole thing). It also forces us to increase timeout for the whole test suite.

[...]

Here is the summary with links:
- [net-next,v2,1/3] selftests: drv-net: hw: rename gro_hw.py to gro_stats.py

    https://git.kernel.org/netdev/net-next/c/889b0cca6b29
  - [net-next,v2,2/3] selftests: drv-net: split gro.py into one test per coalescing mode
    https://git.kernel.org/netdev/net-next/c/f225a7317c18
  - [net-next,v2,3/3] selftests: drv-net: bump the timeout to 15min
    https://git.kernel.org/netdev/net-next/c/34d89dee719b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html