Skip to contentSkip to conversation

: Add generic ProtoID and TransportID fabric handlers for SAS, FC, and iSCSI

PATCH New Nicholas A. Bellinger 1 participant 1 message May 12, 2010

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

PATCH 4/5 : Add generic ProtoID and TransportID fabric handlers for SAS, FC, and iSCSI

From: Nicholas Bellinger <[email protected]>

This patch adds a set of generic SAS, FC and iSCSI handlers into target_core_fabric_lib.c that contain fabric dependent logic for ProtocolID (PIV) and TransportID processing releated to >= SPC-3 persistent reservation SCSI Initiator and Target Port WWNs. These generic handlers follow SPC-4 and are based on protocol dependent code in TCM_Loop, TCM_FC and LIO-Target modules.

This means that that CDB level fabric emulation for INQUIRY EVPD 0x83, multi-fabric >= SPC-3 persistent reservations and ALUA multipath can now be performed by fabric modules using these generic handlers with the following callers in include/target/target_core_fabric_ops.h:struct target_core_fabric_ops

	*) ->get_fabric_proto_ident()

	*) ->tpg_get_pr_transport_id()

	*) ->tpg_get_pr_transport_id_len()

	*) ->tpg_parse_pr_out_transport_id()

This a tch lso allows TCM fabric modules to optionally support more than a single SCSI protcol on a per fabric target endpoint (WWN+TPGT) context basis.

---
 drivers/target/Kbuild                   |    1 +
 drivers/target/target_core_fabric_lib.c |  456 +++++++++++++++++++++++++++++++
 include/target/target_core_fabric_lib.h |   28 ++
 3 files changed, 485 insertions(+), 0 deletions(-)
 create mode 100644 drivers/target/target_core_fabric_lib.c
 create mode 100644 include/target/target_core_fabric_lib.h
drivers/target/Kbuild +1 -0
index 78229f9..5298d6a 100644
@@ -3,6 +3,7 @@ EXTRA_CFLAGS += -I$(srctree)/drivers/target/ -I$(srctree)/drivers/scsi/
 target_core_mod-y		:= target_core_configfs.o \
 				   target_core_device.o \
 				   target_core_fabric_configfs.o \
+				   target_core_fabric_lib.o \
 				   target_core_hba.o \
 				   target_core_plugin.o \
 				   target_core_pr.o \
drivers/target/target_core_fabric_lib.c new file +456 -0

456 lines not on this page · raw message

include/target/target_core_fabric_lib.h new file +28 -0
new file mode 100644
index 0000000..53ffc9f
@@ -0,0 +1,28 @@
+#ifndef TARGET_CORE_FABRIC_LIB_H
+#define TARGET_CORE_FABRIC_LIB_H
+
+extern u8 sas_get_fabric_proto_ident(se_portal_group_t *);
+extern u32 sas_get_pr_transport_id(se_portal_group_t *, se_node_acl_t *,
+			t10_pr_registration_t *, int *, unsigned char *);
+extern u32 sas_get_pr_transport_id_len(se_portal_group_t *, se_node_acl_t *,
+			t10_pr_registration_t *, int *);
+extern char *sas_parse_pr_out_transport_id(se_portal_group_t *,
+			const char *, u32 *, char **);
+
+extern u8 fc_get_fabric_proto_ident(se_portal_group_t *);
+extern u32 fc_get_pr_transport_id(se_portal_group_t *, se_node_acl_t *,
+			t10_pr_registration_t *, int *, unsigned char *);
+extern u32 fc_get_pr_transport_id_len(se_portal_group_t *, se_node_acl_t *,
+			t10_pr_registration_t *, int *);
+extern char *fc_parse_pr_out_transport_id(se_portal_group_t *,
+			const char *, u32 *, char **);
+
+extern u8 iscsi_get_fabric_proto_ident(se_portal_group_t *);
+extern u32 iscsi_get_pr_transport_id(se_portal_group_t *, se_node_acl_t *,
+			t10_pr_registration_t *, int *, unsigned char *);
+extern u32 iscsi_get_pr_transport_id_len(se_portal_group_t *, se_node_acl_t *,
+			t10_pr_registration_t *, int *);
+extern char *iscsi_parse_pr_out_transport_id(se_portal_group_t *,
+			const char *, u32 *, char **);
+
+#endif /* TARGET_CORE_FABRIC_LIB_H */
Signature · 1 line
1.5.6.5