Skip to contentSkip to conversation

: Initial code for tcm_qla2xxx module using v4 configfs fabric infrastructure

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

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

PATCH 1/1 : Initial code for tcm_qla2xxx module using v4 configfs fabric infrastructure

From: Nicholas Bellinger <[email protected]>

Greetings all,

This commit adds initial support for a tcm_qla2xx fabric module using the new
TCM v4 generic configfs fabric infrastructure and high level fabric ops. This includes the main struct target_core_fabric_ops API callers mapped to the following tcm_qla2xxx_configfs.c code and structures:

        .fabric_make_wwn -> tcm_qla2xxx_make_lport() with struct tcm_qla2xxx_lport
        .fabric_drop_wwn -> tcm_qla2xxx_drop_lport() with struct tcm_qla2xxx_lport
        .fabric_make_tpg -> tcm_qla2xxx_make_tpg() with struct tcm_qla2xxx_tpg
        .fabric_drop_tpg -> tcm_qla2xxx_drop_tpg() with struct tcm_qla2xxx_tpg
        .fabric_make_nodeacl -> tcm_qla2xxx_make_nodeacl() with struct tcm_qla2xxx_nacl
        .fabric_drop_nodeacl -> tcm_qla2xxx_drop_nodeacl() with struct tcm_qla2xxx_nacl

All of the generic configfs fabric intrastructure is up and running.

Note that the I_T Nexus and I/O related fabric API functions have been added as NOPs for the moment, and this code is intended to be a starting point for the bringup of QLA2xxx series HBAs with TCM v4. Eventually the patch for enabling this upstream drivers/scsi/qla2xxx/ will be added into lio-core-2.6.git/tcm_qla2xxx as community interest dictates.

Also note that the Open-FCoE.org lport and nport WWPN formatting and parsing routines have been added from tcm_fc. Eventually these need to become part of libfc.

Best,

---
 drivers/target/Kbuild                             |    1 +
 drivers/target/Kconfig                            |    1 +
 drivers/target/tcm_qla2xxx/Kbuild                 |    6 +
 drivers/target/tcm_qla2xxx/Kconfig                |    6 +
 drivers/target/tcm_qla2xxx/tcm_qla2xxx_base.h     |   32 ++
 drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c |  330 ++++++++++++++++++
 drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.c   |  368 +++++++++++++++++++++
 drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.h   |   42 +++
 8 files changed, 786 insertions(+), 0 deletions(-)
 create mode 100644 drivers/target/tcm_qla2xxx/Kbuild
 create mode 100644 drivers/target/tcm_qla2xxx/Kconfig
 create mode 100644 drivers/target/tcm_qla2xxx/tcm_qla2xxx_base.h
 create mode 100644 drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c
 create mode 100644 drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.c
 create mode 100644 drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.h
drivers/target/Kbuild +1 -0
index 5298d6a..373f61c 100644
@@ -59,3 +59,4 @@ obj-$(CONFIG_LIO_TARGET)	+= lio-target/
 obj-$(CONFIG_TCM_LOOP_FABRIC)	+= tcm_loop/
 
 obj-$(CONFIG_TCM_FC)		+= tcm_fc/
+obj-$(CONFIG_TCM_QLA2XXX)	+= tcm_qla2xxx/
drivers/target/Kconfig +1 -0
index 95f2c2c..6d69e57 100644
@@ -65,3 +65,4 @@ config TCM_DEBUG_DEV
 source "drivers/target/tcm_loop/Kconfig"
 source "drivers/target/lio-target/Kconfig"
 source "drivers/target/tcm_fc/Kconfig"
+source "drivers/target/tcm_qla2xxx/Kconfig"
drivers/target/tcm_qla2xxx/Kbuild new file +6 -0
new file mode 100644
index 0000000..a527461
@@ -0,0 +1,6 @@
+EXTRA_CFLAGS += -I$(srctree)/drivers/target/ -I$(srctree)/drivers/scsi/ -I$(srctree)/include/scsi/ -I$(srctree)/drivers/target/tcm_qla2xxx
+
+tcm_qla2xxx-objs		:= tcm_qla2xxx_fabric.o \
+				   tcm_qla2xxx_configfs.o \
+
+obj-$(CONFIG_TCM_QLA2XXX)	+= tcm_qla2xxx.o
drivers/target/tcm_qla2xxx/Kconfig new file +6 -0
new file mode 100644
index 0000000..027cb8f
@@ -0,0 +1,6 @@
+config TCM_QLA2XXX
+	tristate "TCM_QLA2XXX fabric module for Qlogic 2xxx series target mode HBAs"
+	depends on TARGET_CORE && CONFIGFS_FS
+	default n
+	---help---
+	Say Y here to enable the TCM_QLA2XXX fabric module for Qlogic 2xxx series target mode HBAs 
drivers/target/tcm_qla2xxx/tcm_qla2xxx_base.h new file +32 -0
new file mode 100644
index 0000000..55a1267
@@ -0,0 +1,32 @@
+#define TCM_QLA2XXX_VERSION	"v0.1"
+/* length of ASCII WWPNs including pad */
+#define TCM_QLA2XXX_NAMELEN	32
+
+struct tcm_qla2xxx_nacl {
+	/* Binary World Wide unique Port Name for FC Initiator Nport */
+	u64 nport_wwpn;
+	/* ASCII formatted WWPN for FC Initiator Nport */
+	char nport_name[TCM_QLA2XXX_NAMELEN];
+	/* Returned by tcm_qla2xxx_make_nodeacl() */
+	struct se_node_acl_s se_node_acl;
+};
+
+struct tcm_qla2xxx_tpg {
+	/* FC lport target portal group tag for TCM */
+	u16 lport_tpgt;
+	/* Pointer back to tcm_qla2xxx_lport */
+	struct tcm_qla2xxx_lport *lport;
+	/* Returned by tcm_qla2xxx_make_tpg() */
+	struct se_portal_group_s se_tpg;
+};
+
+struct tcm_qla2xxx_lport {
+	/* SCSI protocol the lport is providing */
+	u8 lport_proto_id;
+	/* Binary World Wide unique Port Name for FC Target Lport */
+	u64 lport_wwpn;
+	/* ASCII formatted WWPN for FC Target Lport */
+	char lport_name[TCM_QLA2XXX_NAMELEN];
+	/* Returned by tcm_qla2xxx_make_lport() */
+	struct se_wwn_s lport_wwn;
+};
drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c new file +330 -0

330 lines not on this page · raw message

drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.c new file +368 -0

368 lines not on this page · raw message

drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.h new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
1.5.6.5