Skip to contentSkip to conversation

tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module

PATCH In review Nicholas A. Bellinger 3 participants 7 messages Mar 18, 2011 – Mar 23, 2011

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

PATCH v2 1/1 tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module

From: Nicholas Bellinger <[email protected]>

This patch adds the TCM_Loop Linux/SCSI LLD fabric module for accessing TCM device backstores as locally accessable SCSI LUNs in virtual SAS, FC, and iSCSI Target ports using the generic fabric TransportID and Target Port WWN naming handlers from TCM's target_core_fabric_lib.c The TCM_Loop module uses the generic fabric configfs infratructure provided by target_core_fabric_configfs.c and adds a module dependent attribute for the creation/release of the virtual I_T Nexus connected the TCM_Loop Target and Initiator Ports.

TCM_Loop can also be used with scsi-generic and BSG drivers so that STGT userspace fabric modules, QEMU-KVM and other hypervisor SCSI passthrough support can access TCM device backstore and control CDB emulation.

For more information please see:

http://linux-iscsi.org/wiki/Tcm_loop

This patch has been updated with changes from Christoph's feedback.

Changed from v1 -> v2:

Remove dead extern prototypes and make all functions statically defined.

---
 drivers/target/Kconfig             |    2 +
 drivers/target/Makefile            |    3 +
 drivers/target/loopback/Kconfig    |   11 +
 drivers/target/loopback/Makefile   |    1 +
 drivers/target/loopback/tcm_loop.c | 1580 ++++++++++++++++++++++++++++++++++++
 drivers/target/loopback/tcm_loop.h |   77 ++
 6 files changed, 1674 insertions(+), 0 deletions(-)
 create mode 100644 drivers/target/loopback/Kconfig
 create mode 100644 drivers/target/loopback/Makefile
 create mode 100644 drivers/target/loopback/tcm_loop.c
 create mode 100644 drivers/target/loopback/tcm_loop.h
drivers/target/Kconfig +2 -0
index 2fac3be..9ef2dbb 100644
@@ -29,4 +29,6 @@ config TCM_PSCSI
 	Say Y here to enable the TCM/pSCSI subsystem plugin for non-buffered
 	passthrough access to Linux/SCSI device
 
+source "drivers/target/loopback/Kconfig"
+
 endif
drivers/target/Makefile +3 -0
index 4f3cb78..1178bbf 100644
@@ -21,3 +21,6 @@ obj-$(CONFIG_TARGET_CORE)	+= target_core_mod.o
 obj-$(CONFIG_TCM_IBLOCK)	+= target_core_iblock.o
 obj-$(CONFIG_TCM_FILEIO)	+= target_core_file.o
 obj-$(CONFIG_TCM_PSCSI)		+= target_core_pscsi.o
+
+# Fabric modules
+obj-$(CONFIG_LOOPBACK_TARGET)	+= loopback/
drivers/target/loopback/Kconfig new file +11 -0
new file mode 100644
index 0000000..b31ea2f
@@ -0,0 +1,11 @@
+config LOOPBACK_TARGET
+	tristate "TCM Virtual SAS target and Linux/SCSI LDD fabric loopback module"
+	help
+	Say Y here to enable the TCM Virtual SAS target and Linux/SCSI LLD
+	fabric loopback module.
+
+config LOOPBACK_TARGET_CDB_DEBUG
+	bool "TCM loopback fabric module CDB debug code"
+	depends on LOOPBACK_TARGET
+	help
+	Say Y here to enable the TCM loopback fabric module CDB debug code
drivers/target/loopback/Makefile new file +1 -0
new file mode 100644
index 0000000..6abebdf
@@ -0,0 +1 @@
+obj-$(CONFIG_LOOPBACK_TARGET)	+= tcm_loop.o
drivers/target/loopback/tcm_loop.c new file +1580 -0

1,580 lines not on this page · raw message

drivers/target/loopback/tcm_loop.h new file +77 -0

77 lines not on this page · raw message

Signature · 6 lines
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 17 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch adds the TCM_Loop Linux/SCSI LLD fabric module for accessing TCM device backstores as locally accessable SCSI LUNs in virtual SAS, FC, and iSCSI Target ports using the generic fabric TransportID and Target Port WWN naming handlers from TCM's target_core_fabric_lib.c The TCM_Loop module uses the generic fabric configfs infratructure provided by target_core_fabric_configfs.c and adds a module dependent attribute for the creation/release of the virtual I_T Nexus connected the TCM_Loop Target and Initiator Ports.

TCM_Loop can also be used with scsi-generic and BSG drivers so that STGT userspace fabric modules, QEMU-KVM and other hypervisor SCSI passthrough support can access TCM device backstore and control CDB emulation.

For more information please see:

http://linux-iscsi.org/wiki/Tcm_loop

Quoted 8 lines

This patch has been updated with changes from Christoph's feedback.

Changed from v1 -> v2:

Remove dead extern prototypes and make all functions statically defined.

Hi James,

Thanks for merging the for-39 target core fixes. At this point the TCM_Loop PATCH-v2 is ready to be merged into scsi-misc as well. Please review and let me know if you have any questions or comments.

