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 <paul.e.luse@intel.com>
Change-Id: If8ed3e48e1e3dabcaad1cd161289e78122cd9d58
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15179
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
paul luse 2022-10-28 16:07:51 -07:00 committed by Tomasz Zawadzki
parent 0b7138e97f
commit 19e2dc3853
15 changed files with 48 additions and 48 deletions

8
CONFIG
View File

@ -128,11 +128,11 @@ CONFIG_PMDK_DIR=
# Build with xNVMe # Build with xNVMe
CONFIG_XNVME=n CONFIG_XNVME=n
# Enable the dependencies for building the compress vbdev # Enable the dependencies for building the compress vbdev, includes the reduce library
CONFIG_REDUCE=n CONFIG_VBDEV_COMPRESS=n
# Enable mlx5_pci dpdk compress PMD, enabled automatically if CONFIG_REDUCE=y and libmlx5 exists # Enable mlx5_pci dpdk compress PMD, enabled automatically if CONFIG_VBDEV_COMPRESS=y and libmlx5 exists
CONFIG_REDUCE_MLX5=n CONFIG_VBDEV_COMPRESS_MLX5=n
# Enable mlx5_pci dpdk crypto PMD, enabled automatically if CONFIG_CRYPTO=y and libmlx5 exists # Enable mlx5_pci dpdk crypto PMD, enabled automatically if CONFIG_CRYPTO=y and libmlx5 exists
CONFIG_CRYPTO_MLX5=n CONFIG_CRYPTO_MLX5=n

View File

@ -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" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$external_dpdk_base_dir/intel-ipsec-mb/$intel_ipsec_lib"
fi fi
if [[ "$SPDK_TEST_REDUCE" -eq 1 ]]; then if [[ "$SPDK_TEST_VBDEV_COMPRESS" -eq 1 ]]; then
isal_dir="$external_dpdk_base_dir/isa-l" 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" git clone --branch v2.29.0 --depth 1 https://github.com/intel/isa-l.git "$isal_dir"

View File

@ -147,7 +147,7 @@ if [ $SPDK_TEST_UNITTEST -eq 1 ]; then
fi fi
if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then 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 if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then
./scripts/qat_setup.sh igb_uio ./scripts/qat_setup.sh igb_uio
else else
@ -324,7 +324,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
run_test "vmd" ./test/vmd/vmd.sh run_test "vmd" ./test/vmd/vmd.sh
fi 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_qat" ./test/compress/compress.sh "qat"
run_test "compress_isal" ./test/compress/compress.sh "isal" run_test "compress_isal" ./test/compress/compress.sh "isal"
fi fi

30
configure vendored
View File

