[ofa-general] [PATCH 1/2] infiniband-diags/ibnetdiscover: Add port GUIDs to topology file

Hal Rosenstock halr at voltaire.com
Tue Jun 5 11:46:17 PDT 2007


infiniband-diags/ibnetdiscover: Add port GUIDs to topology file

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

diff --git a/infiniband-diags/man/ibnetdiscover.8 b/infiniband-diags/man/ibnetdiscover.8
index 84f7a20..48291d5 100644
--- a/infiniband-diags/man/ibnetdiscover.8
+++ b/infiniband-diags/man/ibnetdiscover.8
@@ -101,9 +101,9 @@ attempted to be fulfilled, and will fail
 The topology file format is human readable and largely intuitive.
 Most identifiers are given textual names like vendor ID (vendid), device ID
 (device ID), GUIDs of various types (sysimgguid, caguid, switchguid, etc.).  
-The IB node is identified followed by the number of ports and a quoted string
-which contains the nodetype (S, H, R) followed by a - then followed by the
-node GUID. On the right of this line is a comment (#) followed by the
+PortGUIDs are shown in parentheses ().  For switches, this is shown on the
+switchguid line.  For CA and router ports, it is shown on the connectivity lines.  The IB node is identified followed by the number of ports and a quoted 
+the node GUID.  On the right of this line is a comment (#) followed by the
 NodeDescription in quotes.  If the node is a switch, this line also contains
 whether switch port 0 is base or enhanced, and the LID and LMC of port 0.
 Subsequent lines pertaining to this node show the connectivity.   On the 
@@ -121,7 +121,7 @@ output line.
 An example of this is:
 .nf
 #
-# Topology file: generated on Fri Jun  1 11:16:02 2007
+# Topology file: generated on Tue Jun  5 14:15:10 2007
 #
 # Max of 3 hops discovered
 # Initiated from node 0008f10403960558 port 0008f10403960559
@@ -131,20 +131,20 @@ Non-Chassis Nodes
 vendid=0x8f1
 devid=0x5a06
 sysimgguid=0x5442ba00003000
-switchguid=0x5442ba00003080
+switchguid=0x5442ba00003080(5442ba00003080)
 Switch  24 "S-005442ba00003080"         # "ISR9024 Voltaire" base port 0 lid 6 lmc 0
-[22]    "H-0008f10403961354"[1]         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
+[22]    "H-0008f10403961354"[1](8f10403961355)         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
 [10]    "S-0008f10400410015"[1]         # "SW-6IB4 Voltaire" lid 3 4xSDR
-[8]     "H-0008f10403960558"[2]         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
+[8]     "H-0008f10403960558"[2](8f1040396055a)         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
 [6]     "S-0008f10400410015"[3]         # "SW-6IB4 Voltaire" lid 3 4xSDR
-[12]    "H-0008f10403960558"[1]         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
+[12]    "H-0008f10403960558"[1](8f10403960559)         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
 
 vendid=0x8f1
 devid=0x5a05
-switchguid=0x8f10400410015
+switchguid=0x8f10400410015(8f10400410015)
 Switch  8 "S-0008f10400410015"          # "SW-6IB4 Voltaire" base port 0 lid 3 lmc 0
-[6]     "H-0008f10403960984"[1]         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
-[4]     "H-005442b100004900"[1]         # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
+[6]     "H-0008f10403960984"[1](8f10403960985)         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
+[4]     "H-005442b100004900"[1](5442b100004901)        # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
 [1]     "S-005442ba00003080"[10]                # "ISR9024 Voltaire" lid 6 1xSDR
 [3]     "S-005442ba00003080"[6]         # "ISR9024 Voltaire" lid 6 4xSDR
 
@@ -152,26 +152,26 @@ vendid=0x2c9
 devid=0x5a44
 caguid=0x8f10403960984
 Ca      2 "H-0008f10403960984"          # "MT23108 InfiniHost Mellanox Technologies"
-[1]     "S-0008f10400410015"[6]         # lid 16 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
+[1](8f10403960985)     "S-0008f10400410015"[6]         # lid 16 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
 
 vendid=0x2c9
 devid=0x5a44
 caguid=0x5442b100004900
 Ca      2 "H-005442b100004900"          # "MT23108 InfiniHost Mellanox Technologies"
-[1]     "S-0008f10400410015"[4]         # lid 12 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
+[1](5442b100004901)     "S-0008f10400410015"[4]         # lid 12 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
 
 vendid=0x2c9
 devid=0x5a44
 caguid=0x8f10403961354
 Ca      2 "H-0008f10403961354"          # "MT23108 InfiniHost Mellanox Technologies"
-[1]     "S-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+[1](8f10403961355)     "S-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
 
 vendid=0x2c9
 devid=0x5a44
 caguid=0x8f10403960558
 Ca      2 "H-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technologies"
-[2]     "S-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
-[1]     "S-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
+[2](8f1040396055a)     "S-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+[1](8f10403960559)     "S-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
 .fi
 
 When grouping is used, IB nodes are organized into chasses which are
diff --git a/infiniband-diags/src/ibnetdiscover.c b/infiniband-diags/src/ibnetdiscover.c
index c08aa61..c321d59 100644
--- a/infiniband-diags/src/ibnetdiscover.c
+++ b/infiniband-diags/src/ibnetdiscover.c
@@ -46,7 +46,7 @@
 #include <errno.h>
 #include <inttypes.h>
 
-#define __BUILD_VERSION_TAG__ 1.2.3
+#define __BUILD_VERSION_TAG__ 1.2.4
 #include <common.h>
 #include <umad.h>
 #include <mad.h>
@@ -518,6 +518,7 @@ out_switch(Node *node, int group)
 
 	out_ids(node);
 	fprintf(f, "switchguid=0x%" PRIx64, node->nodeguid);
+	fprintf(f, "(%" PRIx64 ")", node->portguid);
 	if (group) {
 		if (node->chrecord) {
 			if (node->chrecord->chassisnum) {
@@ -617,6 +618,8 @@ out_switch_port(Port *port, int group)
 		node_name(port->remoteport->node),
 		port->remoteport->portnum,
 		ext_port_str ? ext_port_str : "");
+	if (port->remoteport->node->type != SWITCH_NODE)
+		fprintf(f, "(%" PRIx64 ") ", port->remoteport->portguid);
 	fprintf(f, "\t\t# \"%s\" lid %d %s%s\n",
 		rem_nodename,
 		port->remoteport->node->type == SWITCH_NODE ? port->remoteport->node->smalid : port->remoteport->lid,
@@ -634,12 +637,16 @@ out_ca_port(Port *port, int group)
 	char *rem_nodename = NULL;
 
 	fprintf(f, "[%d]", port->portnum);
+	if (port->node->type != SWITCH_NODE)
+		fprintf(f, "(%" PRIx64 ") ", port->portguid);
 	fprintf(f, "\t%s[%d]",
 		node_name(port->remoteport->node),
 		port->remoteport->portnum);
 	str = out_ext_port(port->remoteport, group);
 	if (str)
 		fprintf(f, "%s", str);
+	if (port->remoteport->node->type != SWITCH_NODE)
+		fprintf(f, " (%" PRIx64 ") ", port->remoteport->portguid);
 
 	if (port->remoteport->node->type == SWITCH_NODE)
 		rem_nodename = lookup_switch_name(switch_map_fp,






More information about the general mailing list