From 5f6ef934dfb61e87bc7d7d2961ab400cb87de9e4 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Mon, 15 Jun 2020 18:48:10 +0300 Subject: [PATCH] mk/nvme/nvmf: Add deps for RDMA libs These dependencies were removed in patches that added RDMA provider. It was incorrect change since it causes SEGFAULT when SPDK is built with shared libraries Change-Id: I15f4ff86a75b3d080e1c7c89d75af4959c4ed989 Signed-off-by: Alexey Marchuk Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2900 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Seth Howell Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki --- lib/nvme/Makefile | 18 ++++++++++++++++++ lib/nvmf/Makefile | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/lib/nvme/Makefile b/lib/nvme/Makefile index 3db1df3ca..1c02965f5 100644 --- a/lib/nvme/Makefile +++ b/lib/nvme/Makefile @@ -44,6 +44,24 @@ C_SRCS-$(CONFIG_NVME_CUSE) += nvme_cuse.c LIBNAME = nvme LOCAL_SYS_LIBS = -luuid +ifeq ($(CONFIG_RDMA),y) +LOCAL_SYS_LIBS += -libverbs -lrdmacm +#Attach only if FreeBSD and RDMA is specified with configure +ifeq ($(OS),FreeBSD) +# Mellanox - MLX4 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx4.*)","") +LOCAL_SYS_LIBS += -lmlx4 +endif +# Mellanox - MLX5 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx5.*)","") +LOCAL_SYS_LIBS += -lmlx5 +endif +# Chelsio HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libcxgb4.*)","") +LOCAL_SYS_LIBS += -lcxgb4 +endif +endif +endif ifeq ($(CONFIG_NVME_CUSE),y) # fuse requires to set _FILE_OFFSET_BITS to 64 bits even for 64 bit machines diff --git a/lib/nvmf/Makefile b/lib/nvmf/Makefile index e23c403d8..b4556564a 100644 --- a/lib/nvmf/Makefile +++ b/lib/nvmf/Makefile @@ -43,6 +43,24 @@ C_SRCS = ctrlr.c ctrlr_discovery.c ctrlr_bdev.c \ C_SRCS-$(CONFIG_RDMA) += rdma.c LIBNAME = nvmf LOCAL_SYS_LIBS = -luuid +ifeq ($(CONFIG_RDMA),y) +LOCAL_SYS_LIBS += -libverbs -lrdmacm +#Attach only if FreeBSD and RDMA is specified with configure +ifeq ($(OS),FreeBSD) +# Mellanox - MLX4 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx4.*)","") +LOCAL_SYS_LIBS += -lmlx4 +endif +# Mellanox - MLX5 HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libmlx5.*)","") +LOCAL_SYS_LIBS += -lmlx5 +endif +# Chelsio HBA Userspace Library +ifneq ("$(wildcard /usr/lib/libcxgb4.*)","") +LOCAL_SYS_LIBS += -lcxgb4 +endif +endif +endif ifeq ($(CONFIG_FC),y) C_SRCS += fc.c fc_ls.c