RTNETLINK error on loading XDP program to ConnectX-5

Hi Mellanox team and community,

I’m trying to load an XDP program from the Linux kernel samples from

kernel 5.4, ubuntu 20, on a Mellanox ConnectX-5 100G dual-port NIC.

At a high level, I’m seeing an RTNETLINK invalid argument error upon

loading the XDP program on to a Mellanox ConnectX-5 NIC, even though

the error does not occur when I load the program to the localhost (lo)

interface. This is why I’m posting to the Mellanox community, just in

case the error is device-specific. I would be grateful for any

assistance!

Here is what I did:

First I compiled the Linux’s kernel BPF samples by running

make LLC=llc-9 CLANG=clang-9 M=samples/bpf

from the source tree v5.4 on a stock Ubuntu20 distribution on an AMD

EPYC processor (x86_64). (This step requires installing clang-9 and

llvm-9 tools.)

If I then type the command

sudo ip link set dev ens3f0 xdp object samples/bpf/xdp_fwd_kern.o section xdp_fwd verbose

to load the xdp_fwd sample, I see the following error:

RTNETLINK answers: Invalid argument

Here, ens3f0 is one of the Mellanox ConnectX-5 interfaces. (I’ve

attached the full output of the command below.)

If I load the program to the localhost interface instead, it loads

without errors (I’ve attached full output of the command below).

Similar things happen if I try to run the user-space loader from the

kernel itself, i.e.,

sudo ./samples/bpf/xdp_fwd lo

works without error, whereas

sudo ./samples/bpf/xdp_fwd ens3f0

fails with

ERROR: failed to attach program to ens3f0

It is clear that the adapter and driver support XDP (I’m able to see

XDP counters upon running ethtool -S ens3f0 | grep xdp

Kindly let me know if I can provide any more details.

Is there any chance the error is related to some kernel or

device-driver configuration?

I would be very grateful for any help. Thanks!

Srinivas

As seen from the dmesg message in the comment above, mlx5_core 0000:41:00.0 ens3f0: XDP is not allowed with MTU(9000) > 3498 , changing the MTU of the interface allowed me to load the program successfully. I used ifconfig ens3f0 mtu 3498

Hi Srinivas,

Please note that xdp will support jumbo frame in kernel v5.11 or v5.12.

Regards,

Chen