Skip to contentSkip to conversation

nvme-fabrics: Add target support for FC transport

PATCH New James Smart 2 participants 2 messages Dec 2, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v6 6/7 nvme-fabrics: Add target support for FC transport

Add nvme-fabrics target support for FC transport

Implements the FC-NVME T11 definition of how nvme fabric capsules are performed on an FC fabric. Utilizes a lower-layer API to FC host adapters to send/receive FC-4 LS operations and perform the FCP transactions necessary to perform and FCP IO request for NVME.

The T11 definitions for FC-4 Link Services are implemented which create NVMeOF connections. Implements the hooks with nvmet layer to pass NVME commands to it for processing and posting of data/response base to the host via the different connections.

Signed-off-by James Smart <james.smart at broadcom.com>
Reviewed-by Jay Freyensee <james_p_freyensee at linux.intel.com>

---
v6 mods:
- corrected atomics for bools and locks. Fixed abort logic.
- fod's now managed on a per-q basis
- added dma wrappers to allow fcloop to pass in null dev ptr
- Remove RS handler, as well as rcv_abts() and rcv_rs_req() handlers
- Fix for io sizes > lld's sgl. Allow, but segment based on lld's sgl cnt
- add cmd spreading across cpus if requested by lld

 MAINTAINERS                  |    1 +
 drivers/nvme/target/Kconfig  |   11 +
 drivers/nvme/target/Makefile |    2 +
 drivers/nvme/target/fc.c     | 2286 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 2300 insertions(+)
 create mode 100644 drivers/nvme/target/fc.c
MAINTAINERS +1 -0
index f04d00a..319b9c00 100644
@@ -8685,6 +8685,7 @@ S:	Supported
 F:	include/linux/nvme-fc.h
 F:	include/linux/nvme-fc-driver.h
 F:	drivers/nvme/host/fc.c
+F:	drivers/nvme/target/fc.c
 
 NVMEM FRAMEWORK
 M:	Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
drivers/nvme/target/Kconfig +11 -0
index 3a5b9d0..746a63e 100644
@@ -34,3 +34,14 @@ config NVME_TARGET_RDMA
 	  devices over RDMA.
 
 	  If unsure, say N.
+
+config NVME_TARGET_FC
+	tristate "NVMe over Fabrics FC target driver"
+	depends on NVME_TARGET
+	depends on HAS_DMA
+	help
+	  This enables the NVMe FC target support, which allows exporting NVMe
+	  devices over FC.
+
+	  If unsure, say N.
+
drivers/nvme/target/Makefile +2 -0
index b7a0623..80b128b 100644
@@ -2,8 +2,10 @@
 obj-$(CONFIG_NVME_TARGET)		+= nvmet.o
 obj-$(CONFIG_NVME_TARGET_LOOP)		+= nvme-loop.o
 obj-$(CONFIG_NVME_TARGET_RDMA)		+= nvmet-rdma.o
+obj-$(CONFIG_NVME_TARGET_FC)		+= nvmet-fc.o
 
 nvmet-y		+= core.o configfs.o admin-cmd.o io-cmd.o fabrics-cmd.o \
 			discovery.o
 nvme-loop-y	+= loop.o
 nvmet-rdma-y	+= rdma.o
+nvmet-fc-y	+= fc.o
drivers/nvme/target/fc.c new file +2286 -0

2,286 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw

PATCH v6 6/7 nvme-fabrics: Add target support for FC transport

Quoted 8 lines · James Smart

Add nvme-fabrics target support for FC transport

Implements the FC-NVME T11 definition of how nvme fabric capsules are performed on an FC fabric. Utilizes a lower-layer API to FC host adapters to send/receive FC-4 LS operations and perform the FCP transactions necessary to perform and FCP IO request for NVME.

Quoted 7 lines

The T11 definitions for FC-4 Link Services are implemented which create NVMeOF connections. Implements the hooks with nvmet layer to pass NVME commands to it for processing and posting of data/response base to the host via the different connections.

Signed-off-by James Smart <james.smart at broadcom.com>
Reviewed-by Jay Freyensee <james_p_freyensee at linux.intel.com>

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850