From 649dbc19ffc0acd050ad729b9052aba8c7fce090 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Thu, 22 Dec 2022 01:06:22 +0100 Subject: github: Test AF_XDP build using libbpf instead of kernel sources. AF_XDP bits was removed from kernel's libbpf in 6.0. libbpf and libxdp are now primary way to build AF_XDP applications. Most of modern distributions are already packaging some version of libbpf, so it's better to test building with it instead of building old unsupported kernel tree. Ubuntu started packaging libxdp only in 22.10, so not using it for now. Kernel build infrastructure in CI scripts is not needed anymore. Removed. Acked-by: Eelco Chaudron Signed-off-by: Ilya Maximets --- .ci/linux-build.sh | 77 ------------------------------------ .github/workflows/build-and-test.yml | 10 ++--- 2 files changed, 3 insertions(+), 84 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index e6e4f6a60..10021fddb 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -7,79 +7,6 @@ CFLAGS_FOR_OVS="-g -O2" SPARSE_FLAGS="" EXTRA_OPTS="--enable-Werror" -function install_kernel() -{ - if [[ "$1" =~ ^5.* ]]; then - PREFIX="v5.x" - elif [[ "$1" =~ ^4.* ]]; then - PREFIX="v4.x" - elif [[ "$1" =~ ^3.* ]]; then - PREFIX="v3.x" - else - PREFIX="v2.6/longterm/v2.6.32" - fi - - base_url="https://cdn.kernel.org/pub/linux/kernel/${PREFIX}" - # Download page with list of all available kernel versions. - wget ${base_url}/ - # Uncompress in case server returned gzipped page. - (file index* | grep ASCII) || (mv index* index.new.gz && gunzip index*) - # Get version of the latest stable release. - hi_ver=$(echo ${1} | sed 's/\./\\\./') - lo_ver=$(cat ./index* | grep -P -o "${hi_ver}\.[0-9]+" | \ - sed 's/.*\..*\.\(.*\)/\1/' | sort -h | tail -1) - version="${1}.${lo_ver}" - - rm -rf index* linux-* - - url="${base_url}/linux-${version}.tar.xz" - # Download kernel sources. Try direct link on CDN failure. - wget ${url} || - (rm -f linux-${version}.tar.xz && wget ${url}) || - (rm -f linux-${version}.tar.xz && wget ${url/cdn/www}) - - tar xvf linux-${version}.tar.xz > /dev/null - pushd linux-${version} - make allmodconfig - - # Cannot use CONFIG_KCOV: -fsanitize-coverage=trace-pc is not supported by compiler - sed -i 's/CONFIG_KCOV=y/CONFIG_KCOV=n/' .config - - # stack validation depends on tools/objtool, but objtool does not compile on travis. - # It is giving following error. - # >>> GEN arch/x86/insn/inat-tables.c - # >>> Semantic error at 40: Unknown imm opnd: AL - # So for now disable stack-validation for the build. - - sed -i 's/CONFIG_STACK_VALIDATION=y/CONFIG_STACK_VALIDATION=n/' .config - make oldconfig - - # Older kernels do not include openvswitch - if [ -d "net/openvswitch" ]; then - make net/openvswitch/ - else - make net/bridge/ - fi - - if [ "$AFXDP" ]; then - sudo make headers_install INSTALL_HDR_PATH=/usr - pushd tools/lib/bpf/ - # Bulding with gcc because there are some issues in make files - # that breaks building libbpf with clang on Travis. - CC=gcc sudo make install - CC=gcc sudo make install_headers - sudo ldconfig - popd - # The Linux kernel defines __always_inline in stddef.h (283d7573), and - # sys/cdefs.h tries to re-define it. Older libc-dev package in xenial - # doesn't have a fix for this issue. Applying it manually. - sudo sed -i '/^# define __always_inline .*/i # undef __always_inline' \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h || true - EXTRA_OPTS="${EXTRA_OPTS} --enable-afxdp" - fi - popd -} - function install_dpdk() { local DPDK_VER=$1 @@ -202,10 +129,6 @@ assert ovs.json.from_string('{\"a\": 42}') == {'a': 42}" exit 0 fi -if [ "$KERNEL" ]; then - install_kernel $KERNEL -fi - if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then if [ -z "$DPDK_VER" ]; then DPDK_VER="22.11.1" diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1949d1200..82675b973 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,14 +8,12 @@ jobs: dependencies: | automake libtool gcc bc libjemalloc2 libjemalloc-dev \ libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev \ - ninja-build selinux-policy-dev - AFXDP: ${{ matrix.afxdp }} + ninja-build selinux-policy-dev libbpf-dev ASAN: ${{ matrix.asan }} UBSAN: ${{ matrix.ubsan }} CC: ${{ matrix.compiler }} DPDK: ${{ matrix.dpdk }} DPDK_SHARED: ${{ matrix.dpdk_shared }} - KERNEL: ${{ matrix.kernel }} LIBS: ${{ matrix.libs }} M32: ${{ matrix.m32 }} OPTS: ${{ matrix.opts }} @@ -65,11 +63,9 @@ jobs: libs: -ljemalloc - compiler: gcc - afxdp: afxdp - kernel: 5.3 + opts: --enable-afxdp - compiler: clang - afxdp: afxdp - kernel: 5.3 + opts: --enable-afxdp - compiler: gcc dpdk: dpdk -- cgit v1.2.1