@ -73,8 +73,8 @@ function usage() {
echo " --with-pmdk[=DIR] Build persistent memory bdev. echo " --with-pmdk[=DIR] Build persistent memory bdev.
example: /usr/share/pmdk" example: /usr/share/pmdk"
echo " --without-pmdk No path required." echo " --without-pmdk No path required."
echo " --with-reduce Build vbdev compression module." echo " --with-vbdev-compress Build vbdev compression module and dependencies."
echo " --without-reduce No path required." echo " --without-vbdev-compress No path required."
echo " --with-rbd Build Ceph RBD bdev module." echo " --with-rbd Build Ceph RBD bdev module."
echo " --without-rbd No path required." echo " --without-rbd No path required."
echo " --with-rdma[=DIR] Build RDMA transport for NVMf target and initiator." echo " --with-rdma[=DIR] Build RDMA transport for NVMf target and initiator."
@ -531,11 +531,11 @@ for i in "$@"; do
--without-pmdk) --without-pmdk)
CONFIG[PMDK]=n CONFIG[PMDK]=n
;; ;;
--with-reduce) --with-vbdev-compress)
CONFIG[REDUCE]=y CONFIG[VBDEV_COMPRESS]=y
;; ;;
--without-reduce) --without-vbdev-compress)
CONFIG[REDUCE]=n CONFIG[VBDEV_COMPRESS]=n
;; ;;
--with-xnvme) --with-xnvme)
CONFIG[XNVME]=y CONFIG[XNVME]=y
@ -899,41 +899,41 @@ function mlx5_build() {
return 0 return 0
} }
if [[ "${CONFIG[REDUCE]}" = "y" ]]; then if [[ "${CONFIG[VBDEV_COMPRESS]}" = "y" ]]; then
if ! echo -e '#include <libpmem.h>\nint main(void) { return 0; }\n' \ if ! echo -e '#include <libpmem.h>\nint main(void) { return 0; }\n' \
| "${BUILD_CMD[@]}" -lpmem - 2> /dev/null; then | "${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." echo "Please install then re-run this script."
exit 1 exit 1
fi fi
# Try to enable mlx5 compress # Try to enable mlx5 compress
CONFIG[REDUCE_MLX5]="y" CONFIG[VBDEV_COMPRESS_MLX5]="y"
# Check if libmlx5 exists to enable mlx5_pci compress PMD # Check if libmlx5 exists to enable mlx5_pci compress PMD
if ! mlx5_build; then if ! mlx5_build; then
echo "libmlx5 is not found, so disabling DPDK mlx5_pci compress PMD" echo "libmlx5 is not found, so disabling DPDK mlx5_pci compress PMD"
CONFIG[REDUCE_MLX5]="n" CONFIG[VBDEV_COMPRESS_MLX5]="n"
else else
if [[ "${CONFIG[DPDK_PKG_CONFIG]}" = "y" ]]; then if [[ "${CONFIG[DPDK_PKG_CONFIG]}" = "y" ]]; then
# Check if librte_compress_mlx5 exists in DPDK package # Check if librte_compress_mlx5 exists in DPDK package
if [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_compress_mlx5.so ]; then 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" 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
else else
# Check DPDK version to determine if mlx5_pci driver is supported # Check DPDK version to determine if mlx5_pci driver is supported
dpdk_ver=$(dpdk_version) dpdk_ver=$(dpdk_version)
if [[ $dpdk_ver = "none" ]]; then if [[ $dpdk_ver = "none" ]]; then
echo "Cannot get DPDK version, so disabling DPDK mlx5_pci compress PMD" 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 elif [[ -n $dpdk_ver ]] && lt "$dpdk_ver" 21.02.0; then
# mlx5_pci for compress is supported by DPDK >- 21.02.0 # mlx5_pci for compress is supported by DPDK >- 21.02.0
echo "DPDK version ${dpdk_ver} doesn't support mlx5_pci compress PMD" 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 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 # 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" 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 fi
fi fi
@ -1161,7 +1161,7 @@ else
echo "Without ISA-L, there is no software support for crypto or compression," echo "Without ISA-L, there is no software support for crypto or compression,"
echo "so these features will be disabled." echo "so these features will be disabled."
CONFIG[CRYPTO]=n CONFIG[CRYPTO]=n
CONFIG[REDUCE]=n CONFIG[VBDEV_COMPRESS]=n
fi fi
if [[ "${CONFIG[SMA]}" = "y" ]]; then if [[ "${CONFIG[SMA]}" = "y" ]]; then

View File

@ -39,13 +39,13 @@ DPDK_LIBS += kvargs telemetry
# Governor required libs # Governor required libs
DPDK_LIBS += power timer ethdev net DPDK_LIBS += power timer ethdev net
# common crypto/reduce drivers # common crypto/compress drivers
ifeq ($(findstring y,$(CONFIG_CRYPTO)$(CONFIG_REDUCE)),y) ifeq ($(findstring y,$(CONFIG_CRYPTO)$(CONFIG_VBDEV_COMPRESS)),y)
DPDK_DRIVERS += crypto/qat compress/qat common/qat DPDK_DRIVERS += crypto/qat compress/qat common/qat
endif endif
# common mlx5 libs # 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 DPDK_DRIVERS += common/mlx5 bus/auxiliary
endif endif
@ -63,9 +63,9 @@ DPDK_LDFLAGS += -L$(IPSEC_MB_DIR)
endif endif
endif endif
ifeq ($(CONFIG_REDUCE),y) ifeq ($(CONFIG_VBDEV_COMPRESS),y)
DPDK_DRIVERS += compress compress/isal DPDK_DRIVERS += compress compress/isal
ifeq ($(CONFIG_REDUCE_MLX5),y) ifeq ($(CONFIG_VBDEV_COMPRESS_MLX5),y)
DPDK_DRIVERS += compress/mlx5 DPDK_DRIVERS += compress/mlx5
endif endif
DPDK_CFLAGS += -I$(ISAL_DIR) DPDK_CFLAGS += -I$(ISAL_DIR)

