Skip to contentSkip to conversation

infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

PATCH In review Ira Weiny 2 participants 7 messages May 24, 2011 – May 25, 2011 5 messages not in the archive InfiniBand

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 2/2 infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

From: Ira Weiny <[email protected]>
Date: Fri, 13 May 2011 22:28:55 -0700
Subject: [PATCH 2/2] infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

---
 src/perfquery.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
src/perfquery.c +32 -20
index 165c419..d34958f 100644
@@ -227,7 +227,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -244,14 +244,17 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}
 }
 
 static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
@@ -260,6 +263,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
+	memset(buf, 0, 1024);
+
 	/* set port_select to 255 to emulate AllPortSelect */
 	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
 	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
@@ -271,14 +276,17 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
 			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
-			 &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
-			 &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
-			 &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
-			 &perf_count_ext.portmulticastrcvpkts);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}
 
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
@@ -312,9 +320,13 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
 	} else {
-		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED))	/* 1.2 errata: bit 9 is extended counter support */
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
 			IBWARN
-			    ("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n",
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
 			     ntohs(cap_mask));
 
 		memset(pc, 0, sizeof(pc));
@@ -322,7 +334,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
 			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
 						  sizeof pc);
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 36 lines · Ira Weiny

From: Ira Weiny <[email protected]>
Date: Fri, 13 May 2011 22:28:55 -0700
Subject: [PATCH 2/2] infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

---
 src/perfquery.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
src/perfquery.c +2 -9
index 165c419..d34958f 100644
@@ -227,7 +227,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -244,14 +244,17 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+

src/perfquery.c static void aggregate_perfcounters_ext(void) · line 257

Quoted 10 lines
src/perfquery.c +10 -0
+	if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}

Doesn't NoIETF mean these counters aren't supported ? How can you get unicast/multicast transmit/receive counters ?

Quoted 25 lines
src/perfquery.c +3 -8
 }
 
 static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
@@ -260,6 +263,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
+	memset(buf, 0, 1024);
+
 	/* set port_select to 255 to emulate AllPortSelect */
 	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
 	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
@@ -271,14 +276,17 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
 			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
-			 &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
-			 &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
-			 &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
-			 &perf_count_ext.portmulticastrcvpkts);
+

src/perfquery.c static void output_aggregate_perfcounters_ext(ib_portid_t * portid, · line 289

Quoted 10 lines
src/perfquery.c +10 -0
+	if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}

Same comment as above.

-- Hal

Quoted 20 lines
src/perfquery.c +6 -2
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
@@ -312,9 +320,13 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
 	} else {
-		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED))	/* 1.2 errata: bit 9 is extended counter support */
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
 			IBWARN
-			    ("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n",
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
 			     ntohs(cap_mask));
 
 		memset(pc, 0, sizeof(pc));

src/perfquery.c static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask, · line 340

Quoted 8 lines
src/perfquery.c +1 -1
@@ -322,7 +334,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
 			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
 						  sizeof pc);

--
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

A message that is not in the archive (sent off-list or not yet received): 4DDCF65C.6000309-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

author
#4 lore raw
Quoted 42 lines · On Wed, 25 May 2011 05:30:20 -0700 Hal Rosenstock…
Quoted 41 lines · Ira Weiny

From: Ira Weiny <[email protected]>
Date: Fri, 13 May 2011 22:28:55 -0700
Subject: [PATCH 2/2] infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

---
 src/perfquery.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
src/perfquery.c +7 -9
index 165c419..d34958f 100644
@@ -227,7 +227,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -244,14 +244,17 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
Quoted 8 lines

src/perfquery.c static void aggregate_perfcounters_ext(void) · line 257

Quoted 5 lines
src/perfquery.c +5 -0
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}

Doesn't NoIETF mean these counters aren't supported ? How can you get unicast/multicast transmit/receive counters ?

Typo, that should be.

	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {

...

Quoted 30 lines
Quoted 30 lines

}

