public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fc transport: new attributes for NPIV
@ 2006-01-05  9:01 Andreas Herrmann
  2006-01-05 14:08 ` James Smart
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Herrmann @ 2006-01-05  9:01 UTC (permalink / raw)
  To: James Smart, James Bottomley; +Cc: Linux SCSI

From: Andreas Herrmann <aherrman@de.ibm.com>

[PATCH] fc transport: new attributes for NPIV

With NPort-Id-Virtualization (NPIV) "virtual" ports can be
registered at an FC switch using one physical FC port.
Using FDISC an already logged in port can login additional
ports to the Fabric. Each addtional port gets assigned a
new destination ID (see FDISC description in FC-FS).
For problem determination it is useful to know not only the
virtual port name and its associated port id but also the
port name and port id of the physical port - the port that
initially logged into the Fabric.

I suggest to add new attributes (physical_port_name and
physical_port_id) to scsi_transport_fc.

Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>

---

 drivers/scsi/scsi_transport_fc.c |    7 +++++++
 include/scsi/scsi_transport_fc.h |    9 +++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

8f1f64a50977add786fdd14a0cbc13aae4bfa89f
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 685b997..365529a 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -295,6 +295,7 @@ static int fc_host_setup(struct transpor
 	 */
 	fc_host_node_name(shost) = -1;
 	fc_host_port_name(shost) = -1;
+	fc_host_physical_port_name(shost) = -1;
 	fc_host_supported_classes(shost) = FC_COS_UNSPECIFIED;
 	memset(fc_host_supported_fc4s(shost), 0,
 		sizeof(fc_host_supported_fc4s(shost)));
@@ -306,6 +307,7 @@ static int fc_host_setup(struct transpor
 		sizeof(fc_host_serial_number(shost)));
 
 	fc_host_port_id(shost) = -1;
+	fc_host_physical_port_id(shost) = -1;
 	fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
 	fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
 	memset(fc_host_active_fc4s(shost), 0,
@@ -795,6 +797,8 @@ static FC_CLASS_DEVICE_ATTR(host, suppor
 
 fc_private_host_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long);
 fc_private_host_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long);
+fc_private_host_rd_attr_cast(physical_port_name, "0x%llx\n", 20,
+			     unsigned long long);
 fc_private_host_rd_attr(symbolic_name, "%s\n", (FC_SYMBOLIC_NAME_SIZE +1));
 fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20);
 fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1));
@@ -835,6 +839,7 @@ static FC_CLASS_DEVICE_ATTR(host, speed,
 
 
 fc_host_rd_attr(port_id, "0x%06x\n", 20);
+fc_host_rd_attr(physical_port_id, "0x%06x\n", 20);
 fc_host_rd_enum_attr(port_type, FC_PORTTYPE_MAX_NAMELEN);
 fc_host_rd_enum_attr(port_state, FC_PORTSTATE_MAX_NAMELEN);
 fc_host_rd_attr_cast(fabric_name, "0x%llx\n", 20, unsigned long long);
@@ -1160,6 +1165,7 @@ fc_attach_transport(struct fc_function_t
 	count=0;
 	SETUP_HOST_ATTRIBUTE_RD(node_name);
 	SETUP_HOST_ATTRIBUTE_RD(port_name);
+	SETUP_HOST_ATTRIBUTE_RD(physical_port_name);
 	SETUP_HOST_ATTRIBUTE_RD(supported_classes);
 	SETUP_HOST_ATTRIBUTE_RD(supported_fc4s);
 	SETUP_HOST_ATTRIBUTE_RD(symbolic_name);
@@ -1168,6 +1174,7 @@ fc_attach_transport(struct fc_function_t
 	SETUP_HOST_ATTRIBUTE_RD(serial_number);
 
 	SETUP_HOST_ATTRIBUTE_RD(port_id);
+	SETUP_HOST_ATTRIBUTE_RD(physical_port_id);
 	SETUP_HOST_ATTRIBUTE_RD(port_type);
 	SETUP_HOST_ATTRIBUTE_RD(port_state);
 	SETUP_HOST_ATTRIBUTE_RD(active_fc4s);
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 394f14a..13a8171 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -303,6 +303,7 @@ struct fc_host_attrs {
 	/* Fixed Attributes */
 	u64 node_name;
 	u64 port_name;
+	u64 physical_port_name;
 	u32 supported_classes;
 	u8  supported_fc4s[FC_FC4_LIST_SIZE];
 	char symbolic_name[FC_SYMBOLIC_NAME_SIZE];
@@ -312,6 +313,7 @@ struct fc_host_attrs {
 
 	/* Dynamic Attributes */
 	u32 port_id;
+	u32 physical_port_id;
 	enum fc_port_type port_type;
 	enum fc_port_state port_state;
 	u8  active_fc4s[FC_FC4_LIST_SIZE];
@@ -338,6 +340,8 @@ struct fc_host_attrs {
 	(((struct fc_host_attrs *)(x)->shost_data)->node_name)
 #define fc_host_port_name(x)	\
 	(((struct fc_host_attrs *)(x)->shost_data)->port_name)
+#define fc_host_physical_port_name(x)	\
+	(((struct fc_host_attrs *)(x)->shost_data)->physical_port_name)
 #define fc_host_supported_classes(x)	\
 	(((struct fc_host_attrs *)(x)->shost_data)->supported_classes)
 #define fc_host_supported_fc4s(x)	\
@@ -352,6 +356,8 @@ struct fc_host_attrs {
 	(((struct fc_host_attrs *)(x)->shost_data)->serial_number)
 #define fc_host_port_id(x)	\
 	(((struct fc_host_attrs *)(x)->shost_data)->port_id)
+#define fc_host_physical_port_id(x)	\
+	(((struct fc_host_attrs *)(x)->shost_data)->physical_port_id)
 #define fc_host_port_type(x)	\
 	(((struct fc_host_attrs *)(x)->shost_data)->port_type)
 #define fc_host_port_state(x)	\
@@ -388,6 +394,7 @@ struct fc_function_template {
 	void 	(*get_starget_port_id)(struct scsi_target *);
 
 	void 	(*get_host_port_id)(struct Scsi_Host *);
+	void 	(*get_host_physical_port_id)(struct Scsi_Host *);
 	void	(*get_host_port_type)(struct Scsi_Host *);
 	void	(*get_host_port_state)(struct Scsi_Host *);
 	void	(*get_host_active_fc4s)(struct Scsi_Host *);
@@ -426,6 +433,7 @@ struct fc_function_template {
 	/* host fixed attributes */
 	unsigned long	show_host_node_name:1;
 	unsigned long	show_host_port_name:1;
+	unsigned long	show_host_physical_port_name:1;
 	unsigned long	show_host_supported_classes:1;
 	unsigned long	show_host_supported_fc4s:1;
 	unsigned long	show_host_symbolic_name:1;
@@ -434,6 +442,7 @@ struct fc_function_template {
 	unsigned long	show_host_serial_number:1;
 	/* host dynamic attributes */
 	unsigned long	show_host_port_id:1;
+	unsigned long	show_host_physical_port_id:1;
 	unsigned long	show_host_port_type:1;
 	unsigned long	show_host_port_state:1;
 	unsigned long	show_host_active_fc4s:1;
-- 
0.99.9n-g58e3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-01-10 18:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <OFE227A343.800436AC-ON412570ED.0055DD4F-412570ED.00560A75@de.ibm.com>
2006-01-05 17:28 ` [PATCH] fc transport: new attributes for NPIV James Smart
2006-01-09 18:05   ` Christoph Hellwig
2006-01-09 19:04     ` James Smart
2006-01-09 23:09       ` Andreas Herrmann
2006-01-10 18:00         ` James Smart
2006-01-09 23:59     ` Andreas Herrmann
2006-01-10 18:11       ` James Smart
2006-01-05  9:01 Andreas Herrmann
2006-01-05 14:08 ` James Smart
2006-01-05 15:51   ` Andreas Herrmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox