diff --git a/CONFIG b/CONFIG index 97a8244f4..6aa76e7e3 100644 --- a/CONFIG +++ b/CONFIG @@ -3,6 +3,7 @@ # # Copyright (c) Intel Corporation. # All rights reserved. +# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -141,6 +142,9 @@ CONFIG_PMDK_DIR= # Enable the dependencies for building the compress vbdev CONFIG_REDUCE=n +# Enable mlx5_pci dpdk compress PMD, enabled automatically if CONFIG_REDUCE=y and libmlx5 exists +CONFIG_REDUCE_MLX5=n + # Requires libiscsi development libraries. CONFIG_ISCSI_INITIATOR=n diff --git a/configure b/configure index e734e1326..def3e85ca 100755 --- a/configure +++ b/configure @@ -733,6 +733,15 @@ if [[ "${CONFIG[REDUCE]}" = "y" ]]; then echo "Please install then re-run this script." exit 1 fi + + if echo -e '#include \n' \ + '#include \n' \ + '#include \n' \ + 'int main(void) { return 0; }\n' \ + | "${BUILD_CMD[@]}" -lmlx5 -I${rootdir}/include -c - 2> /dev/null; then + CONFIG[REDUCE_MLX5]="y" + echo "mlx5 available so enabling DPDK mlx5_pci compress PMD" + fi fi if [[ "${CONFIG[NVME_CUSE]}" = "y" ]]; then diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index d4af3a0a4..5c6b4facf 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -3,6 +3,7 @@ # # Copyright (c) Intel Corporation. # All rights reserved. +# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -66,6 +67,9 @@ endif ifeq ($(CONFIG_REDUCE),y) DPDK_DRIVERS += compress compress/isal +ifeq ($(CONFIG_REDUCE_MLX5),y) +DPDK_DRIVERS += common/mlx5 compress/mlx5 +endif DPDK_CFLAGS += -I$(ISAL_DIR) DPDK_LDFLAGS += -L$(ISAL_DIR)/.libs -lisal endif diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index 7d256e06f..3ff5a7db6 100644 --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -3,6 +3,7 @@ # # Copyright (c) Intel Corporation. # All rights reserved. +# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -93,6 +94,9 @@ else # PMD name for DPDK 20.08 and earlier DPDK_LIB_LIST += rte_pmd_isal endif +ifeq ($(CONFIG_REDUCE_MLX5),y) +DPDK_LIB_LIST += rte_common_mlx5 rte_compress_mlx5 +endif endif ifeq ($(DPDK_FRAMEWORK),y) @@ -146,6 +150,9 @@ endif ifeq ($(CONFIG_REDUCE),y) DPDK_PRIVATE_LINKER_ARGS += -lisal -L$(ISAL_DIR)/.libs +ifeq ($(CONFIG_REDUCE_MLX5),y) +DPDK_PRIVATE_LINKER_ARGS += -lmlx5 +endif endif ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_config.h)) diff --git a/mk/spdk.modules.mk b/mk/spdk.modules.mk index 415a3b2d7..db177d81f 100644 --- a/mk/spdk.modules.mk +++ b/mk/spdk.modules.mk @@ -3,6 +3,7 @@ # # Copyright (c) Intel Corporation. # All rights reserved. +# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -57,6 +58,9 @@ endif ifeq ($(CONFIG_REDUCE),y) BLOCKDEV_MODULES_LIST += bdev_compress reduce BLOCKDEV_MODULES_PRIVATE_LIBS += -lpmem +ifeq ($(CONFIG_REDUCE_MLX5),y) +BLOCKDEV_MODULES_PRIVATE_LIBS += -lmlx5 +endif endif ifeq ($(CONFIG_RDMA),y)