On 23/10/2024 07:07, Xiaohua Wang wrote:

Hi,

 

dpdk-testpmd with AF_XDP PMD can't work on p1p1 (macvlan) interface, but can work on eth0 (veth) interface.

 

And is there a method to enable AF_XDP PMD to work in XDP SKB mode? Or add one option to set “SKB mode” in AF_XDP Options ?


[MT] I believe this is what the `force_copy=1` option does. But I'm not sure this will fix your issue as the log below says that it does try SKB mode. It could be a limitation of the Kernel driver.


 

===============can't work on p1p1 (macvlan) interface====================

 

5p8j4:/tmp # ./dpdk-testpmd --log-level=pmd.net.af_xdp:debug --no-huge --no-pci --no-telemetry --vdev net_af_xdp,iface=p1p1 -- --total-num-mbufs 8192

EAL: Detected CPU lcores: 40

EAL: Detected NUMA nodes: 1

EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem

EAL: Detected static linkage of DPDK

EAL: Multi-process socket /var/run/dpdk/rte/mp_socket

EAL: Selected IOVA mode 'VA'

EAL: VFIO support initialized

rte_pmd_af_xdp_probe(): Initializing pmd_af_xdp for net_af_xdp

init_internals(): Zero copy between umem and mbuf enabled.

testpmd: create a new mbuf pool <mb_pool_0>: n=8192, size=2176, socket=0

testpmd: preferred mempool ops selected: ring_mp_mc

 

Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.

 

Configuring Port 0 (socket 0)

eth_rx_queue_setup(): Set up rx queue, rx queue id: 0, xsk queue id: 0

libbpf: elf: skipping unrecognized data section(8) .xdp_run_config

libbpf: elf: skipping unrecognized data section(9) xdp_metadata

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: prog 'xdp_pass': BPF program load failed: Invalid argument

libbpf: prog 'xdp_pass': failed to load: -22

libbpf: failed to load object '/usr/lib64/bpf/xdp-dispatcher.o'

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: elf: skipping unrecognized data section(7) xdp_metadata

libbpf: Kernel error message: Underlying driver does not support XDP in native mode

libxdp: Error attaching XDP program to ifindex 5: Operation not supported

libxdp: XDP mode not supported; try using SKB mode

[MT] Here it attempts SKB mode, then fails

xsk_configure(): Failed to create xsk socket.

eth_rx_queue_setup(): Failed to configure xdp socket

Fail to configure port 0 rx queues

rte_pmd_af_xdp_remove(): Removing AF_XDP ethdev on numa socket 0

eth_dev_close(): Closing AF_XDP ethdev on numa socket 0

Port 0 is closed

EAL: Error - exiting with code: 1

Cause: Start ports failed

EAL: Already called cleanup