Bug #5855
closedaf-xdp: may fail to build on Linux systems with kernel older than 5.11
Description
Good day!
Trying to build Suricata with AF_XDP support, but got this error:
@ CC source-af-xdp.o
source-af-xdp.c: In function 'ConfigureBusyPolling':
source-af-xdp.c:402:36: error: 'SO_PREFER_BUSY_POLL' undeclared (first use in this function); did you mean 'SO_BUSY_POLL'?
402 | if (setsockopt(fd, SOL_SOCKET, SO_PREFER_BUSY_POLL, (void *)&sock_opt, sizeof(sock_opt)) < 0) {
| ^~~~~~~~~~~~~~~~~
| SO_BUSY_POLL
source-af-xdp.c:402:36: note: each undeclared identifier is reported only once for each function it appears in
source-af-xdp.c:412:36: error: 'SO_BUSY_POLL_BUDGET' undeclared (first use in this function); did you mean 'SO_BUSY_POLL'?
412 | if (setsockopt(fd, SOL_SOCKET, SO_BUSY_POLL_BUDGET, (void *)&sock_opt, sizeof(sock_opt)) < 0) {
| ^~~~~~~~~~~~~~~~~
| SO_BUSY_POLL
source-af-xdp.c: In function 'AFXDPSocketCreation':
source-af-xdp.c:490:9: error: implicit declaration of function 'bpf_get_link_xdp_id' [-Werror=implicit-function-declaration]
490 | if (bpf_get_link_xdp_id(ptv->ifindex, &ptv->prog_id, ptv->xsk.cfg.xdp_flags)) {
| ^~~~~~~~~~~~~~~~~@
Suricata Configuration:
AF_PACKET support: yes
AF_XDP support: yes
DPDK support: yes
eBPF support: no
XDP support: no
PF_RING support: no
NFQueue support: no
NFLOG support: no
IPFW support: no
Netmap support: no
DAG enabled: no
Napatech enabled: no
WinDivert enabled: no
Environment:
root@suricata-7:/opt/suricata# uname -a
Linux suricata-7 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
root@suricata-7:/opt/suricata# cat /etc/debian_version
11.6
root@suricata-7:/opt/suricata# dpkg -l | grep libxdp-dev
ii libxdp-dev:amd64 1.2.9-1~bpo11+1 amd64 library and utilities for use with XDP - development files