View File

@ -18,7 +18,7 @@ DIRS-$(CONFIG_OCF) += env_ocf
DIRS-$(CONFIG_IDXD) += idxd DIRS-$(CONFIG_IDXD) += idxd
DIRS-$(CONFIG_VHOST) += vhost DIRS-$(CONFIG_VHOST) += vhost
DIRS-$(CONFIG_VIRTIO) += virtio DIRS-$(CONFIG_VIRTIO) += virtio
DIRS-$(CONFIG_REDUCE) += reduce DIRS-$(CONFIG_VBDEV_COMPRESS) += reduce
DIRS-$(CONFIG_RDMA) += rdma DIRS-$(CONFIG_RDMA) += rdma
DIRS-$(CONFIG_VFIO_USER) += vfu_tgt DIRS-$(CONFIG_VFIO_USER) += vfu_tgt

View File

@ -48,12 +48,12 @@ DPDK_LIB_LIST += rte_power rte_ethdev rte_net
endif endif
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 # here we add the feature specific ones and set a flag to add the common
# ones after that. # ones after that.
DPDK_FRAMEWORK=n 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 DPDK_LIB_LIST += rte_common_mlx5
# Introduced in DPDK 21.08 # Introduced in DPDK 21.08
ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_bus_auxiliary.*)) ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_bus_auxiliary.*))
@ -80,12 +80,12 @@ endif
endif endif
endif endif
ifeq ($(CONFIG_REDUCE),y) ifeq ($(CONFIG_VBDEV_COMPRESS),y)
DPDK_FRAMEWORK=y DPDK_FRAMEWORK=y
ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_compress_isal.*)) ifneq (, $(wildcard $(DPDK_LIB_DIR)/librte_compress_isal.*))
DPDK_LIB_LIST += rte_compress_isal DPDK_LIB_LIST += rte_compress_isal
endif endif
ifeq ($(CONFIG_REDUCE_MLX5),y) ifeq ($(CONFIG_VBDEV_COMPRESS_MLX5),y)
DPDK_LIB_LIST += rte_compress_mlx5 DPDK_LIB_LIST += rte_compress_mlx5
endif endif
endif endif
@ -151,9 +151,9 @@ DPDK_PRIVATE_LINKER_ARGS += -lmlx5 -libverbs
endif endif
endif endif
ifeq ($(CONFIG_REDUCE),y) ifeq ($(CONFIG_VBDEV_COMPRESS),y)
DPDK_PRIVATE_LINKER_ARGS += -lisal -L$(ISAL_DIR)/.libs 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 DPDK_PRIVATE_LINKER_ARGS += -lmlx5 -libverbs
endif endif
endif endif

View File

@ -34,10 +34,10 @@ BLOCKDEV_MODULES_LIST += bdev_ocf
BLOCKDEV_MODULES_LIST += ocfenv BLOCKDEV_MODULES_LIST += ocfenv
endif endif
ifeq ($(CONFIG_REDUCE),y) ifeq ($(CONFIG_VBDEV_COMPRESS),y)
BLOCKDEV_MODULES_LIST += bdev_compress reduce BLOCKDEV_MODULES_LIST += bdev_compress reduce
BLOCKDEV_MODULES_PRIVATE_LIBS += -lpmem BLOCKDEV_MODULES_PRIVATE_LIBS += -lpmem
ifeq ($(CONFIG_REDUCE_MLX5),y) ifeq ($(CONFIG_VBDEV_COMPRESS_MLX5),y)
BLOCKDEV_MODULES_PRIVATE_LIBS += -lmlx5 -libverbs BLOCKDEV_MODULES_PRIVATE_LIBS += -lmlx5 -libverbs
endif endif
endif endif

View File

@ -14,7 +14,7 @@ DIRS-$(CONFIG_CRYPTO) += crypto
DIRS-$(CONFIG_OCF) += ocf DIRS-$(CONFIG_OCF) += ocf
DIRS-$(CONFIG_REDUCE) += compress DIRS-$(CONFIG_VBDEV_COMPRESS) += compress
DIRS-$(CONFIG_URING) += uring DIRS-$(CONFIG_URING) += uring

View File

