Skip to content

Commit

Permalink
mk: Enable build of mlx5_pci compress PMD
Browse files Browse the repository at this point in the history
This PMD is availabe for BlueField2 DPU.
It requires libmlx5, so configure file is
updated to check if this library exists

Change-Id: Ic0cfbfdf24af393381667435009fb6afc49d9181
Signed-off-by: Alexey Marchuk <[email protected]>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8780
Community-CI: Broadcom CI <[email protected]>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Ben Walker <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
  • Loading branch information
AlekseyMarchuk authored and tomzawadzki committed Aug 16, 2021
1 parent 5263f0a commit e269bf4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CONFIG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,15 @@ if [[ "${CONFIG[REDUCE]}" = "y" ]]; then
echo "Please install then re-run this script."
exit 1
fi

if echo -e '#include <spdk/stdinc.h>\n' \
'#include <infiniband/mlx5dv.h>\n' \
'#include <infiniband/verbs.h>\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
Expand Down
4 changes: 4 additions & 0 deletions dpdkbuild/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions lib/env_dpdk/env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions mk/spdk.modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e269bf4

Please sign in to comment.