[ewg] [PATCH] management: adding mad_dump_fields to libibmad

Mike Heinz michael.heinz at qlogic.com
Thu May 6 11:30:02 PDT 2010


Sasha asked that I re-submit the patches for perfquery in a slightly different format. This is the second of 3 patches.

This patch uses the new mad_dump_fields function to suppress the display of extended attributes when querying switches that do not support them.

Signed off: Michael Heinz

---------- snip ----------
diff --git a/infiniband-diags/src/perfquery.c b/infiniband-diags/src/perfquery.c
index 00ebfff..07a9226 100644
--- a/infiniband-diags/src/perfquery.c
+++ b/infiniband-diags/src/perfquery.c
@@ -302,7 +302,10 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 		if (aggregate)
 			aggregate_perfcounters();
 		else
-			mad_dump_perfcounters(buf, sizeof buf, pc, sizeof pc);
+			mad_dump_fields(buf, sizeof buf, pc, sizeof pc,
+							IB_PC_FIRST_F,
+							(cap_mask & 0x1000)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
+
 	} else {
 		if (!(cap_mask & 0x200))	/* 1.2 errata: bit 9 is extended counter support */
 			IBWARN



More information about the ewg mailing list