@ -25,7 +25,7 @@ SPDK_TEST_IOAT=0
SPDK_TEST_BLOBFS=0 SPDK_TEST_BLOBFS=0
SPDK_TEST_PMDK=0 SPDK_TEST_PMDK=0
SPDK_TEST_LVOL=0 SPDK_TEST_LVOL=0
SPDK_TEST_REDUCE=0 SPDK_TEST_VBDEV_COMPRESS=0
SPDK_RUN_ASAN=1 SPDK_RUN_ASAN=1
SPDK_RUN_UBSAN=1 SPDK_RUN_UBSAN=1
# Reduce the size of the hugepages # Reduce the size of the hugepages

View File

@ -130,8 +130,8 @@ export SPDK_TEST_VHOST_INIT
export SPDK_TEST_PMDK export SPDK_TEST_PMDK
: ${SPDK_TEST_LVOL=0} : ${SPDK_TEST_LVOL=0}
export SPDK_TEST_LVOL export SPDK_TEST_LVOL
: ${SPDK_TEST_REDUCE=0} : ${SPDK_TEST_VBDEV_COMPRESS=0}
export SPDK_TEST_REDUCE export SPDK_TEST_VBDEV_COMPRESS
: ${SPDK_RUN_ASAN=0} : ${SPDK_RUN_ASAN=0}
export SPDK_RUN_ASAN export SPDK_RUN_ASAN
: ${SPDK_RUN_UBSAN=0} : ${SPDK_RUN_UBSAN=0}
@ -259,7 +259,7 @@ fi
if [ "$(uname -s)" = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
HUGEMEM=${HUGEMEM:-4096} HUGEMEM=${HUGEMEM:-4096}
export CLEAR_HUGE=yes 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 # 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 # 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. # 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' config_params+=' --with-pmdk'
fi 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 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
fi fi

View File

@ -106,7 +106,7 @@ function install_refspdk() {
SPDK_TEST_BLOCKDEV=1 SPDK_TEST_BLOCKDEV=1
SPDK_TEST_PMDK=1 SPDK_TEST_PMDK=1
SPDK_TEST_ISAL=1 SPDK_TEST_ISAL=1
SPDK_TEST_REDUCE=1 SPDK_TEST_VBDEV_COMPRESS=1
SPDK_TEST_CRYPTO=1 SPDK_TEST_CRYPTO=1
SPDK_TEST_FTL=1 SPDK_TEST_FTL=1
SPDK_TEST_OCF=1 SPDK_TEST_OCF=1

View File

@ -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 = 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-y += notify nvme nvmf scsi sock thread util env_dpdk init rpc
DIRS-$(CONFIG_IDXD) += idxd DIRS-$(CONFIG_IDXD) += idxd
DIRS-$(CONFIG_REDUCE) += reduce DIRS-$(CONFIG_VBDEV_COMPRESS) += reduce
ifeq ($(OS),Linux) ifeq ($(OS),Linux)
DIRS-$(CONFIG_VHOST) += vhost DIRS-$(CONFIG_VHOST) += vhost
DIRS-y += ftl DIRS-y += ftl

View File

@ -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 DIRS-$(CONFIG_CRYPTO) += crypto.c
# enable once new mocks are added for compressdev # enable once new mocks are added for compressdev
DIRS-$(CONFIG_REDUCE) += compress.c DIRS-$(CONFIG_VBDEV_COMPRESS) += compress.c
DIRS-$(CONFIG_PMDK) += pmem DIRS-$(CONFIG_PMDK) += pmem

View File

@ -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 run_test "unittest_bdev_crypto" $valgrind $testdir/lib/bdev/crypto.c/crypto_ut
fi fi
if grep -q '#define SPDK_CONFIG_REDUCE 1' $rootdir/include/spdk/config.h; then if grep -q '#define SPDK_CONFIG_VBDEV_COMPRESS 1' $rootdir/include/spdk/config.h; then
run_test "unittest_bdev_reduce" $valgrind $testdir/lib/bdev/compress.c/compress_ut run_test "unittest_bdev_compress" $valgrind $testdir/lib/bdev/compress.c/compress_ut
fi fi
if grep -q '#define SPDK_CONFIG_PMDK 1' $rootdir/include/spdk/config.h; then if grep -q '#define SPDK_CONFIG_PMDK 1' $rootdir/include/spdk/config.h; then