From 8ee2a317cf7d14bd8aab7f14c1d85cfb0be8b954 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 26 Oct 2021 13:55:21 +0200 Subject: [PATCH] autobuild: Adjusting crypto build for latest DPDK (21.11) Details of the changes here: https://github.com/dpdk/dpdk/commit/918fd2f1466b0e3b21a033df7012a77a83665582. They mainly target the aesni_mb driver which was moved to ipsec_mb and bump the minimal supported version of the ipsec to v1.0. Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10003 (master) (cherry picked from commit 089cbda8bf1db6cd6ed142e536de7543beaf089a) Change-Id: Ica3b4fd66684751939159511845eb6ac6f7d5205 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10039 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- autobuild.sh | 25 +++++++++++++++++++------ lib/env_dpdk/env.mk | 6 ++++++ rpmbuild/spdk.spec | 2 +- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 93a78fb5af..eb3caa7c4b 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -81,6 +81,7 @@ function build_native_dpdk() { dpdk_cflags="-fPIC -g -fcommon" dpdk_ldflags="" + dpdk_ver=$(< "$external_dpdk_base_dir/VERSION") if [[ $compiler == *gcc* && $compiler_version -ge 5 ]]; then dpdk_cflags+=" -Werror" @@ -98,17 +99,29 @@ function build_native_dpdk() { DPDK_ALL_DRIVERS=($(find "$external_dpdk_base_dir/drivers" -mindepth 1 -type d | sed -n "s#^$external_dpdk_base_dir/drivers/##p")) if [[ "$SPDK_TEST_CRYPTO" -eq 1 ]]; then - git clone --branch v0.54 --depth 1 https://github.com/intel/intel-ipsec-mb.git "$external_dpdk_base_dir/intel-ipsec-mb" + intel_ipsec_mb_ver=v0.54 + intel_ipsec_mb_drv=crypto/aesni_mb + intel_ipsec_lib="" + if ge "$dpdk_ver" 21.11.0; then + # Minimum supported version of intel-ipsec-mb, for DPDK >= 21.11, is 1.0. + # Source of the aesni_mb driver was moved to ipsec_mb. .{h,so,a} were moved + # to ./lib. + # https://github.com/dpdk/dpdk/commit/918fd2f1466b0e3b21a033df7012a77a83665582. + intel_ipsec_mb_ver=v1.0 + intel_ipsec_mb_drv=crypto/ipsec_mb + intel_ipsec_lib=lib + fi + git clone --branch "$intel_ipsec_mb_ver" --depth 1 https://github.com/intel/intel-ipsec-mb.git "$external_dpdk_base_dir/intel-ipsec-mb" cd "$external_dpdk_base_dir/intel-ipsec-mb" $MAKE $MAKEFLAGS all SHARED=y EXTRA_CFLAGS=-fPIC DPDK_DRIVERS+=("crypto") - DPDK_DRIVERS+=("crypto/aesni_mb") + DPDK_DRIVERS+=("$intel_ipsec_mb_drv") DPDK_DRIVERS+=("crypto/qat") DPDK_DRIVERS+=("compress/qat") DPDK_DRIVERS+=("common/qat") - dpdk_cflags+=" -I$external_dpdk_base_dir/intel-ipsec-mb" - dpdk_ldflags+=" -L$external_dpdk_base_dir/intel-ipsec-mb" - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$external_dpdk_base_dir/intel-ipsec-mb + dpdk_cflags+=" -I$external_dpdk_base_dir/intel-ipsec-mb/$intel_ipsec_lib" + dpdk_ldflags+=" -L$external_dpdk_base_dir/intel-ipsec-mb/$intel_ipsec_lib" + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$external_dpdk_base_dir/intel-ipsec-mb/$intel_ipsec_lib" fi if [[ "$SPDK_TEST_REDUCE" -eq 1 ]]; then @@ -125,7 +138,7 @@ function build_native_dpdk() { DPDK_DRIVERS+=("compress/isal") DPDK_DRIVERS+=("compress/qat") DPDK_DRIVERS+=("common/qat") - if ge "$(< "$external_dpdk_base_dir/VERSION")" 21.02.0; then + if ge "$dpdk_ver" 21.02.0; then # SPDK enables REDUCE_MLX in case supported version of DPDK is detected # so make sure proper libs are built. DPDK_DRIVERS+=("bus/auxiliary") diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index cc7db8aabe..0492faeb5a 100644 --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -78,13 +78,19 @@ DPDK_FRAMEWORK=n ifeq ($(CONFIG_CRYPTO),y) DPDK_FRAMEWORK=y DPDK_LIB_LIST += rte_reorder +ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_crypto_ipsec_mb.*)) +# PMD name as of DPDK 21.11 +DPDK_LIB_LIST += rte_crypto_ipsec_mb +else ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_crypto_aesni_mb.*)) +# PMD name for DPDK 21.08 and earlier DPDK_LIB_LIST += rte_crypto_aesni_mb else # PMD name for DPDK 20.08 and earlier DPDK_LIB_LIST += rte_pmd_aesni_mb endif endif +endif ifeq ($(CONFIG_REDUCE),y) DPDK_FRAMEWORK=y diff --git a/rpmbuild/spdk.spec b/rpmbuild/spdk.spec index 508ef58c71..754abd91af 100644 --- a/rpmbuild/spdk.spec +++ b/rpmbuild/spdk.spec @@ -68,7 +68,7 @@ make DESTDIR=%{buildroot} install mkdir -p %{buildroot}/usr/local/lib/dpdk cp -a %{dpdk_build_path}/lib/* %{buildroot}/usr/local/lib/dpdk/ # Special case for SPDK_RUN_EXTERNAL_DPDK setup -[[ -e %{dpdk_path}/intel-ipsec-mb ]] && cp -a %{dpdk_path}/intel-ipsec-mb/*.so* %{buildroot}/usr/local/lib/dpdk/ +[[ -e %{dpdk_path}/intel-ipsec-mb ]] && find %{dpdk_path}/intel-ipsec-mb/ -name '*.so*' -exec cp -a {} %{buildroot}/usr/local/lib/dpdk/ ';' [[ -e %{dpdk_path}/isa-l/build/lib ]] && cp -a %{dpdk_path}/isa-l/build/lib/*.so* %{buildroot}/usr/local/lib/dpdk/ %endif