summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2019-10-21 15:33:04 +0200
committerIlya Maximets <i.maximets@ovn.org>2019-10-21 22:07:00 +0200
commitd5ad58044a9a5b415db8a94f42576380fecb2dd7 (patch)
tree243cf5792c2e4ce44073689326acc1e40d81c8f9
parenta6028d3abb104e7c4815b979deab57a6292e57c9 (diff)
downloadopenvswitch-d5ad58044a9a5b415db8a94f42576380fecb2dd7.tar.gz
travis: Test build with afxdp.
We can't easily update the kernel on TravisCI to run system tests with AF_XDP, but we could run build tests with libbpf and headers from newer kernels. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
-rw-r--r--.travis.yml1
-rwxr-xr-x.travis/linux-build.sh34
2 files changed, 29 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml
index eabbad92d..5676d9748 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,6 +39,7 @@ env:
- TESTSUITE=1 LIBS=-ljemalloc
- KERNEL_LIST="5.0 4.20 4.19 4.18 4.17 4.16"
- KERNEL_LIST="4.15 4.14 4.9 4.4 3.19 3.16"
+ - AFXDP=1 KERNEL=5.3
- M32=1 OPTS="--disable-ssl"
- DPDK=1 OPTS="--enable-shared"
- DPDK_SHARED=1
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh
index 758c8235c..889c7d2fe 100755
--- a/.travis/linux-build.sh
+++ b/.travis/linux-build.sh
@@ -38,7 +38,7 @@ function install_kernel()
wget ${url} || wget ${url} || wget ${url/cdn/www}
tar xvf linux-${version}.tar.xz > /dev/null
- cd linux-${version}
+ pushd linux-${version}
make allmodconfig
# Cannot use CONFIG_KCOV: -fsanitize-coverage=trace-pc is not supported by compiler
@@ -60,9 +60,26 @@ function install_kernel()
make net/bridge/
fi
- EXTRA_OPTS="${EXTRA_OPTS} --with-linux=$(pwd)"
- echo "Installed kernel source in $(pwd)"
- cd ..
+ 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"
+ else
+ EXTRA_OPTS="${EXTRA_OPTS} --with-linux=$(pwd)"
+ echo "Installed kernel source in $(pwd)"
+ fi
+ popd
}
function install_dpdk()
@@ -127,8 +144,9 @@ function build_ovs()
configure_ovs $OPTS
make selinux-policy
- # Only build datapath if we are testing kernel w/o running testsuite
- if [ "${KERNEL}" ]; then
+ # Only build datapath if we are testing kernel w/o running testsuite and
+ # AF_XDP support.
+ if [ "${KERNEL}" ] && ! [ "$AFXDP" ]; then
pushd datapath
make -j4
popd
@@ -161,6 +179,10 @@ elif [ "$M32" ]; then
export CC="$CC -m32"
else
OPTS="--enable-sparse"
+ if [ "$AFXDP" ]; then
+ # netdev-afxdp uses memset for 64M for umem initialization.
+ SPARSE_FLAGS="${SPARSE_FLAGS} -Wno-memcpy-max-count"
+ fi
CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${SPARSE_FLAGS}"
fi