From: "Bastien Curutchet (eBPF Foundation)" <bastien.curutchet@bootlin.com>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>,
Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>,
Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Alexis Lothore <alexis.lothore@bootlin.com>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
"Bastien Curutchet (eBPF Foundation)"
<bastien.curutchet@bootlin.com>
Subject: [PATCH 1/3] selftests/bpf: test_xdp_redirect: Rename BPF sections
Date: Fri, 03 Jan 2025 11:10:09 +0100 [thread overview]
Message-ID: <20250103-xdp_redirect-v1-1-e93099f59069@bootlin.com> (raw)
In-Reply-To: <20250103-xdp_redirect-v1-0-e93099f59069@bootlin.com>
SEC("redirect_to_111") and SEC("redirect_to_222") can't be loaded by the
__load() helper.
Rename both sections SEC("xdp") so it can be interpreted by the __load()
helper in upcoming patch.
Update the test_xdp_redirect.sh to use the program name instead of the
section name to load the BPF program.
Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
---
tools/testing/selftests/bpf/progs/test_xdp_redirect.c | 4 ++--
tools/testing/selftests/bpf/test_xdp_redirect.sh | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/progs/test_xdp_redirect.c b/tools/testing/selftests/bpf/progs/test_xdp_redirect.c
index b778cad454852ed3a1808aca665dd9f9cc2b6c7b..7025aee08a001cfc42e52174a4acce7869dd331b 100644
--- a/tools/testing/selftests/bpf/progs/test_xdp_redirect.c
+++ b/tools/testing/selftests/bpf/progs/test_xdp_redirect.c
@@ -12,12 +12,12 @@
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
-SEC("redirect_to_111")
+SEC("xdp")
int xdp_redirect_to_111(struct xdp_md *xdp)
{
return bpf_redirect(111, 0);
}
-SEC("redirect_to_222")
+SEC("xdp")
int xdp_redirect_to_222(struct xdp_md *xdp)
{
return bpf_redirect(222, 0);
diff --git a/tools/testing/selftests/bpf/test_xdp_redirect.sh b/tools/testing/selftests/bpf/test_xdp_redirect.sh
index 0746a4fde9d3181667c081698249a1b6dd1d7663..3c61a1c22b084aa5ca824ec5e8057aa2fee12b71 100755
--- a/tools/testing/selftests/bpf/test_xdp_redirect.sh
+++ b/tools/testing/selftests/bpf/test_xdp_redirect.sh
@@ -56,8 +56,8 @@ test_xdp_redirect()
ip -n ${NS1} link set veth11 $xdpmode obj xdp_dummy.bpf.o sec xdp &> /dev/null
ip -n ${NS2} link set veth22 $xdpmode obj xdp_dummy.bpf.o sec xdp &> /dev/null
- ip link set dev veth1 $xdpmode obj test_xdp_redirect.bpf.o sec redirect_to_222 &> /dev/null
- ip link set dev veth2 $xdpmode obj test_xdp_redirect.bpf.o sec redirect_to_111 &> /dev/null
+ ip link set dev veth1 $xdpmode obj test_xdp_redirect.bpf.o program xdp_redirect_to_222 &> /dev/null
+ ip link set dev veth2 $xdpmode obj test_xdp_redirect.bpf.o program xdp_redirect_to_111 &> /dev/null
if ip netns exec ${NS1} ping -c 1 10.1.1.22 &> /dev/null &&
ip netns exec ${NS2} ping -c 1 10.1.1.11 &> /dev/null; then
--
2.47.1
next prev parent reply other threads:[~2025-01-03 10:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 10:10 [PATCH 0/3] selftests: bpf: Migrate test_xdp_redirect.sh to test_progs Bastien Curutchet (eBPF Foundation)
2025-01-03 10:10 ` Bastien Curutchet (eBPF Foundation) [this message]
2025-01-03 13:18 ` [PATCH 1/3] selftests/bpf: test_xdp_redirect: Rename BPF sections Alexis Lothoré
2025-01-03 10:10 ` [PATCH 2/3] selftests/bpf: Migrate test_xdp_redirect.sh to xdp_do_redirect.c Bastien Curutchet (eBPF Foundation)
2025-01-03 12:54 ` Alexis Lothoré
2025-01-06 7:54 ` Bastien Curutchet
2025-01-03 13:17 ` Alexis Lothoré
2025-01-06 8:24 ` Bastien Curutchet
2025-01-07 19:48 ` Martin KaFai Lau
2025-01-03 10:10 ` [PATCH 3/3] selftests/bpf: Migrate test_xdp_redirect.c to test_xdp_do_redirect.c Bastien Curutchet (eBPF Foundation)
2025-01-03 10:20 ` [PATCH 0/3] selftests: bpf: Migrate test_xdp_redirect.sh to test_progs Bastien Curutchet
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=20250103-xdp_redirect-v1-1-e93099f59069@bootlin.com \
--to=bastien.curutchet@bootlin.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yonghong.song@linux.dev \
/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