From 19e2dc385384b68fd02238b4b9347050d5909c7d Mon Sep 17 00:00:00 2001 From: paul luse Date: Fri, 28 Oct 2022 16:07:51 -0700 Subject: [PATCH] configure: rename --with-reduce --with-vbdev-compress This is in prep for adding a new compressDev accel_fw module that will contain all of the DPDK compressDev specifics on it, the vbdev will make calls to the accel_fw instead. As the accel_fw has SW based compression, we want the configure option to apply to building the vbdev module but not the accel_sw software implementation or the upcoming compressdev module. Renamed to "compress" as reduce is a term specific to the vbdev implementation of the compression to be provided by the accel_fw and thus the same reason why we leave the test flag called REDUCE because it's controlling tests for the reduce library as well as the vbdev module that is using reduce. The flag does not apply to the SW implementation of compression. This does not affect upcoming accel_fw compressdev module, that will have its own configure option. Signed-off-by: paul luse Change-Id: If8ed3e48e1e3dabcaad1cd161289e78122cd9d58 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15179 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Aleksey Marchuk --- CONFIG | 8 ++++---- autobuild.sh | 2 +- autotest.sh | 4 ++-- configure | 30 +++++++++++++++--------------- dpdkbuild/Makefile | 10 +++++----- lib/Makefile | 2 +- lib/env_dpdk/env.mk | 12 ++++++------ mk/spdk.modules.mk | 4 ++-- module/bdev/Makefile | 2 +- scripts/vagrant/autorun-spdk.conf | 2 +- test/common/autotest_common.sh | 10 +++++----- test/common/config/pkgdep/git | 2 +- test/unit/lib/Makefile | 2 +- test/unit/lib/bdev/Makefile | 2 +- test/unit/unittest.sh | 4 ++-- 15 files changed, 48 insertions(+), 48 deletions(-) diff --git a/CONFIG b/CONFIG index b55d284fb..e42bd1d7b 100644 --- a/CONFIG +++ b/CONFIG @@ -128,11 +128,11 @@ CONFIG_PMDK_DIR= # Build with xNVMe CONFIG_XNVME=n -# Enable the dependencies for building the compress vbdev -CONFIG_REDUCE=n +# Enable the dependencies for building the compress vbdev, includes the reduce library +CONFIG_VBDEV_COMPRESS=n -# Enable mlx5_pci dpdk compress PMD, enabled automatically if CONFIG_REDUCE=y and libmlx5 exists -CONFIG_REDUCE_MLX5=n +# Enable mlx5_pci dpdk compress PMD, enabled automatically if CONFIG_VBDEV_COMPRESS=y and libmlx5 exists +CONFIG_VBDEV_COMPRESS_MLX5=n # Enable mlx5_pci dpdk crypto PMD, enabled automatically if CONFIG_CRYPTO=y and libmlx5 exists CONFIG_CRYPTO_MLX5=n diff --git a/autobuild.sh b/autobuild.sh index c13f7a16f..6bc9f973f 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -165,7 +165,7 @@ function build_native_dpdk() { 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 + if [[ "$SPDK_TEST_VBDEV_COMPRESS" -eq 1 ]]; then isal_dir="$external_dpdk_base_dir/isa-l" git clone --branch v2.29.0 --depth 1 https://github.com/intel/isa-l.git "$isal_dir" diff --git a/autotest.sh b/autotest.sh index cd0634261..bbcafacc6 100755 --- a/autotest.sh +++ b/autotest.sh @@ -147,7 +147,7 @@ if [ $SPDK_TEST_UNITTEST -eq 1 ]; then fi if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then - if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then + if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_VBDEV_COMPRESS -eq 1 ]]; then if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then ./scripts/qat_setup.sh igb_uio else @@ -324,7 +324,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then run_test "vmd" ./test/vmd/vmd.sh fi - if [ $SPDK_TEST_REDUCE -eq 1 ]; then + if [ $SPDK_TEST_VBDEV_COMPRESS -eq 1 ]; then run_test "compress_qat" ./test/compress/compress.sh "qat" run_test "compress_isal" ./test/compress/compress.sh "isal" fi diff --git a/configure b/configure index 547df894a..c75bd1949 100755 --- a/configure +++ b/configure @@ -73,8 +73,8 @@ function usage() { echo " --with-pmdk[=DIR] Build persistent memory bdev. example: /usr/share/pmdk" echo " --without-pmdk No path required." - echo " --with-reduce Build vbdev compression module." - echo " --without-reduce No path required." + echo " --with-vbdev-compress Build vbdev compression module and dependencies." + echo " --without-vbdev-compress No path required." echo " --with-rbd Build Ceph RBD bdev module." echo " --without-rbd No path required." echo " --with-rdma[=DIR] Build RDMA transport for NVMf target and initiator." @@ -531,11 +531,11 @@ for i in "$@"; do --without-pmdk) CONFIG[PMDK]=n ;; - --with-reduce) - CONFIG[REDUCE]=y + --with-vbdev-compress) + CONFIG[VBDEV_COMPRESS]=y ;; - --without-reduce) - CONFIG[REDUCE]=n + --without-vbdev-compress) + CONFIG[VBDEV_COMPRESS]=n ;; --with-xnvme) CONFIG[XNVME]=y @@ -899,41 +899,41 @@ function mlx5_build() { return 0 } -if [[ "${CONFIG[REDUCE]}" = "y" ]]; then +if [[ "${CONFIG[VBDEV_COMPRESS]}" = "y" ]]; then if ! echo -e '#include \nint main(void) { return 0; }\n' \ | "${BUILD_CMD[@]}" -lpmem - 2> /dev/null; then - echo "--with-reduce requires libpmem." + echo "--with-vbdev-compress requires libpmem." echo "Please install then re-run this script." exit 1 fi # Try to enable mlx5 compress - CONFIG[REDUCE_MLX5]="y" + CONFIG[VBDEV_COMPRESS_MLX5]="y" # Check if libmlx5 exists to enable mlx5_pci compress PMD if ! mlx5_build; then echo "libmlx5 is not found, so disabling DPDK mlx5_pci compress PMD" - CONFIG[REDUCE_MLX5]="n" + CONFIG[VBDEV_COMPRESS_MLX5]="n" else if [[ "${CONFIG[DPDK_PKG_CONFIG]}" = "y" ]]; then # Check if librte_compress_mlx5 exists in DPDK package if [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_compress_mlx5.so ]; then echo "librte_compress_mlx5 is not found, so disabling DPDK mlx5_pci compress PMD" - CONFIG[REDUCE_MLX5]="n" + CONFIG[VBDEV_COMPRESS_MLX5]="n" fi else # Check DPDK version to determine if mlx5_pci driver is supported dpdk_ver=$(dpdk_version) if [[ $dpdk_ver = "none" ]]; then echo "Cannot get DPDK version, so disabling DPDK mlx5_pci compress PMD" - CONFIG[REDUCE_MLX5]="n" + CONFIG[VBDEV_COMPRESS_MLX5]="n" elif [[ -n $dpdk_ver ]] && lt "$dpdk_ver" 21.02.0; then # mlx5_pci for compress is supported by DPDK >- 21.02.0 echo "DPDK version ${dpdk_ver} doesn't support mlx5_pci compress PMD" - CONFIG[REDUCE_MLX5]="n" + CONFIG[VBDEV_COMPRESS_MLX5]="n" elif [[ -n ${CONFIG[DPDK_LIB_DIR]} ]] && [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_compress_mlx5.so ]; then # This is only checked when --with-dpdk or --with-dpdk=* is used echo "librte_compress_mlx5 is not found, so disabling DPDK mlx5_pci compress PMD" - CONFIG[REDUCE_MLX5]="n" + CONFIG[VBDEV_COMPRESS_MLX5]="n" fi fi fi @@ -1161,7 +1161,7 @@ else echo "Without ISA-L, there is no software support for crypto or compression," echo "so these features will be disabled." CONFIG[CRYPTO]=n - CONFIG[REDUCE]=n + CONFIG[VBDEV_COMPRESS]=n fi if [[ "${CONFIG[SMA]}" = "y" ]]; then diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index 7b2a45c87..16488dfd9 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -39,13 +39,13 @@ DPDK_LIBS += kvargs telemetry # Governor required libs DPDK_LIBS += power timer ethdev net -# common crypto/reduce drivers -ifeq ($(findstring y,$(CONFIG_CRYPTO)$(CONFIG_REDUCE)),y) +# common crypto/compress drivers +ifeq ($(findstring y,$(CONFIG_CRYPTO)$(CONFIG_VBDEV_COMPRESS)),y) DPDK_DRIVERS += crypto/qat compress/qat common/qat endif # common mlx5 libs -ifeq ($(findstring y,$(CONFIG_CRYPTO_MLX5)$(CONFIG_REDUCE_MLX5)),y) +ifeq ($(findstring y,$(CONFIG_CRYPTO_MLX5)$(CONFIG_VBDEV_COMPRESS_MLX5)),y) DPDK_DRIVERS += common/mlx5 bus/auxiliary endif @@ -63,9 +63,9 @@ DPDK_LDFLAGS += -L$(IPSEC_MB_DIR) endif endif -ifeq ($(CONFIG_REDUCE),y) +ifeq ($(CONFIG_VBDEV_COMPRESS),y) DPDK_DRIVERS += compress compress/isal -ifeq ($(CONFIG_REDUCE_MLX5),y) +ifeq ($(CONFIG_VBDEV_COMPRESS_MLX5),y) DPDK_DRIVERS += compress/mlx5 endif DPDK_CFLAGS += -I$(ISAL_DIR) diff --git a/lib/Makefile b/lib/Makefile index 55b3325be..37186bd70 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -18,7 +18,7 @@ DIRS-$(CONFIG_OCF) += env_ocf DIRS-$(CONFIG_IDXD) += idxd DIRS-$(CONFIG_VHOST) += vhost DIRS-$(CONFIG_VIRTIO) += virtio -DIRS-$(CONFIG_REDUCE) += reduce +DIRS-$(CONFIG_VBDEV_COMPRESS) += reduce DIRS-$(CONFIG_RDMA) += rdma DIRS-$(CONFIG_VFIO_USER) += vfu_tgt diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index e0b4b9d1a..91e1fb1f6 100644 --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -48,12 +48,12 @@ DPDK_LIB_LIST += rte_power rte_ethdev rte_net endif endif -# There are some complex dependencies when using crypto, reduce or both so +# There are some complex dependencies when using crypto, compress or both so # here we add the feature specific ones and set a flag to add the common # ones after that. DPDK_FRAMEWORK=n -ifeq ($(findstring y,$(CONFIG_CRYPTO_MLX5)$(CONFIG_REDUCE_MLX5)),y) +ifeq ($(findstring y,$(CONFIG_CRYPTO_MLX5)$(CONFIG_VBDEV_COMPRESS_MLX5)),y) DPDK_LIB_LIST += rte_common_mlx5 # Introduced in DPDK 21.08 ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_bus_auxiliary.*)) @@ -80,12 +80,12 @@ endif endif endif -ifeq ($(CONFIG_REDUCE),y) +ifeq ($(CONFIG_VBDEV_COMPRESS),y) DPDK_FRAMEWORK=y ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_compress_isal.*)) DPDK_LIB_LIST += rte_compress_isal endif -ifeq ($(CONFIG_REDUCE_MLX5),y) +ifeq ($(CONFIG_VBDEV_COMPRESS_MLX5),y) DPDK_LIB_LIST += rte_compress_mlx5 endif endif @@ -151,9 +151,9 @@ DPDK_PRIVATE_LINKER_ARGS += -lmlx5 -libverbs endif endif -ifeq ($(CONFIG_REDUCE),y) +ifeq ($(CONFIG_VBDEV_COMPRESS),y) DPDK_PRIVATE_LINKER_ARGS += -lisal -L$(ISAL_DIR)/.libs -ifeq ($(CONFIG_REDUCE_MLX5),y) +ifeq ($(CONFIG_VBDEV_COMPRESS_MLX5),y) DPDK_PRIVATE_LINKER_ARGS += -lmlx5 -libverbs endif endif diff --git a/mk/spdk.modules.mk b/mk/spdk.modules.mk index c6ed25ab3..bdf52ea9f 100644 --- a/mk/spdk.modules.mk +++ b/mk/spdk.modules.mk @@ -34,10 +34,10 @@ BLOCKDEV_MODULES_LIST += bdev_ocf BLOCKDEV_MODULES_LIST += ocfenv endif -ifeq ($(CONFIG_REDUCE),y) +ifeq ($(CONFIG_VBDEV_COMPRESS),y) BLOCKDEV_MODULES_LIST += bdev_compress reduce BLOCKDEV_MODULES_PRIVATE_LIBS += -lpmem -ifeq ($(CONFIG_REDUCE_MLX5),y) +ifeq ($(CONFIG_VBDEV_COMPRESS_MLX5),y) BLOCKDEV_MODULES_PRIVATE_LIBS += -lmlx5 -libverbs endif endif diff --git a/module/bdev/Makefile b/module/bdev/Makefile index ed3a91dde..9963a6e8f 100644 --- a/module/bdev/Makefile +++ b/module/bdev/Makefile @@ -14,7 +14,7 @@ DIRS-$(CONFIG_CRYPTO) += crypto DIRS-$(CONFIG_OCF) += ocf -DIRS-$(CONFIG_REDUCE) += compress +DIRS-$(CONFIG_VBDEV_COMPRESS) += compress DIRS-$(CONFIG_URING) += uring diff --git a/scripts/vagrant/autorun-spdk.conf b/scripts/vagrant/autorun-spdk.conf index 50bfe0a09..15b1507f7 100644 --- a/scripts/vagrant/autorun-spdk.conf +++ b/scripts/vagrant/autorun-spdk.conf @@ -25,7 +25,7 @@ SPDK_TEST_IOAT=0 SPDK_TEST_BLOBFS=0 SPDK_TEST_PMDK=0 SPDK_TEST_LVOL=0 -SPDK_TEST_REDUCE=0 +SPDK_TEST_VBDEV_COMPRESS=0 SPDK_RUN_ASAN=1 SPDK_RUN_UBSAN=1 # Reduce the size of the hugepages diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 07480a235..ad34d4117 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -130,8 +130,8 @@ export SPDK_TEST_VHOST_INIT export SPDK_TEST_PMDK : ${SPDK_TEST_LVOL=0} export SPDK_TEST_LVOL -: ${SPDK_TEST_REDUCE=0} -export SPDK_TEST_REDUCE +: ${SPDK_TEST_VBDEV_COMPRESS=0} +export SPDK_TEST_VBDEV_COMPRESS : ${SPDK_RUN_ASAN=0} export SPDK_RUN_ASAN : ${SPDK_RUN_UBSAN=0} @@ -259,7 +259,7 @@ fi if [ "$(uname -s)" = "Linux" ]; then HUGEMEM=${HUGEMEM:-4096} export CLEAR_HUGE=yes - if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then + if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_VBDEV_COMPRESS -eq 1 ]]; then # Make sure that memory is distributed across all NUMA nodes - by default, all goes to # node0, but if QAT devices are attached to a different node, all of their VFs will end # up under that node too and memory needs to be available there for the tests. @@ -445,9 +445,9 @@ function get_config_params() { config_params+=' --with-pmdk' fi - if [ -f /usr/include/libpmem.h ] && [ $SPDK_TEST_REDUCE -eq 1 ]; then + if [ -f /usr/include/libpmem.h ] && [ $SPDK_TEST_VBDEV_COMPRESS -eq 1 ]; then if ge "$(nasm --version | awk '{print $3}')" 2.14 && [[ $SPDK_TEST_ISAL -eq 1 ]]; then - config_params+=' --with-reduce' + config_params+=' --with-vbdev-compress' fi fi diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index c7c821788..c86d8c1af 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -106,7 +106,7 @@ function install_refspdk() { SPDK_TEST_BLOCKDEV=1 SPDK_TEST_PMDK=1 SPDK_TEST_ISAL=1 - SPDK_TEST_REDUCE=1 + SPDK_TEST_VBDEV_COMPRESS=1 SPDK_TEST_CRYPTO=1 SPDK_TEST_FTL=1 SPDK_TEST_OCF=1 diff --git a/test/unit/lib/Makefile b/test/unit/lib/Makefile index 553ac3a59..2082ee662 100644 --- a/test/unit/lib/Makefile +++ b/test/unit/lib/Makefile @@ -9,7 +9,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk DIRS-y = accel bdev blob blobfs dma event ioat iscsi json jsonrpc log lvol DIRS-y += notify nvme nvmf scsi sock thread util env_dpdk init rpc DIRS-$(CONFIG_IDXD) += idxd -DIRS-$(CONFIG_REDUCE) += reduce +DIRS-$(CONFIG_VBDEV_COMPRESS) += reduce ifeq ($(OS),Linux) DIRS-$(CONFIG_VHOST) += vhost DIRS-y += ftl diff --git a/test/unit/lib/bdev/Makefile b/test/unit/lib/bdev/Makefile index 6f13b3323..245e17f9a 100644 --- a/test/unit/lib/bdev/Makefile +++ b/test/unit/lib/bdev/Makefile @@ -11,7 +11,7 @@ DIRS-y = bdev.c part.c scsi_nvme.c gpt vbdev_lvol.c mt raid bdev_zone.c vbdev_zo DIRS-$(CONFIG_CRYPTO) += crypto.c # enable once new mocks are added for compressdev -DIRS-$(CONFIG_REDUCE) += compress.c +DIRS-$(CONFIG_VBDEV_COMPRESS) += compress.c DIRS-$(CONFIG_PMDK) += pmem diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index ed7609308..dcdbbaa2d 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -207,8 +207,8 @@ if grep -q '#define SPDK_CONFIG_CRYPTO 1' $rootdir/include/spdk/config.h; then run_test "unittest_bdev_crypto" $valgrind $testdir/lib/bdev/crypto.c/crypto_ut fi -if grep -q '#define SPDK_CONFIG_REDUCE 1' $rootdir/include/spdk/config.h; then - run_test "unittest_bdev_reduce" $valgrind $testdir/lib/bdev/compress.c/compress_ut +if grep -q '#define SPDK_CONFIG_VBDEV_COMPRESS 1' $rootdir/include/spdk/config.h; then + run_test "unittest_bdev_compress" $valgrind $testdir/lib/bdev/compress.c/compress_ut fi if grep -q '#define SPDK_CONFIG_PMDK 1' $rootdir/include/spdk/config.h; then