0

I am currently trying to get the AF_XDP-Tutorial running from here: https://github.com/xdp-project/xdp-tutorial/tree/master/advanced03-AF_XDP

I was able to compile it but if I try to put the xdp-code into the kernel via:

sudo ./af_xdp_user --dev veth-basic02 --force

I get this error:

ERROR: Can't setup AF_XDP socket "Operation not permitted"

Then I checked for the Kernel flags

CONFIG_BPF=y CONFIG_BPF_SYSCALL=y CONFIG_XDP_SOCKETS=y

in /boot/config-4.18.0-25-generic and they are all there.

So as a next step, I tried to compile the program not with the libbpf-submodule in the xdp-tutorial repository, but with the latest version from here: https://github.com/libbpf/libbpf/tree/master/src

But now, if I try to compile the program, I get this output:

cc -Wall -I../libbpf/src/build/usr/include/ -g -I../headers/ -L../libbpf/src -o af_xdp_user ../common/common_libbpf.o ../common/common_params.o ../common/common_user_bpf_xdp.o \ af_xdp_user.c -l:libbpf.a -lelf -lpthread /usr/bin/ld: ../libbpf/src/libbpf.a(libbpf.o): undefined reference to symbol 'gzopen64@@ZLIB_1.2.3.3' /usr/bin/ld: //lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line

Anyone able to help?

Edit:

Output of sudo strace ./af_xdp_user --dev veth-basic02 --force:

https://pastebin.com/Pyj3NJ2m

Edit_2: Since the creation of this post I upgraded to kernel 5.3.0-28 - but unfortunately nothing has changed

Qeole
  • 8,284
  • 1
  • 24
  • 52
binaryBigInt
  • 1,526
  • 2
  • 18
  • 44
  • 1
    Could you try `sudo strace ./af_xdp_user --dev veth-basic02 --force` and report the output in the original post above? That should tell us exactly which syscalls are failing. If you have a recent version of strace (v5.3+), you can do `sudo strace -Z ./af_xdp_user --dev veth-basic02 --force` to see only failing syscalls. – pchaigno Feb 20 '20 at 09:09
  • @pchaigno Thank you, I added the output to the original post – binaryBigInt Feb 20 '20 at 09:22
  • I'm guessing this is the same issue as https://stackoverflow.com/questions/60322147/xdp-program-ip-link-error-prog-section-rejected-operation-not-permitted#60322147 and therefore a duplicate now? – pchaigno Feb 20 '20 at 15:57
  • Yes, you are right @pchaigno – binaryBigInt Feb 20 '20 at 16:01

0 Answers0