Skip to contentSkip to conversation

nvme-fabrics: Add host support for FC transport

PATCH Superseded James Smart 2 participants 2 messages Nov 4, 2016 – Nov 5, 2016

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 5/7 nvme-fabrics: Add host support for FC transport

Add nvme-fabrics host 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 FCP operations that comprise NVME over FC operation.

The T11 definitions for FC-4 Link Services are implemented which create NVMeOF connections. Implements the hooks with blk-mq to then submit admin and io requests to the different connections.

Signed-off-by James Smart <james.smart at broadcom.com>

---
v4 mods:
- added HAS_DMA to Kconfig
- Changed to support Christophs nvme_request update
- addressed return code in __nvme_fc_abort_op()
- fixed possible op->rq NULL reference in nvme_fc_start_fcp_op()
- FC-NVME v1.11: process transferred length in ersp iu and rsp iu mandates
- Add comments on teardown flow
- fix bad cqe reference in fcpio_done

 MAINTAINERS                |    1 +
 drivers/nvme/host/Kconfig  |   17 +
 drivers/nvme/host/Makefile |    3 +
 drivers/nvme/host/fc.c     | 2441 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 2462 insertions(+)
 create mode 100644 drivers/nvme/host/fc.c
MAINTAINERS +1 -0
index 5d9188b..7ca8337 100644
@@ -8666,6 +8666,7 @@ L:	linux-nvme at lists.infradead.org
 S:	Supported
 F:	include/linux/nvme-fc.h
 F:	include/linux/nvme-fc-driver.h
+F:	drivers/nvme/host/fc.c
 
 NVMEM FRAMEWORK
 M:	Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
drivers/nvme/host/Kconfig +17 -0
index f7d37a6..90745a6 100644
@@ -43,3 +43,20 @@ config NVME_RDMA
 	  from https://github.com/linux-nvme/nvme-cli.
 
 	  If unsure, say N.
+
+config NVME_FC
+	tristate "NVM Express over Fabrics FC host driver"
+	depends on BLOCK
+	depends on HAS_DMA
+	select NVME_CORE
+	select NVME_FABRICS
+	select SG_POOL
+	help
+	  This provides support for the NVMe over Fabrics protocol using
+	  the FC transport.  This allows you to use remote block devices
+	  exported using the NVMe protocol set.
+
+	  To configure a NVMe over Fabrics controller use the nvme-cli tool
+	  from https://github.com/linux-nvme/nvme-cli.
+
+	  If unsure, say N.
drivers/nvme/host/Makefile +3 -0
index 47abcec..f1a7d94 100644
@@ -2,6 +2,7 @@ obj-$(CONFIG_NVME_CORE)			+= nvme-core.o
 obj-$(CONFIG_BLK_DEV_NVME)		+= nvme.o
 obj-$(CONFIG_NVME_FABRICS)		+= nvme-fabrics.o
 obj-$(CONFIG_NVME_RDMA)			+= nvme-rdma.o
+obj-$(CONFIG_NVME_FC)			+= nvme-fc.o
 
 nvme-core-y				:= core.o
 nvme-core-$(CONFIG_BLK_DEV_NVME_SCSI)	+= scsi.o
@@ -12,3 +13,5 @@ nvme-y					+= pci.o
 nvme-fabrics-y				+= fabrics.o
 
 nvme-rdma-y				+= rdma.o
+
+nvme-fc-y				+= fc.o
drivers/nvme/host/fc.c new file +2441 -0

2,441 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw

PATCH v4 5/7 nvme-fabrics: Add host support for FC transport

Quoted 17 lines · James Smart

Add nvme-fabrics host 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 FCP operations that comprise NVME
over FC operation.

The T11 definitions for FC-4 Link Services are implemented which create
NVMeOF connections.??Implements the hooks with blk-mq to then submit admin
and io requests to the different connections.

Signed-off-by James Smart <james.smart at broadcom.com>
Quoted 10 lines

---
v4 mods:
- added HAS_DMA to Kconfig
- Changed to support Christophs nvme_request update
- addressed return code in __nvme_fc_abort_op()
- fixed possible op->rq NULL reference in nvme_fc_start_fcp_op()
- FC-NVME v1.11: process transferred length in ersp iu and rsp iu mandates
- Add comments on teardown flow
- fix bad cqe reference in fcpio_done

Looks good, nice work James,

Reviewed-by Jay Freyensee <james_p_freyensee at linux.intel.com>