Message ID | 20210731055738.16820-7-joamaki@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | : XDP bonding support | expand |
On Thu, Aug 5, 2021 at 9:10 AM Jussi Maki <joamaki@gmail.com> wrote: > > The program type cannot be deduced from 'tx' which causes an invalid > argument error when trying to load xdp_tx.o using the skeleton. > Rename the section name to "xdp" so that libbpf can deduce the type. > > Signed-off-by: Jussi Maki <joamaki@gmail.com> > --- LGTM. Acked-by: Andrii Nakryiko <andrii@kernel.org> > tools/testing/selftests/bpf/progs/xdp_tx.c | 2 +- > tools/testing/selftests/bpf/test_xdp_veth.sh | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/bpf/progs/xdp_tx.c b/tools/testing/selftests/bpf/progs/xdp_tx.c > index 94e6c2b281cb..5f725c720e00 100644 > --- a/tools/testing/selftests/bpf/progs/xdp_tx.c > +++ b/tools/testing/selftests/bpf/progs/xdp_tx.c > @@ -3,7 +3,7 @@ > #include <linux/bpf.h> > #include <bpf/bpf_helpers.h> > > -SEC("tx") > +SEC("xdp") > int xdp_tx(struct xdp_md *xdp) > { > return XDP_TX; > diff --git a/tools/testing/selftests/bpf/test_xdp_veth.sh b/tools/testing/selftests/bpf/test_xdp_veth.sh > index ba8ffcdaac30..995278e684b6 100755 > --- a/tools/testing/selftests/bpf/test_xdp_veth.sh > +++ b/tools/testing/selftests/bpf/test_xdp_veth.sh > @@ -108,7 +108,7 @@ ip link set dev veth2 xdp pinned $BPF_DIR/progs/redirect_map_1 > ip link set dev veth3 xdp pinned $BPF_DIR/progs/redirect_map_2 > > ip -n ns1 link set dev veth11 xdp obj xdp_dummy.o sec xdp_dummy > -ip -n ns2 link set dev veth22 xdp obj xdp_tx.o sec tx > +ip -n ns2 link set dev veth22 xdp obj xdp_tx.o sec xdp > ip -n ns3 link set dev veth33 xdp obj xdp_dummy.o sec xdp_dummy > > trap cleanup EXIT > -- > 2.17.1 >
diff --git a/tools/testing/selftests/bpf/progs/xdp_tx.c b/tools/testing/selftests/bpf/progs/xdp_tx.c index 94e6c2b281cb..5f725c720e00 100644 --- a/tools/testing/selftests/bpf/progs/xdp_tx.c +++ b/tools/testing/selftests/bpf/progs/xdp_tx.c @@ -3,7 +3,7 @@ #include <linux/bpf.h> #include <bpf/bpf_helpers.h> -SEC("tx") +SEC("xdp") int xdp_tx(struct xdp_md *xdp) { return XDP_TX; diff --git a/tools/testing/selftests/bpf/test_xdp_veth.sh b/tools/testing/selftests/bpf/test_xdp_veth.sh index ba8ffcdaac30..995278e684b6 100755 --- a/tools/testing/selftests/bpf/test_xdp_veth.sh +++ b/tools/testing/selftests/bpf/test_xdp_veth.sh @@ -108,7 +108,7 @@ ip link set dev veth2 xdp pinned $BPF_DIR/progs/redirect_map_1 ip link set dev veth3 xdp pinned $BPF_DIR/progs/redirect_map_2 ip -n ns1 link set dev veth11 xdp obj xdp_dummy.o sec xdp_dummy -ip -n ns2 link set dev veth22 xdp obj xdp_tx.o sec tx +ip -n ns2 link set dev veth22 xdp obj xdp_tx.o sec xdp ip -n ns3 link set dev veth33 xdp obj xdp_dummy.o sec xdp_dummy trap cleanup EXIT
The program type cannot be deduced from 'tx' which causes an invalid argument error when trying to load xdp_tx.o using the skeleton. Rename the section name to "xdp" so that libbpf can deduce the type. Signed-off-by: Jussi Maki <joamaki@gmail.com> --- tools/testing/selftests/bpf/progs/xdp_tx.c | 2 +- tools/testing/selftests/bpf/test_xdp_veth.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)