Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: net: use the dummy bpf from net/lib

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>

+5 -31
+1 -1
tools/testing/selftests/drivers/net/hw/irq.py
··· 69 69 def check_reconfig_xdp(cfg) -> None: 70 70 def reconfig(cfg) -> None: 71 71 ip(f"link set dev %s xdp obj %s sec xdp" % 72 - (cfg.ifname, cfg.test_dir / "xdp_dummy.bpf.o")) 72 + (cfg.ifname, cfg.net_lib_dir / "xdp_dummy.bpf.o")) 73 73 ip(f"link set dev %s xdp off" % cfg.ifname) 74 74 75 75 _check_reconfig(cfg, reconfig)
-13
tools/testing/selftests/drivers/net/hw/xdp_dummy.bpf.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - 3 - #define KBUILD_MODNAME "xdp_dummy" 4 - #include <linux/bpf.h> 5 - #include <bpf/bpf_helpers.h> 6 - 7 - SEC("xdp") 8 - int xdp_dummy_prog(struct xdp_md *ctx) 9 - { 10 - return XDP_PASS; 11 - } 12 - 13 - char _license[] SEC("license") = "GPL";
+1 -1
tools/testing/selftests/net/udpgro_bench.sh
··· 7 7 8 8 readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" 9 9 10 - BPF_FILE="xdp_dummy.bpf.o" 10 + BPF_FILE="lib/xdp_dummy.bpf.o" 11 11 12 12 cleanup() { 13 13 local -r jobs="$(jobs -p)"
+1 -1
tools/testing/selftests/net/udpgro_frglist.sh
··· 7 7 8 8 readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" 9 9 10 - BPF_FILE="xdp_dummy.bpf.o" 10 + BPF_FILE="lib/xdp_dummy.bpf.o" 11 11 12 12 cleanup() { 13 13 local -r jobs="$(jobs -p)"
+1 -1
tools/testing/selftests/net/udpgro_fwd.sh
··· 3 3 4 4 source net_helper.sh 5 5 6 - BPF_FILE="xdp_dummy.bpf.o" 6 + BPF_FILE="lib/xdp_dummy.bpf.o" 7 7 readonly BASE="ns-$(mktemp -u XXXXXX)" 8 8 readonly SRC=2 9 9 readonly DST=1
+1 -1
tools/testing/selftests/net/veth.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 - BPF_FILE="xdp_dummy.bpf.o" 4 + BPF_FILE="lib/xdp_dummy.bpf.o" 5 5 readonly STATS="$(mktemp -p /tmp ns-XXXXXX)" 6 6 readonly BASE=`basename $STATS` 7 7 readonly SRC=2
-13
tools/testing/selftests/net/xdp_dummy.bpf.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - 3 - #define KBUILD_MODNAME "xdp_dummy" 4 - #include <linux/bpf.h> 5 - #include <bpf/bpf_helpers.h> 6 - 7 - SEC("xdp") 8 - int xdp_dummy_prog(struct xdp_md *ctx) 9 - { 10 - return XDP_PASS; 11 - } 12 - 13 - char _license[] SEC("license") = "GPL";