Commit ed56a3d4 authored by Anil Veerabhadrappa's avatar Anil Veerabhadrappa Committed by Ben Walker
Browse files

NVMe-oF Target: Add FC transport.



  - New files and updates to existing SPDK files to add the NVMf-FC transport.
  - Depends on an existing low level driver library. This driver is not part of SPDK repository.
  - Makefile updates to build FC transport (using CONFIG_FC)
  - Update configure script for FC build.
  - New FC unit test for FC-LS commands.
  - Update unittest.sh to run FC unit test (when built).

Signed-off-by: default avatarJohn Barnard <john.barnard@broadcom.com>
Signed-off-by: default avatarAnil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Change-Id: If31d4d25feab76c2dbe90a7faf71d465c2c3a354
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450077


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent e10fc6ea
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -22,6 +22,12 @@ and `spdk_dix_remap_ref_tag` have been added to remap DIF reference tag.
New APIs `spdk_dif_update_crc32c` and `spdk_dif_update_crc32c_stream` have been
added to compute CRC-32C checksum for extended LBA payload.

### NVME-oF Target (FC)

New Fibre Channel transport for NVMe over Fabrics target. Requires an FC HBA to use.
Also, requires a Fibre Channel HBA low level driver (lld) library. The driver library
and API header file path can be provided as an argument to "--with-fc".

### NVMe-oF Target

Persistent reservation emulation has been added to the NVMe-oF target. Persistent reservation
+5 −0
Original line number Diff line number Diff line
@@ -94,6 +94,11 @@ CONFIG_FIO_SOURCE_DIR=/usr/src/fio
CONFIG_RDMA=n
CONFIG_RDMA_SEND_WITH_INVAL=n

# Enable FC support for the NVMf target.
# Requires FC low level driver (from FC vendor)
CONFIG_FC=n
CONFIG_FC_PATH=

# Build Ceph RBD support in bdev modules
# Requires librbd development libraries
CONFIG_RBD=n
+7 −0
Original line number Diff line number Diff line
@@ -48,4 +48,11 @@ ifeq ($(OS),Linux)
SPDK_LIB_LIST += event_nbd nbd
endif

ifeq ($(CONFIG_FC),y)
ifneq ($(strip $(CONFIG_FC_PATH)),)
SYS_LIBS += -L$(CONFIG_FC_PATH)
endif
SYS_LIBS += -lufc
endif

include $(SPDK_ROOT_DIR)/mk/spdk.app.mk
+7 −0
Original line number Diff line number Diff line
@@ -58,6 +58,13 @@ ifeq ($(OS),Linux)
SPDK_LIB_LIST += event_nbd nbd
endif

ifeq ($(CONFIG_FC),y)
ifneq ($(strip $(CONFIG_FC_PATH)),)
SYS_LIBS += -L$(CONFIG_FC_PATH)
endif
SYS_LIBS += -lufc
endif

include $(SPDK_ROOT_DIR)/mk/spdk.app.mk

install: $(APP)
+25 −0
Original line number Diff line number Diff line
@@ -69,6 +69,10 @@ function usage()
	echo "                           No path required."
	echo " rdma                      Build RDMA transport for NVMf target and initiator."
	echo "                           No path required."
	echo " fc                        Build FC transport for NVMf target."
	echo "                           If an argument is provided, it is considered a directory containing"
	echo "                           libufc.a and fc_lld.h. Otherwise the regular system paths will"
	echo "                           be searched."
	echo " shared                    Build spdk shared libraries."
	echo "                           No path required."
	echo " iscsi-initiator           Build with iscsi bdev module."
@@ -218,6 +222,18 @@ for i in "$@"; do
		--without-rdma)
			CONFIG[RDMA]=n
			;;
		--with-fc=*)
			CONFIG[FC]=y
			CONFIG[FC_PATH]=$(readlink -f ${i#*=})
			;;
		--with-fc)
			CONFIG[FC]=y
			CONFIG[FC_PATH]=
			;;
		--without-fc)
			CONFIG[FC]=n
			CONFIG[FC_PATH]=
			;;
		--with-shared)
			CONFIG[SHARED]=y
			;;
@@ -499,6 +515,15 @@ than or equal to 4.14 will see significantly reduced performance.
	fi
fi

if [[ "${CONFIG[FC]}" = "y" ]]; then
	if [[ -n "${CONFIG[FC_PATH]}" ]]; then
		if [ ! -d "${CONFIG[FC_PATH]}" ]; then
			echo "${CONFIG[FC_PATH]}: directory not found"
			exit 1
		fi
	fi
fi

if [[ "${CONFIG[ISAL]}" = "y" ]] || [[ "${CONFIG[CRYPTO]}" = "y" ]]; then
	ver=$(nasm -v | awk '{print $3}' | sed 's/[^0-9]*//g')
	if [[ "${ver:0:1}" -le "2" ]] && [[ "${ver:0:3}" -le "213" ]] && [[ "${ver:0:5}" -lt "21303" ]]; then
Loading