Hey Sasha,

This removes the workaround in perfquery that gets around lack of
AllPortSelect support on a CA w/ a single port.

Al

-- 
Albert Chu
[EMAIL PROTECTED]
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
>From 3d172fc085938226f53267bd1cc77bf16af06441 Mon Sep 17 00:00:00 2001
From: Albert Chu <[EMAIL PROTECTED]>
Date: Thu, 9 Oct 2008 16:38:43 -0700
Subject: [PATCH] remove single port CA AllPortSelect workaround


Signed-off-by: Albert Chu <[EMAIL PROTECTED]>
---
 infiniband-diags/src/perfquery.c |   31 ++++---------------------------
 1 files changed, 4 insertions(+), 27 deletions(-)

diff --git a/infiniband-diags/src/perfquery.c b/infiniband-diags/src/perfquery.c
index 05cc2d6..f6bf86f 100644
--- a/infiniband-diags/src/perfquery.c
+++ b/infiniband-diags/src/perfquery.c
@@ -83,7 +83,7 @@ usage(void)
 	exit(-1);
 }
 
-static void dump_perfcounters(int extended, int allports, int timeout,
+static void dump_perfcounters(int extended, int timeout,
 			      uint16_t cap_mask, ib_portid_t *portid, int port)
 {
 	char buf[1024];
@@ -92,9 +92,6 @@ static void dump_perfcounters(int extended, int allports, int timeout,
 		if (!port_performance_query(pc, portid, port, timeout))
 			IBERROR("perfquery");
 
-		if (allports == 1)
-			pc[1] = ALL_PORTS;	/* fake PortSelect */
-
 		mad_dump_perfcounters(buf, sizeof buf, pc, sizeof pc);
 	} else {
 		if (!(cap_mask & 0x200)) /* 1.2 errata: bit 9 is extended counter support */
@@ -103,9 +100,6 @@ static void dump_perfcounters(int extended, int allports, int timeout,
 		if (!port_performance_ext_query(pc, portid, port, timeout))
 			IBERROR("perfextquery");
 
-		if (allports == 1)
-			pc[1] = ALL_PORTS;	/* fake PortSelect */
-
 		mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 	}
 
@@ -254,28 +248,11 @@ main(int argc, char **argv)
 	}
 
 	if (allports == 1) {
-
-		/*
-		 * Simulate all ports support in PMA
-		 * Determine node type, number of (physical) ports,
-		 * and, if switch, whether SP0 is enhanced
-		 * to determine first and last port to query
-		 */
-
 		if (smp_query(data, &portid, IB_ATTR_NODE_INFO, 0, 0) < 0)
 			IBERROR("smp query nodeinfo failed");
 		node_type = mad_get_field(data, 0, IB_NODE_TYPE_F);
 		mad_decode_field(data, IB_NODE_NPORTS_F, &num_ports);
-		/* If loop_ports not set, can only do the limited simulation we currently allow */
-		if (!loop_ports) {
-			/* For now, support single port CAs */
-			if (node_type != IB_NODE_CA)    /* NodeType other than CA ? */
-				IBERROR("smp query nodeinfo: Node type not CA, cannot simulate AllPortSelect");
-			if (num_ports != 1)
-				IBERROR("smp query nodeinfo: %d ports; only 1 supported for AllPortSelect simulation", num_ports);
-			port = num_ports;
-		}
-		else {
+		if (loop_ports) {
 			if (!num_ports)
 				IBERROR("smp query nodeinfo: num ports invalid");
 
@@ -295,10 +272,10 @@ main(int argc, char **argv)
 	if (allports && loop_ports) {
 		IBWARN("Emulating AllPortSelect by iterating through all ports");
 		for (i = start_port; i <= num_ports; i++)
-			dump_perfcounters(extended, 0, timeout, cap_mask, &portid, i);
+			dump_perfcounters(extended, timeout, cap_mask, &portid, i);
 	}
 	else
-		dump_perfcounters(extended, allports, timeout, cap_mask, &portid, port);
+		dump_perfcounters(extended, timeout, cap_mask, &portid, port);
 
 	if (!reset)
 		exit(0);
-- 
1.5.4.5

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to