From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
bpf@vger.kernel.org, andrii@kernel.org, mykolal@fb.com,
eddyz87@gmail.com, shuah@kernel.org,
linux-kselftest@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 1/4] selftests: move bpf-offload test from bpf to net
Date: Mon, 8 Apr 2024 20:15:46 -0700 [thread overview]
Message-ID: <20240409031549.3531084-2-kuba@kernel.org> (raw)
In-Reply-To: <20240409031549.3531084-1-kuba@kernel.org>
We're building more python tests on the netdev side, and some
of the classes from the venerable BPF offload tests can be reused.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/bpf/Makefile | 1 -
tools/testing/selftests/net/Makefile | 8 +++++++-
.../selftests/{bpf/test_offload.py => net/bpf_offload.py} | 0
.../progs/sample_map_ret0.c => net/sample_map_ret0.bpf.c} | 0
.../{bpf/progs/sample_ret0.c => net/sample_ret0.bpf.c} | 0
5 files changed, 7 insertions(+), 2 deletions(-)
rename tools/testing/selftests/{bpf/test_offload.py => net/bpf_offload.py} (100%)
rename tools/testing/selftests/{bpf/progs/sample_map_ret0.c => net/sample_map_ret0.bpf.c} (100%)
rename tools/testing/selftests/{bpf/progs/sample_ret0.c => net/sample_ret0.bpf.c} (100%)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 3b9eb40d6343..b0be07f29dde 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -102,7 +102,6 @@ TEST_PROGS := test_kmod.sh \
test_xdp_redirect_multi.sh \
test_xdp_meta.sh \
test_xdp_veth.sh \
- test_offload.py \
test_sock_addr.sh \
test_tunnel.sh \
test_lwt_seg6local.sh \
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 5e34c93aa51b..e8bfa715aa49 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -84,6 +84,8 @@ TEST_GEN_FILES += sctp_hello
TEST_GEN_FILES += csum
TEST_GEN_FILES += nat6to4.o
TEST_GEN_FILES += xdp_dummy.o
+TEST_GEN_FILES += sample_ret0.bpf.o
+TEST_GEN_FILES += sample_map_ret0.bpf.o
TEST_GEN_FILES += ip_local_port_range
TEST_GEN_FILES += bind_wildcard
TEST_PROGS += test_vxlan_mdb.sh
@@ -93,6 +95,7 @@ TEST_PROGS += test_bridge_backup_port.sh
TEST_PROGS += fdb_flush.sh
TEST_PROGS += fq_band_pktlimit.sh
TEST_PROGS += vlan_hw_filter.sh
+TEST_PROGS += bpf_offload.py
TEST_FILES := settings
TEST_FILES += in_netns.sh lib.sh net_helper.sh setup_loopback.sh setup_veth.sh
@@ -142,7 +145,10 @@ endif
CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG),$(CLANG_TARGET_ARCH))
-$(OUTPUT)/nat6to4.o $(OUTPUT)/xdp_dummy.o: $(OUTPUT)/%.o : %.c $(BPFOBJ) | $(MAKE_DIRS)
+BPF_PROG_OBJS := $(OUTPUT)/nat6to4.o $(OUTPUT)/xdp_dummy.o \
+ $(OUTPUT)/sample_map_ret0.bpf.o $(OUTPUT)/sample_ret0.bpf.o
+
+$(BPF_PROG_OBJS): $(OUTPUT)/%.o : %.c $(BPFOBJ) | $(MAKE_DIRS)
$(CLANG) -O2 --target=bpf -c $< $(CCINCLUDE) $(CLANG_SYS_INCLUDES) -o $@
$(BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile) \
diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/net/bpf_offload.py
similarity index 100%
rename from tools/testing/selftests/bpf/test_offload.py
rename to tools/testing/selftests/net/bpf_offload.py
diff --git a/tools/testing/selftests/bpf/progs/sample_map_ret0.c b/tools/testing/selftests/net/sample_map_ret0.bpf.c
similarity index 100%
rename from tools/testing/selftests/bpf/progs/sample_map_ret0.c
rename to tools/testing/selftests/net/sample_map_ret0.bpf.c
diff --git a/tools/testing/selftests/bpf/progs/sample_ret0.c b/tools/testing/selftests/net/sample_ret0.bpf.c
similarity index 100%
rename from tools/testing/selftests/bpf/progs/sample_ret0.c
rename to tools/testing/selftests/net/sample_ret0.bpf.c
--
2.44.0
next prev parent reply other threads:[~2024-04-09 3:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 3:15 [PATCH net-next 0/4] selftests: move bpf-offload test from bpf to net Jakub Kicinski
2024-04-09 3:15 ` Jakub Kicinski [this message]
2024-04-09 3:15 ` [PATCH net-next 2/4] selftests: net: bpf_offload: wait for maps Jakub Kicinski
2024-04-09 3:15 ` [PATCH net-next 3/4] selftests: net: declare section names for bpf_offload Jakub Kicinski
2024-04-09 17:32 ` Alexei Starovoitov
2024-04-09 3:15 ` [PATCH net-next 4/4] selftests: net: reuse common code in bpf_offload Jakub Kicinski
2024-04-09 16:10 ` [PATCH net-next 0/4] selftests: move bpf-offload test from bpf to net Stanislav Fomichev
2024-04-09 16:19 ` Jakub Kicinski
2024-04-09 21:31 ` Jakub Kicinski
2024-04-09 18:12 ` Martin KaFai Lau
2024-04-10 21:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240409031549.3531084-2-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).