Skip to contentSkip to conversation

selftests: drv-net: split up gro.py

PATCH Superseded Jakub Kicinski 4 participants 10 messages Aug 31 – Sep 1

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

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.

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 | 14 ++++
 .../drivers/net/{gro.py => gro_lib.py}        | 68 +++++++++----------
 .../testing/selftests/drivers/net/gro_lro.py  | 15 ++++
 tools/testing/selftests/drivers/net/gro_sw.py | 14 ++++
 .../net/hw/{gro_hw.py => gro_stats.py}        |  0
 .../selftests/drivers/net/pppoe_gro.py        | 46 +++++++++++++
 tools/testing/selftests/drivers/net/settings  |  2 +-
 .../selftests/net/lib/ksft_setup_loopback.sh  |  2 +-
 10 files changed, 131 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 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
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH net-next 1/3] selftests: drv-net: hw: rename gro_hw.py to gro_stats.py

Quoted 10 lines · Jakub Kicinski

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%)
author maintainer
#3 lore raw

PATCH 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

---
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 | 14 ++++
 .../drivers/net/{gro.py => gro_lib.py}        | 68 +++++++++----------
 .../testing/selftests/drivers/net/gro_lro.py  | 15 ++++
 tools/testing/selftests/drivers/net/gro_sw.py | 14 ++++
 .../selftests/drivers/net/pppoe_gro.py        | 46 +++++++++++++
 .../selftests/net/lib/ksft_setup_loopback.sh  |  2 +-
 7 files changed, 129 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 +14 -0
new file mode 100755
index 000000000000..17ffe0167323
@@ -0,0 +1,14 @@
+#!/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 +15 -0
new file mode 100755
index 000000000000..3f40e4180ec9
@@ -0,0 +1,15 @@
+#!/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 +14 -0
new file mode 100755
index 000000000000..e14fa06feec5
@@ -0,0 +1,14 @@
+#!/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 +46 -0

46 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
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH net-next 2/3] selftests: drv-net: split gro.py into one test per coalescing mode

Quoted 28 lines · 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

---
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?

Quoted 16 lines
---
 tools/testing/selftests/drivers/net/Makefile  |  9 ++-
 tools/testing/selftests/drivers/net/gro_hw.py | 14 ++++
 .../drivers/net/{gro.py => gro_lib.py}        | 68 +++++++++----------
 .../testing/selftests/drivers/net/gro_lro.py  | 15 ++++
 tools/testing/selftests/drivers/net/gro_sw.py | 14 ++++
 .../selftests/drivers/net/pppoe_gro.py        | 46 +++++++++++++
 .../selftests/net/lib/ksft_setup_loopback.sh  |  2 +-
 7 files changed, 129 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
author maintainer
#5 lore raw

Re: [PATCH net-next 2/3] selftests: drv-net: split gro.py into one test per coalescing mode

In reply to Jakub Kicinski

tools/testing/selftests/drivers/net/pppoe_gro.py line 15

Quoted 3 lines · On Mon, 31 Aug 2026 09:37:33 -0700 Jakub Kicinski wrote:
tools/testing/selftests/drivers/net/pppoe_gro.py new file +3 -0
+from lib.py import ksft_run, ksft_exit, ksft_variants
+from lib.py import NetDrvEpEnv
+from gro_lib import run_test

ruff is nit picking on the order of imports here, I'll have to respin, sorry about that..

Signature · 1 line
pw-bot: cr
author maintainer
#6 lore raw

PATCH 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]
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
Reviewed-by on v1 3/3
#7 lore raw

Re: [PATCH net-next 3/3] selftests: drv-net: bump the timeout to 15min

Quoted 12 lines · 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]
CC: [email protected]

---
 tools/testing/selftests/drivers/net/settings | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on the v1 series
#8 lore raw
In reply to Jakub Kicinski
Quoted 25 lines · 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.

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.

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 | 14 ++++
 .../drivers/net/{gro.py => gro_lib.py}        | 68 +++++++++----------
 .../testing/selftests/drivers/net/gro_lro.py  | 15 ++++
 tools/testing/selftests/drivers/net/gro_sw.py | 14 ++++
 .../net/hw/{gro_hw.py => gro_stats.py}        |  0
 .../selftests/drivers/net/pppoe_gro.py        | 46 +++++++++++++
 tools/testing/selftests/drivers/net/settings  |  2 +-
 .../selftests/net/lib/ksft_setup_loopback.sh  |  2 +-
Quoted 9 lines
 10 files changed, 131 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

For the series:

Reviewed-by
#9 lore raw
Quoted 36 lines · Nimrod Oren
Quoted 25 lines · 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.

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.

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 | 14 ++++
 .../drivers/net/{gro.py => gro_lib.py}        | 68 +++++++++----------
 .../testing/selftests/drivers/net/gro_lro.py  | 15 ++++
 tools/testing/selftests/drivers/net/gro_sw.py | 14 ++++
 .../net/hw/{gro_hw.py => gro_stats.py}        |  0
 .../selftests/drivers/net/pppoe_gro.py        | 46 +++++++++++++
 tools/testing/selftests/drivers/net/settings  |  2 +-
 .../selftests/net/lib/ksft_setup_loopback.sh  |  2 +-
Quoted 9 lines
 10 files changed, 131 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
Quoted 3 lines

For the series:

For the series: