]> www.infradead.org Git - users/hch/misc.git/commitdiff
selftests: net: use the dummy bpf from net/lib
authorJakub Kicinski <kuba@kernel.org>
Thu, 27 Mar 2025 22:23:14 +0000 (15:23 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 31 Mar 2025 23:44:25 +0000 (16:44 -0700)
Commit 29b036be1b0b ("selftests: drv-net: test XDP, HDS auto and
the ioctl path") added an sample XDP_PASS prog in net/lib, so
that we can reuse it in various sub-directories. Delete the old
sample and use the one from the lib in existing tests.

Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250327222315.1098596-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hw/irq.py
tools/testing/selftests/drivers/net/hw/xdp_dummy.bpf.c [deleted file]
tools/testing/selftests/net/udpgro_bench.sh
tools/testing/selftests/net/udpgro_frglist.sh
tools/testing/selftests/net/udpgro_fwd.sh
tools/testing/selftests/net/veth.sh
tools/testing/selftests/net/xdp_dummy.bpf.c [deleted file]

index d772a18d8a1b48c89ac555885736d9c656eff840..0699d6a8b4e27c6c9274f5d871d35c12335c8e83 100755 (executable)
@@ -69,7 +69,7 @@ def check_reconfig_queues(cfg) -> None:
 def check_reconfig_xdp(cfg) -> None:
     def reconfig(cfg) -> None:
         ip(f"link set dev %s xdp obj %s sec xdp" %
-           (cfg.ifname, cfg.test_dir / "xdp_dummy.bpf.o"))
+           (cfg.ifname, cfg.net_lib_dir / "xdp_dummy.bpf.o"))
         ip(f"link set dev %s xdp off" % cfg.ifname)
 
     _check_reconfig(cfg, reconfig)
diff --git a/tools/testing/selftests/drivers/net/hw/xdp_dummy.bpf.c b/tools/testing/selftests/drivers/net/hw/xdp_dummy.bpf.c
deleted file mode 100644 (file)
index d988b2e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-
-#define KBUILD_MODNAME "xdp_dummy"
-#include <linux/bpf.h>
-#include <bpf/bpf_helpers.h>
-
-SEC("xdp")
-int xdp_dummy_prog(struct xdp_md *ctx)
-{
-       return XDP_PASS;
-}
-
-char _license[] SEC("license") = "GPL";
index c51ea90a1395f302e53d2defa9ae3b38b8cb4f24..815fad8c53a84d1c9b939141bc1b2c9104119acc 100755 (executable)
@@ -7,7 +7,7 @@ source net_helper.sh
 
 readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)"
 
-BPF_FILE="xdp_dummy.bpf.o"
+BPF_FILE="lib/xdp_dummy.bpf.o"
 
 cleanup() {
        local -r jobs="$(jobs -p)"
index 17404f49cdb688dce52266cdf3de61d7fe6d5dc9..5f3d1a110d11586f3241982bb8b688f24538aab9 100755 (executable)
@@ -7,7 +7,7 @@ source net_helper.sh
 
 readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)"
 
-BPF_FILE="xdp_dummy.bpf.o"
+BPF_FILE="lib/xdp_dummy.bpf.o"
 
 cleanup() {
        local -r jobs="$(jobs -p)"
index 550d8eb3e224cd7e358240dead0a889b872709a3..f22f6c66997ef97f716362e08a76c74ae4e6a179 100755 (executable)
@@ -3,7 +3,7 @@
 
 source net_helper.sh
 
-BPF_FILE="xdp_dummy.bpf.o"
+BPF_FILE="lib/xdp_dummy.bpf.o"
 readonly BASE="ns-$(mktemp -u XXXXXX)"
 readonly SRC=2
 readonly DST=1
index 6bb7dfaa30b6ae6ea3685ed481fbaaa111a9f41b..9709dd067c728359fb6a5a576a36c88425883f37 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0
 
-BPF_FILE="xdp_dummy.bpf.o"
+BPF_FILE="lib/xdp_dummy.bpf.o"
 readonly STATS="$(mktemp -p /tmp ns-XXXXXX)"
 readonly BASE=`basename $STATS`
 readonly SRC=2
diff --git a/tools/testing/selftests/net/xdp_dummy.bpf.c b/tools/testing/selftests/net/xdp_dummy.bpf.c
deleted file mode 100644 (file)
index d988b2e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-
-#define KBUILD_MODNAME "xdp_dummy"
-#include <linux/bpf.h>
-#include <bpf/bpf_helpers.h>
-
-SEC("xdp")
-int xdp_dummy_prog(struct xdp_md *ctx)
-{
-       return XDP_PASS;
-}
-
-char _license[] SEC("license") = "GPL";