Skip to contentSkip to conversation

infiniband-diags: iblinkinfo flag ports which were not scanned

PATCH New Ira Weiny 1 participant 1 message Oct 26, 2011 InfiniBand

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 1/1 infiniband-diags: iblinkinfo flag ports which were not scanned

When using the -n option iblinkinfo may not scan the entire fabric. As such some ports will not be available to print. Output that information rather than blank data as before.

---
 src/iblinkinfo.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
src/iblinkinfo.c +6 -2
index 4b69a5c..00c7bc0 100644
@@ -214,8 +214,12 @@ void print_port(ibnd_node_t * node, ibnd_port_t * port, char *out_prefix)
 			 port->remoteport->portnum, ext_port_str, remap,
 			 width_msg, speed_msg);
 		free(remap);
-	} else
-		snprintf(remote_str, 256, "           [  ] \"\" ( )\n");
+	} else {
+		if (istate == IB_LINK_DOWN)
+			snprintf(remote_str, 256, "           [  ] \"\" ( )\n");
+		else
+			snprintf(remote_str, 256, "    \"Port not available\"\n");
+	}
 
 	if (port->ext_portnum)
 		snprintf(ext_port_str, 256, "%d", port->ext_portnum);
Signature · 6 lines
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html