Skip to contentSkip to conversation

nvme-fabrics: Add target FC transport support

PATCH Superseded James Smart 2 participants 2 messages Oct 4, 2016

Subsystems (3)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

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

Add nvme-fabrics target FC transport support

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.

The changes made since the prior patch:
- Remove the todo's around dma_map_page(). No need to use dma_map_page()
- Fix nvme_fc_register_targetport() comments per review
- in LS handlers, standardized failure codes and meanings
- Print NVMET_NR_QUEUES when we dislike its value
- Fix return code handling in nvmet_fc_handle_ls_rqst() per review
- Reworked teardown paths with ref counting
- Teardown now invokes callbacks on completion of unregister functions
- Removal of fabric name for nport qualifier. Not necessary in T11

Signed-off-by James Smart <james.smart at broadcom.com>
---
 drivers/nvme/target/Kconfig  |   10 +
 drivers/nvme/target/Makefile |    2 +
 drivers/nvme/target/fc.c     | 1969 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1981 insertions(+)
 create mode 100644 drivers/nvme/target/fc.c
drivers/nvme/target/Kconfig +10 -0
index 3a5b9d0..158efb0 100644
@@ -34,3 +34,13 @@ config NVME_TARGET_RDMA
 	  devices over RDMA.
 
 	  If unsure, say N.
+
+config NVME_TARGET_FC
+	tristate "NVMe over Fabrics FC target driver"
+	select NVME_TARGET
+	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 +1969 -0

1,969 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw

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

Quoted 23 lines · James Smart

Add nvme-fabrics target FC transport support

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.

The changes made since the prior patch:
- Remove the todo's around dma_map_page(). No need to use dma_map_page()
- Fix nvme_fc_register_targetport() comments per review
- in LS handlers, standardized failure codes and meanings
- Print NVMET_NR_QUEUES when we dislike its value
- Fix return code handling in nvmet_fc_handle_ls_rqst() per review
- Reworked teardown paths with ref counting
- Teardown now invokes callbacks on completion of unregister functions
- Removal of fabric name for nport qualifier. Not necessary in T11

Quoted 8 lines
Signed-off-by James Smart <james.smart at broadcom.com>
---
 drivers/nvme/target/Kconfig  |   10 +
 drivers/nvme/target/Makefile |    2 +
 drivers/nvme/target/fc.c     | 1969 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1981 insertions(+)
 create mode 100644 drivers/nvme/target/fc.c
Reviewed-by Hannes Reinecke <hare at suse.com>

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
hare at suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: J. Hawn, J. Guild, F. Imend?rffer, HRB 16746 (AG N?rnberg)