Hello, I’m doing some performance experiments with Suricata, but I’m having some issues with AF_XDP’s expected behavior.
I have two 100Gbps NICs connected. On one side I generated 100Gbps traffic with Pktgen, creating a significant number of flows to not saturate any single buffer/CPU. When running with AF_PACKET, I can see all packets being received by Suricata, even if it reports dropped packets.
However, when using AF_XDP, I can only reach around ~25Gbps with the expected behavior. After that, I can’t gracefully shut it down (CTRL-C), and it returns the following error:
threads: Engine unable to disable detect thread - “W#01-ens3f0np0”
Even tough I can’t gracefully shut it down, stats.logs continues to report capture.afxdp_packets and capture.kernel_drops. However, as I increase the throughput, their sum differs more and more compared to what Pktgen reports. Interesting, with ~20 Gbps and Suricata working as expected, the percentage of dropped packets was small, less than 1%.
I set 30 RSS queues with 30 threads on the threading settings and I’ve also configured the IRQ affinity. Since I observe the desired behavior with smaller throughput, this does not appear to be the issue.
The config for af-xdp is the following:
threads: 30 disable-promisc: false force-xdp-mode: drv force-bind-mode: zero mem-unaligned: yes enable-busy-poll: yes busy-poll-time: 20 busy-poll-budget: 64 gro-flush-timeout: 2000000 napi-defer-hard-irq: 2
I tried to play with busy-poll-budget, gro-flush-timeout, napi-defer-hard-irq, but I had no success in solving my issue. Maybe there is an optimal config, but I could not find it. For max-pending-packets, I tried 35000, 50000 or even bigger, to no success.
Finally, I saw the following warnings regarding XDP and eBPF:
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: elf: skipping unrecognized data section(7) xdp_metadata
libxdp: No bpffs found at /sys/fs/bpf
libxdp: Can’t use dispatcher without a working bpffs
libxdp: Falling back to loading single prog without dispatcher
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libxdp: No bpffs found at /sys/fs/bpf
Since it worked as it should up to 20 Gbps, I do not believe these could be an issue, but I’m not sure.
I expected that packets would be dropped even with AF_XDP, but I hoped it would continue to work as AF_PACKET did, even with 100Gbps. If anyone can shed some light into this, I would be grateful.