Bug 1252 - Failure building af_xdp with gcc 10.4.1/11.3.1 on RHEL 8.7
Summary: Failure building af_xdp with gcc 10.4.1/11.3.1 on RHEL 8.7
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: ethdev (show other bugs)
Version: 23.07
Hardware: POWER Linux
: Normal normal
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2023-06-16 00:26 CEST by David Christensen
Modified: 2023-06-16 01:20 CEST (History)
0 users



Attachments

Description David Christensen 2023-06-16 00:26:32 CEST
Distro: RHEL 8.7
Architecture: ppc64le

Building DPDK with libbpf-devel installed generates an error while building net/af_xdp.

Compiler versions used:

// RHEL 8.7 default compiler
$ gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-15)

// IBM Advanced Toolchain 14.0-7
$ gcc --version
gcc (GCC) 10.4.1 20230306 (Advance-Toolchain 14.0-7) [2d1a2d671959]

// IBM Advanced Toolchain 15.0-5
$ gcc --version
gcc (GCC) 11.3.1 20230502 (Advance-Toolchain 15.0-5) [1c5713852c11]


Meson configuration results when the libbpf-devel package is NOT installed:

$ meson build
...
=================
Content Skipped
=================
...
drivers:
	common/mvep:	missing dependency, "libmusdk"
...
	net/af_xdp:	missing dependency, "libxdp >=1.2.2" and "libbpf"
...


Ninja build results with different compiler versions:

gcc 8.5 / v23.07-rc1 / no libbpf-devel / PASS
gcc 10.4.1 / v23.07-rc1 / no libbpf-devel / PASS
gcc 11.3.1 / v23.07-rc1 / no libbpf-devel / PASS


Meson configuration results when the libbpf-devel package IS installed:

$ rpm -qa | grep libbpf-devel
libbpf-devel-0.5.0-1.el8.ppc64le
$ meson build
...
===============
Drivers Enabled
===============
...
net:
	af_packet, af_xdp, ark, atlantic, avp, axgbe, bnx2x, bnxt,
...

gcc 8.5 / v23.07-rc1 / libbpf-devel / PASS
gcc 10.4.1 / v23.07-rc1 / libbpf-devel / FAIL
gcc 11.3.1 / v23.07-rc1 / libbpf-devel / FAIL

gcc 10.4.1 failure:
===================
Found ninja-1.8.2 at /usr/bin/ninja
[589/3019] Compiling C object drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o
FAILED: drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o
cc -Idrivers/libtmp_rte_net_af_xdp.a.p -Idrivers -I../drivers -Idrivers/net/af_xdp -I../drivers/net/af_xdp -Ilib/ethdev -I../lib/ethdev -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/ppc/include -I../lib/eal/ppc/include -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/meter -I../lib/meter -Idrivers/bus/pci -I../drivers/bus/pci -I../drivers/bus/pci/linux -Ilib/pci -I../lib/pci -Idrivers/bus/vdev -I../drivers/bus/vdev -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -O3 -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-zero-length-bounds -Wno-psabi -D_GNU_SOURCE -fPIC -mcpu=power9 -mtune=power9 -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=pmd.net.af_xdp -MD -MQ drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o -MF drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o.d -o drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o -c ../drivers/net/af_xdp/rte_eth_af_xdp.c
In file included from ../drivers/net/af_xdp/compat.h:8,
                 from ../drivers/net/af_xdp/rte_eth_af_xdp.c:42:
/usr/include/bpf/xsk.h: In function ‘xsk_ring_prod__needs_wakeup’:
/usr/include/bpf/xsk.h:148:21: error: ‘XDP_RING_NEED_WAKEUP’ undeclared (first use in this function)
  148 |  return *r->flags & XDP_RING_NEED_WAKEUP;
      |                     ^~~~~~~~~~~~~~~~~~~~
/usr/include/bpf/xsk.h:148:21: note: each undeclared identifier is reported only once for each function it appears in
/usr/include/bpf/xsk.h: In function ‘xsk_umem__extract_addr’:
/usr/include/bpf/xsk.h:235:16: error: ‘XSK_UNALIGNED_BUF_ADDR_MASK’ undeclared (first use in this function)
  235 |  return addr & XSK_UNALIGNED_BUF_ADDR_MASK;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/bpf/xsk.h: In function ‘xsk_umem__extract_offset’:
/usr/include/bpf/xsk.h:240:17: error: ‘XSK_UNALIGNED_BUF_OFFSET_SHIFT’ undeclared (first use in this function)
  240 |  return addr >> XSK_UNALIGNED_BUF_OFFSET_SHIFT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[718/3019] Compiling C object lib/librte_vhost.so.23.2.p/vhost_virtio_net.c.o
ninja: build stopped: subcommand failed.

gcc 11.3.1 failure:
===================
Found ninja-1.8.2 at /usr/bin/ninja
[579/3019] Compiling C object drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o
FAILED: drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o
cc -Idrivers/libtmp_rte_net_af_xdp.a.p -Idrivers -I../drivers -Idrivers/net/af_xdp -I../drivers/net/af_xdp -Ilib/ethdev -I../lib/ethdev -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/ppc/include -I../lib/eal/ppc/include -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/meter -I../lib/meter -Idrivers/bus/pci -I../drivers/bus/pci -I../drivers/bus/pci/linux -Ilib/pci -I../lib/pci -Idrivers/bus/vdev -I../drivers/bus/vdev -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -O3 -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-zero-length-bounds -Wno-psabi -D_GNU_SOURCE -fPIC -mcpu=power9 -mtune=power9 -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=pmd.net.af_xdp -MD -MQ drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o -MF drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o.d -o drivers/libtmp_rte_net_af_xdp.a.p/net_af_xdp_rte_eth_af_xdp.c.o -c ../drivers/net/af_xdp/rte_eth_af_xdp.c
In file included from /usr/include/bpf/xsk.h:20,
                 from ../drivers/net/af_xdp/compat.h:8,
                 from ../drivers/net/af_xdp/rte_eth_af_xdp.c:42:
/usr/include/bpf/libbpf.h:770:33: error: field ‘info’ has incomplete type
  770 |         struct bpf_prog_info    info;
      |                                 ^~~~
[708/3019] Compiling C object lib/librte_vhost.a.p/vhost_virtio_net.c.o
ninja: build stopped: subcommand failed.
Comment 1 David Christensen 2023-06-16 01:20:14 CEST
Additional information:

RHEL 8.7 system
$ uname -a
Linux ce1f68ab7a9d 4.18.0-425.3.1.el8.ppc64le-drc-01 #1 SMP Fri Jun 2 11:11:46 EDT 2023 ppc64le ppc64le ppc64le GNU/Linux


RHEL 9.1 system
$ uname -a
Linux ltczz386-lp2.aus.stglabs.ibm.com 5.14.0-drc-01 #1 SMP Thu Jun 15 10:31:32 PDT 2023 ppc64le ppc64le ppc64le GNU/Linux

$ gcc --version
gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)

$ meson build
...
===============
Drivers Enabled
===============
...
net:
	af_packet, af_xdp, ark, atlantic, avp, axgbe, bnx2x, bnxt,
...

$ ninja -C build
ninja: Entering directory `build'
[2848/2848] Linking target app/test/dpdk-test

Note You need to log in before you can comment on or make changes to this bug.