Bug 896

Summary: [20.11.4-rc1] net/af_xdp build failure with gcc 11 on Fedora 35
Product: DPDK Reporter: Ali Alnubani (alialnu)
Component: ethdevAssignee: dev
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: 20.11   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Ali Alnubani 2021-12-08 10:13:20 CET
I can reproduce the following build error on 20.11.4-rc1:

"""
$ meson --werror --buildtype=debugoptimized build && ninja-build -C build
[..]
drivers/net/af_xdp/rte_eth_af_xdp.c: In function 'load_custom_xdp_prog':
drivers/net/af_xdp/rte_eth_af_xdp.c:1065:15: error: implicit declaration of function 'bpf_prog_load'; did you mean 'bpf_program__load'? [-Werror=implicit-function-declaration]
 1065 |         ret = bpf_prog_load(prog_path, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
      |               ^~~~~~~~~~~~~
      |               bpf_program__load
drivers/net/af_xdp/rte_eth_af_xdp.c:1065:15: error: nested extern declaration of 'bpf_prog_load' [-Werror=nested-externs]
cc1: all warnings being treated as errors
"""

OS: Fedora Linux 35 (Container Image)
gcc: 11.2.1 20210728 (Red Hat 11.2.1-1)
Comment 1 Ali Alnubani 2021-12-08 11:13:09 CET
libbpf is installed from https://github.com/libbpf/libbpf:master.

$ git clone --depth=1 https://github.com/libbpf/libbpf --depth=1
$ cd libbpf/src
$ make && make install
Comment 2 Ali Alnubani 2021-12-08 14:32:47 CET
Reproduces with https://github.com/libbpf/libbpf/releases/tag/v0.6.0.
Doesn't reproduce with https://github.com/libbpf/libbpf/releases/tag/v0.5.0.