[openib-general] [PATCH] ibroute: When multiple paths, indicate port GUID on alternate paths

Hal Rosenstock halr at voltaire.com
Fri Jun 9 04:26:18 PDT 2006


ibroute: When multiple paths, indicate port GUID on alternate paths

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

Index: diags/src/ibroute.c
===================================================================
--- diags/src/ibroute.c	(revision 7646)
+++ diags/src/ibroute.c	(working copy)
@@ -272,10 +272,22 @@ dump_lid(char *str, int strlen, int lid,
 		if (!valid)
 			return snprintf(str, strlen, ": (path #%d - illegal port)",
 					lid - base_port_lid);
-		else
-			return snprintf(str, strlen, ": (path #%d out of %d)",
-					lid - base_port_lid + 1,
-					last_port_lid - base_port_lid + 1);
+		else {
+			lidport.lid = lid;
+			if (!smp_query(ni, &lidport, IB_ATTR_NODE_INFO, 0, 100))
+				return snprintf(str, strlen,
+						": (path #%d out of %d)",
+						lid - base_port_lid + 1,
+						last_port_lid - base_port_lid + 1);
+			else {
+				mad_decode_field(ni, IB_NODE_PORT_GUID_F, &portguid);
+				return snprintf(str, strlen,
+						": (path #%d out of %d: portguid %s)",
+						lid - base_port_lid + 1,
+						last_port_lid - base_port_lid + 1,
+						mad_dump_val(IB_NODE_PORT_GUID_F, sguid, sizeof sguid, &portguid));
+			}
+		}
 	}
 
 	if (!valid)







More information about the general mailing list