static void output_aggregate_perfcounters_ext(ib_portid_t * portid,

src/perfquery.c +7 -8
@@ -260,6 +263,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
+	memset(buf, 0, 1024);
+
 	/* set port_select to 255 to emulate AllPortSelect */
 	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
 	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
@@ -271,14 +276,17 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
 			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
-			 &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
-			 &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
-			 &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
-			 &perf_count_ext.portmulticastrcvpkts);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
Quoted 8 lines

src/perfquery.c static void output_aggregate_perfcounters_ext(ib_portid_t * portid, · line 289

Quoted 6 lines
src/perfquery.c +6 -0
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}

Same comment as above.

Yep same correction.

Thanks for catching this,
Ira

Quoted 32 lines

-- Hal

Quoted 28 lines
src/perfquery.c +7 -3
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
@@ -312,9 +320,13 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
 	} else {
-		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED))	/* 1.2 errata: bit 9 is extended counter support */
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
 			IBWARN
-			    ("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n",
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
 			     ntohs(cap_mask));
 
 		memset(pc, 0, sizeof(pc));
@@ -322,7 +334,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
 			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
 						  sizeof pc);
Signature · 9 lines
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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
author
#5 lore raw

PATCH v2 2/2 infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

In reply to a message not in the archive

From: Ira Weiny <[email protected]>
Date: Fri, 13 May 2011 22:28:55 -0700
Subject: [PATCH 2/2] infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

Changes since V1:
fix typo
if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
to

	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
---
 src/perfquery.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
src/perfquery.c +32 -20
index 165c419..8923654 100644
@@ -227,7 +227,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -244,14 +244,17 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}
 }
 
 static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
@@ -260,6 +263,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
+	memset(buf, 0, 1024);
+
 	/* set port_select to 255 to emulate AllPortSelect */
 	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
 	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
@@ -271,14 +276,17 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
 			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
-			 &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
-			 &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
-			 &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
-			 &perf_count_ext.portmulticastrcvpkts);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}
 
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
@@ -312,9 +320,13 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
 	} else {
-		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED))	/* 1.2 errata: bit 9 is extended counter support */
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
 			IBWARN
-			    ("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n",
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
 			     ntohs(cap_mask));
 
 		memset(pc, 0, sizeof(pc));
@@ -322,7 +334,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
 			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
 						  sizeof pc);
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 42 lines · Ira Weiny

From: Ira Weiny <[email protected]>
Date: Fri, 13 May 2011 22:28:55 -0700
Subject: [PATCH 2/2] infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

Changes since V1:
fix typo
if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
to

	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
---
 src/perfquery.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
src/perfquery.c +2 -9
index 165c419..8923654 100644
@@ -227,7 +227,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -244,14 +244,17 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+

src/perfquery.c static void aggregate_perfcounters_ext(void) · line 257

Quoted 10 lines
src/perfquery.c +10 -0
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}

Since all these fields are already 64 bits, why is the aggregation even needed for the extended counters ? Should any perfcounters_ext aggregation routines just get excised ?

-- Hal

Quoted 54 lines
src/perfquery.c +19 -10
 }
 
 static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
@@ -260,6 +263,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
+	memset(buf, 0, 1024);
+
 	/* set port_select to 255 to emulate AllPortSelect */
 	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
 	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
@@ -271,14 +276,17 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
 			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
-			 &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
-			 &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
-			 &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
-			 &perf_count_ext.portmulticastrcvpkts);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
@@ -312,9 +320,13 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
 	} else {
-		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED))	/* 1.2 errata: bit 9 is extended counter support */
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
 			IBWARN
-			    ("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n",
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
 			     ntohs(cap_mask));
 
 		memset(pc, 0, sizeof(pc));

src/perfquery.c static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask, · line 340

Quoted 8 lines
src/perfquery.c +1 -1
@@ -322,7 +334,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
 			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
 						  sizeof pc);

--
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

A message that is not in the archive (sent off-list or not yet received): 4DDD480C.7050607-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

author
#9 lore raw
Quoted 49 lines · On Wed, 25 May 2011 11:18:52 -0700 Hal Rosenstock…
Quoted 48 lines · Ira Weiny

