From 10ea53edcc844c6d11080e2ab1edf339732738e4 Mon Sep 17 00:00:00 2001 From: Saikrishna Edupuganti Date: Thu, 4 Feb 2021 09:36:17 +0000 Subject: [PATCH] Changes to use BESS dpdk-2011 branch Signed-off-by: Saikrishna Edupuganti --- Dockerfile | 13 +++- .../0002-DPDK-Add-AF_XDP-PMD-support.patch | 76 ------------------- ...B-routing-support-in-IPLookup-module.patch | 14 ---- 3 files changed, 9 insertions(+), 94 deletions(-) delete mode 100644 patches/bess/0002-DPDK-Add-AF_XDP-PMD-support.patch diff --git a/Dockerfile b/Dockerfile index 30c2ec5fe..79863fafe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,13 +9,18 @@ ARG CPU=native RUN apt-get update && \ apt-get -y install --no-install-recommends \ ca-certificates \ - libelf-dev - + libelf-dev \ + python3-pip \ + python3-setuptools +RUN pip3 install --no-cache-dir \ + meson \ + ninja + ARG MAKEFLAGS # linux ver should match target machine's kernel WORKDIR /libbpf -ARG LIBBPF_VER=v0.1.0 +ARG LIBBPF_VER=v0.3 RUN curl -L https://github.com/libbpf/libbpf/tarball/${LIBBPF_VER} | \ tar xz -C . --strip-components=1 && \ cp include/uapi/linux/if_xdp.h /usr/include/linux && \ @@ -25,7 +30,7 @@ RUN curl -L https://github.com/libbpf/libbpf/tarball/${LIBBPF_VER} | \ # BESS pre-reqs WORKDIR /bess -ARG BESS_COMMIT=master +ARG BESS_COMMIT=dpdk-2011 RUN curl -L https://github.com/NetSys/bess/tarball/${BESS_COMMIT} | \ tar xz -C . --strip-components=1 diff --git a/patches/bess/0002-DPDK-Add-AF_XDP-PMD-support.patch b/patches/bess/0002-DPDK-Add-AF_XDP-PMD-support.patch deleted file mode 100644 index 621810e4c..000000000 --- a/patches/bess/0002-DPDK-Add-AF_XDP-PMD-support.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 71615cac9ebb97fd1fd9a97b08f3913496b5a1ba Mon Sep 17 00:00:00 2001 -From: Saikrishna Edupuganti -Date: Fri, 26 Jun 2020 06:21:13 +0000 -Subject: [PATCH] [DPDK] Add AF_XDP PMD support - -We automatically detect if relevant header files, libbpf and deps are -installed on the system and update CONFIG_RTE_LIBRTE_PMD_AF_XDP -accordingly. - -Fixes: #987 - -Signed-off-by: Saikrishna Edupuganti ---- - build.py | 23 ++++++++++++++++++----- - 1 file changed, 18 insertions(+), 5 deletions(-) - -diff --git a/build.py b/build.py -index a984ce46..3007fd36 100755 ---- a/build.py -+++ b/build.py -@@ -223,9 +223,19 @@ def check_kernel_headers(): - set_config(DPDK_CONFIG, 'CONFIG_RTE_LIBRTE_PMD_KNI', 'n') - - -+def check_afxdp(): -+ if check_header('linux/if_xdp.h', 'gcc') and check_c_lib('bpf') and \ -+ check_c_lib('elf') and check_c_lib('z'): -+ extra_libs.add(('bpf', 'elf', 'z')) -+ set_config(DPDK_CONFIG, 'CONFIG_RTE_LIBRTE_PMD_AF_XDP', 'y') -+ else: -+ print(' - libbpf and dependencies are not available. Disabling AF_XDP PMD...') -+ set_config(DPDK_CONFIG, 'CONFIG_RTE_LIBRTE_PMD_AF_XDP', 'n') -+ -+ - def check_bnx(): - if check_header('zlib.h', 'gcc') and check_c_lib('z'): -- extra_libs.add('z') -+ extra_libs.add(('z')) - else: - print(' - "zlib1g-dev" is not available. Disabling BNX2X PMD...') - set_config(DPDK_CONFIG, 'CONFIG_RTE_LIBRTE_BNX2X_PMD', 'n') -@@ -234,9 +244,7 @@ def check_bnx(): - def check_mlx(): - if check_header('infiniband/ib.h', 'gcc') and check_c_lib('mlx4') and \ - check_c_lib('mlx5'): -- extra_libs.add('ibverbs') -- extra_libs.add('mlx4') -- extra_libs.add('mlx5') -+ extra_libs.add(('ibverbs', 'mlx4', 'mlx5')) - else: - print(' - "Mellanox OFED" is not available. ' - 'Disabling MLX4 and MLX5 PMDs...') -@@ -250,7 +258,11 @@ def check_mlx(): - - def generate_dpdk_extra_mk(): - with open('core/extra.dpdk.mk', 'w') as fp: -- fp.write('LIBS += %s\n' % ' '.join(['-l' + lib for lib in extra_libs])) -+ str = '' -+ for deps in extra_libs: -+ for lib in deps: -+ str += 'LIBS += %s\n' % ('-l' + lib) -+ fp.write(str) - - - def find_current_plugins(): -@@ -296,6 +308,7 @@ def configure_dpdk(): - cmd('make -C %s config T=%s' % (DPDK_DIR, DPDK_TARGET)) - - check_kernel_headers() -+ check_afxdp() - check_mlx() - generate_dpdk_extra_mk() - --- -2.25.1 - diff --git a/patches/bess/0003-Add-FIB-routing-support-in-IPLookup-module.patch b/patches/bess/0003-Add-FIB-routing-support-in-IPLookup-module.patch index 180b0929c..feab5e8ce 100644 --- a/patches/bess/0003-Add-FIB-routing-support-in-IPLookup-module.patch +++ b/patches/bess/0003-Add-FIB-routing-support-in-IPLookup-module.patch @@ -5,24 +5,10 @@ Subject: [PATCH] Add FIB routing support in IPLookup module. Signed-off-by: Muhammad Asim Jamshed --- - build.py | 2 +- core/modules/ip_lookup.cc | 61 +++++++++++++++++++++++++++++++++++++-- core/modules/ip_lookup.h | 14 +++++++++ 3 files changed, 74 insertions(+), 3 deletions(-) -diff --git a/build.py b/build.py -index 3fac9064..d0f16cc7 100755 ---- a/build.py -+++ b/build.py -@@ -95,5 +95,5 @@ DPDK_TARGET = 'x86_64-native-linuxapp-gcc' - kernel_release = cmd('uname -r', quiet=True).strip() - - DPDK_DIR = '%s/%s' % (DEPS_DIR, DPDK_VER) --DPDK_CFLAGS = '"-g -w"' -+DPDK_CFLAGS = '"-g -w -DALLOW_EXPERIMENTAL_API"' - DPDK_CONFIG = '%s/build/.config' % DPDK_DIR - - extra_libs = set() diff --git a/core/modules/ip_lookup.cc b/core/modules/ip_lookup.cc index 3c8b1157..7e976d41 100644 --- a/core/modules/ip_lookup.cc