Thank you,

--nab

maintainer
#2 lore raw
In reply to Nicholas A. Bellinger
Quoted 17 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch adds the TCM_Loop Linux/SCSI LLD fabric module for accessing TCM device backstores as locally accessable SCSI LUNs in virtual SAS, FC, and iSCSI Target ports using the generic fabric TransportID and Target Port WWN naming handlers from TCM's target_core_fabric_lib.c The TCM_Loop module uses the generic fabric configfs infratructure provided by target_core_fabric_configfs.c and adds a module dependent attribute for the creation/release of the virtual I_T Nexus connected the TCM_Loop Target and Initiator Ports.

TCM_Loop can also be used with scsi-generic and BSG drivers so that STGT userspace fabric modules, QEMU-KVM and other hypervisor SCSI passthrough support can access TCM device backstore and control CDB emulation.

For more information please see:

http://linux-iscsi.org/wiki/Tcm_loop

Quoted 8 lines

This patch has been updated with changes from Christoph's feedback.

Changed from v1 -> v2:

Remove dead extern prototypes and make all functions statically defined.

This is a major No-no: you can't actually add a reviewed by tag until the actual reviewer says so (and Christoph hasn't said so anywhere). Even if he had, and you think you've responded to all Christophs concerns, you still need to wait for him to look at the file and agree.

James

#3 lore raw
Quoted 24 lines · James Bottomley
Quoted 23 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch adds the TCM_Loop Linux/SCSI LLD fabric module for accessing TCM device backstores as locally accessable SCSI LUNs in virtual SAS, FC, and iSCSI Target ports using the generic fabric TransportID and Target Port WWN naming handlers from TCM's target_core_fabric_lib.c The TCM_Loop module uses the generic fabric configfs infratructure provided by target_core_fabric_configfs.c and adds a module dependent attribute for the creation/release of the virtual I_T Nexus connected the TCM_Loop Target and Initiator Ports.

TCM_Loop can also be used with scsi-generic and BSG drivers so that STGT userspace fabric modules, QEMU-KVM and other hypervisor SCSI passthrough support can access TCM device backstore and control CDB emulation.

For more information please see:

http://linux-iscsi.org/wiki/Tcm_loop

This patch has been updated with changes from Christoph's feedback.

Changed from v1 -> v2:

Remove dead extern prototypes and make all functions statically defined.

Quoted 8 lines
Quoted 2 lines

This is a major No-no: you can't actually add a reviewed by tag until the actual reviewer says so (and Christoph hasn't said so anywhere). Even if he had, and you think you've responded to all Christophs concerns, you still need to wait for him to look at the file and agree.

Fair enough. Chrisopth, are you happy with the code at this point..?

Thanks,

--nab

maintainer
#5 lore raw
In reply to Nicholas A. Bellinger
Quoted 21 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch adds the TCM_Loop Linux/SCSI LLD fabric module for accessing TCM device
backstores as locally accessable SCSI LUNs in virtual SAS, FC, and iSCSI Target ports
using the generic fabric TransportID and Target Port WWN naming handlers from TCM's
target_core_fabric_lib.c The TCM_Loop module uses the generic fabric configfs infratructure
provided by target_core_fabric_configfs.c and adds a module dependent attribute for the
creation/release of the virtual I_T Nexus connected the TCM_Loop Target and Initiator Ports.

TCM_Loop can also be used with scsi-generic and BSG drivers so that STGT userspace
fabric modules, QEMU-KVM and other hypervisor SCSI passthrough support can
access TCM device backstore and control CDB emulation.

Quoted 5 lines

For more information please see:

http://linux-iscsi.org/wiki/Tcm_loop

This patch has been updated with changes from Christoph's feedback.

And checkpatch next time, too please:

total: 25 errors, 25 warnings, 1681 lines checked

James

#6 lore raw
Quoted 24 lines · James Bottomley
Quoted 23 lines · Nicholas A. Bellinger

From: Nicholas Bellinger <[email protected]>

This patch adds the TCM_Loop Linux/SCSI LLD fabric module for accessing TCM device
backstores as locally accessable SCSI LUNs in virtual SAS, FC, and iSCSI Target ports
using the generic fabric TransportID and Target Port WWN naming handlers from TCM's
target_core_fabric_lib.c The TCM_Loop module uses the generic fabric configfs infratructure
provided by target_core_fabric_configfs.c and adds a module dependent attribute for the
creation/release of the virtual I_T Nexus connected the TCM_Loop Target and Initiator Ports.

TCM_Loop can also be used with scsi-generic and BSG drivers so that STGT userspace
fabric modules, QEMU-KVM and other hypervisor SCSI passthrough support can
access TCM device backstore and control CDB emulation.

For more information please see:

Quoted 8 lines
Quoted 3 lines

http://linux-iscsi.org/wiki/Tcm_loop

This patch has been updated with changes from Christoph's feedback.

And checkpatch next time, too please:

total: 25 errors, 25 warnings, 1681 lines checked

Thanks for fixing this up James. I will get your checkpatch cleanups merged from scsi-misc-2.6.git -> lio-core-2.6.git shortly.

--nab