]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: net: relocate gro and toeplitz tests to drivers/net
authorJakub Kicinski <kuba@kernel.org>
Thu, 20 Nov 2025 02:10:17 +0000 (18:10 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Nov 2025 02:19:29 +0000 (18:19 -0800)
The GRO test can run on a real device or a veth.
The Toeplitz hash test can only run on a real device.
Move them from net/ to drivers/net/ and drivers/net/hw/ respectively.

There are two scripts which set up the environment for these tests
setup_loopback.sh and setup_veth.sh. Move those scripts to net/lib.
The paths to the setup files are a little ugly but they will be
deleted shortly.

toeplitz_client.sh is not a test in itself, but rather a helper
to send traffic, so add it to TEST_FILES rather than TEST_PROGS.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20251120021024.2944527-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
14 files changed:
tools/testing/selftests/drivers/net/.gitignore
tools/testing/selftests/drivers/net/Makefile
tools/testing/selftests/drivers/net/gro.c [moved from tools/testing/selftests/net/gro.c with 99% similarity]
tools/testing/selftests/drivers/net/gro.sh [moved from tools/testing/selftests/net/gro.sh with 95% similarity]
tools/testing/selftests/drivers/net/hw/.gitignore
tools/testing/selftests/drivers/net/hw/Makefile
tools/testing/selftests/drivers/net/hw/toeplitz.c [moved from tools/testing/selftests/net/toeplitz.c with 99% similarity]
tools/testing/selftests/drivers/net/hw/toeplitz.sh [moved from tools/testing/selftests/net/toeplitz.sh with 98% similarity]
tools/testing/selftests/drivers/net/hw/toeplitz_client.sh [moved from tools/testing/selftests/net/toeplitz_client.sh with 100% similarity]
tools/testing/selftests/net/.gitignore
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/lib/Makefile
tools/testing/selftests/net/lib/setup_loopback.sh [moved from tools/testing/selftests/net/setup_loopback.sh with 100% similarity]
tools/testing/selftests/net/lib/setup_veth.sh [moved from tools/testing/selftests/net/setup_veth.sh with 100% similarity]

index 585ecb4d5dc42e36789e276bf66b221ec2b10f85..3633c7a3ed65915fe367dc2d8f9f71d8562753a8 100644 (file)
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
+gro
 napi_id_helper
 psp_responder
index 33f4816216ecd3d21a0256f103401489a3e1d655..7083a8707c4ef89110f9c6c2660ab22ff536f1b6 100644 (file)
@@ -6,10 +6,12 @@ TEST_INCLUDES := $(wildcard lib/py/*.py) \
                 ../../net/lib.sh \
 
 TEST_GEN_FILES := \
+       gro \
        napi_id_helper \
 # end of TEST_GEN_FILES
 
 TEST_PROGS := \
+       gro.sh \
        hds.py \
        napi_id.py \
        napi_threaded.py \
similarity index 99%
rename from tools/testing/selftests/net/gro.c
rename to tools/testing/selftests/drivers/net/gro.c
index cfc39f70635df8510966d826429ac3111958ed56..9b9be0cf8f7f142c5d6788c1460874f5add21f40 100644 (file)
@@ -57,7 +57,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "../kselftest.h"
+#include "../../kselftest.h"
 
 #define DPORT 8000
 #define SPORT 1500
similarity index 95%
rename from tools/testing/selftests/net/gro.sh
rename to tools/testing/selftests/drivers/net/gro.sh
index 4c5144c6f65246a193be300e6fa16681ee4d6d39..bd3cf6d02eda901f5b284b290731349a546e16d7 100755 (executable)
@@ -90,9 +90,9 @@ while getopts "i:t:p:" opt; do
 done
 
 if [ -n "$dev" ]; then
-       source setup_loopback.sh
+       source $(dirname $0)/../../net/lib/setup_loopback.sh
 else
-       source setup_veth.sh
+       source $(dirname $0)/../../net/lib/setup_veth.sh
 fi
 
 setup
index 6942bf575497dc1c74c02409a49531690c9431da..46540468a7753fddf94ab0283d3b78ffb45e1194 100644 (file)
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 iou-zcrx
 ncdevmem
+toeplitz
index 8133d1a0051cd37767ad3c852a5eadddcc9b1251..c9dced8c934a531a36972512d4b79b3cfff98349 100644 (file)
@@ -1,6 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0+ OR MIT
 
-TEST_GEN_FILES = iou-zcrx
+TEST_GEN_FILES := \
+       iou-zcrx \
+       toeplitz \
+# end of TEST_GEN_FILES
 
 TEST_PROGS = \
        csum.py \
@@ -21,12 +24,14 @@ TEST_PROGS = \
        rss_ctx.py \
        rss_flow_label.py \
        rss_input_xfrm.py \
+       toeplitz.sh \
        tso.py \
        xsk_reconfig.py \
        #
 
 TEST_FILES := \
        ethtool_lib.sh \
+       toeplitz_client.sh \
        #
 
 TEST_INCLUDES := \
similarity index 99%
rename from tools/testing/selftests/net/toeplitz.c
rename to tools/testing/selftests/drivers/net/hw/toeplitz.c
index 9ba03164d73a692f6ea39c560d43e678659ce21f..bf74aa25345dff52395471e120e877d3f3f625f1 100644 (file)
@@ -52,7 +52,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "../kselftest.h"
+#include "../../../kselftest.h"
 
 #define TOEPLITZ_KEY_MIN_LEN   40
 #define TOEPLITZ_KEY_MAX_LEN   60
similarity index 98%
rename from tools/testing/selftests/net/toeplitz.sh
rename to tools/testing/selftests/drivers/net/hw/toeplitz.sh
index 8ff172f7bb1bfb2ff051ca52a69a0f3fb97f9a1f..d236b666dd3b23acde2abbc07b737fa3bcacf235 100755 (executable)
@@ -11,7 +11,7 @@
 # invoke as ./toeplitz.sh (-i <iface>) -u|-t -4|-6 \
 # [(-rss -irq_prefix <irq-pattern-prefix>)|(-rps <rps_map>)]
 
-source setup_loopback.sh
+source $(dirname $0)/../../../net/lib/setup_loopback.sh
 readonly SERVER_IP4="192.168.1.200/24"
 readonly SERVER_IP6="fda8::1/64"
 readonly SERVER_MAC="aa:00:00:00:00:02"
index f627f1a2a2b8cea677e375ce80ecf136c8278df5..283ca5ffc244e698a253d2124a8b7c34bcdb902f 100644 (file)
@@ -7,7 +7,6 @@ cmsg_sender
 diag_uid
 epoll_busy_poll
 fin_ack_lat
-gro
 hwtstamp_config
 io_uring_zerocopy_tx
 ioam6_parser
@@ -57,7 +56,6 @@ tcp_port_share
 tfo
 timestamping
 tls
-toeplitz
 tools
 tun
 txring_overwrite
index b5127e9681083493230833ef1c06aac44b8b501d..b66ba04f19d9a1753579c36b31c5619c8008df91 100644 (file)
@@ -38,7 +38,6 @@ TEST_PROGS := \
        fq_band_pktlimit.sh \
        gre_gso.sh \
        gre_ipv6_lladdr.sh \
-       gro.sh \
        icmp.sh \
        icmp_redirect.sh \
        io_uring_zerocopy_tx.sh \
@@ -121,8 +120,6 @@ TEST_PROGS := \
 # end of TEST_PROGS
 
 TEST_PROGS_EXTENDED := \
-       toeplitz.sh \
-       toeplitz_client.sh \
        xfrm_policy_add_speed.sh \
 # end of TEST_PROGS_EXTENDED
 
@@ -130,7 +127,6 @@ TEST_GEN_FILES := \
        bind_bhash \
        cmsg_sender \
        fin_ack_lat \
-       gro \
        hwtstamp_config \
        io_uring_zerocopy_tx \
        ioam6_parser \
@@ -159,7 +155,6 @@ TEST_GEN_FILES := \
        tcp_mmap \
        tfo \
        timestamping \
-       toeplitz \
        txring_overwrite \
        txtimestamp \
        udpgso \
@@ -193,8 +188,6 @@ TEST_FILES := \
        in_netns.sh \
        lib.sh \
        settings \
-       setup_loopback.sh \
-       setup_veth.sh \
 # end of TEST_FILES
 
 # YNL files, must be before "include ..lib.mk"
index ce795bc0a1af9e80d4bc09bfb5a7c1ce0024e998..c10796933d420fa3affdaa65c9d87459cf82778f 100644 (file)
@@ -8,6 +8,8 @@ CFLAGS += -I../../
 TEST_FILES := \
        ../../../../net/ynl \
        ../../../../../Documentation/netlink/specs \
+       setup_loopback.sh \
+       setup_veth.sh \
 # end of TEST_FILES
 
 TEST_GEN_FILES := \