From: Ira Weiny <[email protected]>
Date: Fri, 13 May 2011 22:28:55 -0700
Subject: [PATCH 2/2] infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

Changes since V1:
fix typo
if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
to

	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
---
 src/perfquery.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
src/perfquery.c +8 -9
index 165c419..8923654 100644
@@ -227,7 +227,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -244,14 +244,17 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
Quoted 8 lines

src/perfquery.c static void aggregate_perfcounters_ext(void) · line 257

Quoted 4 lines
src/perfquery.c +4 -0
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}

Since all these fields are already 64 bits, why is the aggregation even needed for the extended counters ? Should any perfcounters_ext aggregation routines just get excised ?

Not quite sure what you mean here. aggregate_perfcounters_ext must exist as it is used to sum readings across all ports. (Mainly to simulate AllPortSelect when the node does not support it.) I don't see anything which can be removed without removing that functionality.

Ira

Quoted 70 lines

-- Hal

Quoted 54 lines
src/perfquery.c +19 -10
 }
 
 static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
@@ -260,6 +263,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
+	memset(buf, 0, 1024);
+
 	/* set port_select to 255 to emulate AllPortSelect */
 	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
 	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
@@ -271,14 +276,17 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
 			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
-			 &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
-			 &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
-			 &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
-			 &perf_count_ext.portmulticastrcvpkts);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
@@ -312,9 +320,13 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
 	} else {
-		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED))	/* 1.2 errata: bit 9 is extended counter support */
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
 			IBWARN
-			    ("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n",
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
 			     ntohs(cap_mask));
 
 		memset(pc, 0, sizeof(pc));

src/perfquery.c static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask, · line 340

Quoted 8 lines
src/perfquery.c +1 -1
@@ -322,7 +334,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
 			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
 						  sizeof pc);

--
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

Signature · 9 lines
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw
Quoted 61 lines · Ira Weiny
Quoted 49 lines · On Wed, 25 May 2011 11:18:52 -0700 Hal Rosenstock…
Quoted 48 lines · Ira Weiny

From: Ira Weiny <[email protected]>
Date: Fri, 13 May 2011 22:28:55 -0700
Subject: [PATCH 2/2] infiniband-diags: perfquery; Support PortCountersExtendedNoIETF

Changes since V1:
fix typo
if (cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP) {
to

	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
---
 src/perfquery.c |   52 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 20 deletions(-)
src/perfquery.c +8 -9
index 165c419..8923654 100644
@@ -227,7 +227,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -244,14 +244,17 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
Quoted 8 lines

src/perfquery.c static void aggregate_perfcounters_ext(void) · line 257

Quoted 4 lines
src/perfquery.c +4 -0
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}

Since all these fields are already 64 bits, why is the aggregation even needed for the extended counters ? Should any perfcounters_ext aggregation routines just get excised ?

Quoted 4 lines

Not quite sure what you mean here. aggregate_perfcounters_ext must exist as it is used to sum readings across all ports. (Mainly to simulate AllPortSelect when the node does not support it.) I don't see anything which can be removed without removing that functionality.

Never mind; my bad; I forgot about emulating all ports when it's not supported.

-- Hal

Quoted 75 lines

Ira

Quoted 70 lines

-- Hal

Quoted 54 lines
src/perfquery.c +19 -10
 }
 
 static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
@@ -260,6 +263,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
+	memset(buf, 0, 1024);
+
 	/* set port_select to 255 to emulate AllPortSelect */
 	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
 	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
@@ -271,14 +276,17 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
 			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
-			 &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
-			 &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
-			 &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
-			 &perf_count_ext.portmulticastrcvpkts);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
@@ -312,9 +320,13 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
 	} else {
-		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED))	/* 1.2 errata: bit 9 is extended counter support */
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
 			IBWARN
-			    ("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n",
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
 			     ntohs(cap_mask));
 
 		memset(pc, 0, sizeof(pc));

src/perfquery.c static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask, · line 340

Quoted 8 lines
src/perfquery.c +1 -1
@@ -322,7 +334,7 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
 				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
 			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
 						  sizeof pc);

--
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

--
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