From 67dc2705f6717874b61f3b0e6c4e6decf7be48b7 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Wed, 1 Dec 2021 13:40:03 +0100 Subject: [PATCH] dpdkbuild: use enable_drivers rather than disable_drivers Since DPDK 21.05 -Denable_drivers option is present, which only enables selected drivers in DPDK. As name would suggest it is exact oposite of -Ddisable_drivers. When building DPDK submodule all unused drivers were disabled anyway. Simplify this process by using the new option. Signed-off-by: Tomasz Zawadzki Change-Id: Ic8ac84b1d6dc88dd7c0b8c4aca391f31bfc93404 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10505 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Paul Luse Reviewed-by: Jim Harris --- autobuild.sh | 8 +------- dpdkbuild/Makefile | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 4597e2829..58629bf37 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -95,8 +95,6 @@ function build_native_dpdk() { # net/i40e driver is not really needed by us, but it's built as a workaround # for DPDK issue: https://bugs.dpdk.org/show_bug.cgi?id=576 DPDK_DRIVERS=("bus" "bus/pci" "bus/vdev" "mempool/ring" "net/i40e" "net/i40e/base") - # all possible DPDK drivers - 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 intel_ipsec_mb_ver=v0.54 @@ -150,10 +148,6 @@ function build_native_dpdk() { export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$isal_dir/build/lib" fi - # Use difference between DPDK_ALL_DRIVERS and DPDK_DRIVERS as a set of DPDK drivers we don't want or - # don't need to build. - DPDK_DISABLED_DRIVERS=($(sort <(printf "%s\n" "${DPDK_DRIVERS[@]}") <(printf "%s\n" "${DPDK_ALL_DRIVERS[@]}") | uniq -u)) - cd $external_dpdk_base_dir if [ "$(uname -s)" = "Linux" ]; then if [[ $dpdk_ver == 20.11* ]]; then @@ -167,7 +161,7 @@ function build_native_dpdk() { meson build-tmp --prefix="$external_dpdk_dir" --libdir lib \ -Denable_docs=false -Denable_kmods=false -Dtests=false \ -Dc_link_args="$dpdk_ldflags" -Dc_args="$dpdk_cflags" \ - -Dmachine=native -Ddisable_drivers=$(printf "%s," "${DPDK_DISABLED_DRIVERS[@]}") + -Dmachine=native -Denable_drivers=$(printf "%s," "${DPDK_DRIVERS[@]}") ninja -C "$external_dpdk_base_dir/build-tmp" $MAKEFLAGS ninja -C "$external_dpdk_base_dir/build-tmp" $MAKEFLAGS install diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index 0cb2fa27d..93bbcf79d 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -123,10 +123,6 @@ endif # Force-disable scan-build SUB_CC = $(patsubst %ccc-analyzer,$(DEFAULT_CC),$(CC)) -DPDK_ALL_DRIVER_DIRS = $(shell find $(SPDK_ROOT_DIR)/dpdk/drivers -mindepth 1 -type d) -DPDK_ALL_DRIVERS = $(DPDK_ALL_DRIVER_DIRS:$(SPDK_ROOT_DIR)/dpdk/drivers/%=%) -DPDK_DISABLED_DRIVERS = $(filter-out $(DPDK_DRIVERS),$(DPDK_ALL_DRIVERS)) - ifneq ($(OS),FreeBSD) SED_INPLACE_FLAG = "-i" MESON_PREFIX = $(SPDK_ROOT_DIR)/dpdk/build @@ -167,7 +163,7 @@ all: $(SPDK_ROOT_DIR)/dpdk/build-tmp $(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk $(SPDK_ROOT_DIR)/include/spdk/config.h $(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build $(SPDK_ROOT_DIR)/dpdk/build-tmp - $(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson --prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)" -Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS) -Ddisable_drivers="$(shell echo $(DPDK_DISABLED_DRIVERS) | sed -E "s/ +/,/g")" build-tmp + $(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson --prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)" -Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS) -Denable_drivers="$(shell echo $(DPDK_DRIVERS) | sed -E "s/ +/,/g")" build-tmp $(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_EAL_PMD_PATH .*/#define RTE_EAL_PMD_PATH ""/g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h $(Q) \ # TODO Meson build adds libbsd dependency when it's available. This means any app will be \