xdp-project / xdp-tutorial

XDP tutorial
2.51k stars 582 forks source link

advanced03-AF_XDP: load file fails on recent Linux kernels #288

Open uablrek opened 2 years ago

uablrek commented 2 years ago

Some time around linux-5.13 loading fails with;

# ./af_xdp_user -d eth1 --filename af_xdp_kern.o
libbpf: Netlink-based XDP prog detected, please unload it in order to launch AF_XDP prog
ERROR: Can't setup AF_XDP socket "Invalid argument"
uablrek commented 2 years ago

Start without --filename works;

# ./af_xdp_user -d eth1
AF_XDP RX:             0 pkts (         0 pps)           0 Kbytes (     0 Mbits/s) period:2.000275
       TX:             0 pkts (         0 pps)           0 Kbytes (     0 Mbits/s) period:2.000275

AF_XDP RX:             0 pkts (         0 pps)           0 Kbytes (     0 Mbits/s) period:2.003799
       TX:             0 pkts (         0 pps)           0 Kbytes (     0 Mbits/s) period:2.003799