Skip to contentSkip to conversation

libibmad: Add support for optional PortRcvErrorDetails counter

PATCH Applied Hal Rosenstock 2 participants 2 messages Dec 31, 2009 – Jan 12, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libibmad: Add support for optional PortRcvErrorDetails counter

---

libibmad/include/infiniband/mad.h +13 -1
index b9f42c0..cadce6c 100644
@@ -168,6 +168,7 @@ enum GSI_ATTR_ID {
 	IB_GSI_PORT_SAMPLES_CONTROL = 0x10,
 	IB_GSI_PORT_SAMPLES_RESULT = 0x11,
 	IB_GSI_PORT_COUNTERS = 0x12,
+	IB_GSI_PORT_RCV_ERROR_DETAILS = 0x15,
 	IB_GSI_PORT_XMIT_DISCARD_DETAILS = 0x16,
 	IB_GSI_PORT_COUNTERS_EXT = 0x1D,
 	IB_GSI_PORT_XMIT_DATA_SL = 0x36,
@@ -659,6 +660,17 @@ enum MAD_FIELDS {
 	IB_PC_XMT_SW_HOL_DISC_F,
 	IB_PC_XMT_DISC_LAST_F,
 
+	/*
+	 * PortRcvErrorDetails fields
+	 */
+	IB_PC_RCV_LOCAL_PHY_ERR_F,
+	IB_PC_RCV_MALFORMED_PKT_ERR_F,
+	IB_PC_RCV_BUF_OVR_ERR_F,
+	IB_PC_RCV_DLID_MAP_ERR_F,
+	IB_PC_RCV_VL_MAP_ERR_F,
+	IB_PC_RCV_LOOPING_ERR_F,
+	IB_PC_RCV_ERR_LAST_F,
+
 	IB_FIELD_LAST_		/* must be last */
 };
 
@@ -981,7 +993,7 @@ MAD_EXPORT ib_mad_dump_fn
     mad_dump_nodedesc, mad_dump_nodeinfo, mad_dump_portinfo,
     mad_dump_switchinfo, mad_dump_perfcounters, mad_dump_perfcounters_ext,
     mad_dump_perfcounters_xmt_sl, mad_dump_perfcounters_rcv_sl,
-    mad_dump_perfcounters_xmt_disc;
+    mad_dump_perfcounters_xmt_disc, mad_dump_perfcounters_rcv_err;
 
 MAD_EXPORT int ibdebug;
 
libibmad/src/dump.c +10 -0
index 3039f03..13524e3 100644
@@ -739,6 +739,16 @@ void mad_dump_perfcounters_xmt_disc(char *buf, int bufsz, void *val, int valsz)
 		     IB_PC_XMT_DISC_LAST_F);
 }
 
+void mad_dump_perfcounters_rcv_err(char *buf, int bufsz, void *val, int valsz)
+{
+	int cnt;
+
+	cnt = _dump_fields(buf, bufsz, val, IB_PC_EXT_PORT_SELECT_F,
+			   IB_PC_EXT_XMT_BYTES_F);
+	_dump_fields(buf + cnt, bufsz - cnt, val, IB_PC_RCV_LOCAL_PHY_ERR_F,
+		     IB_PC_RCV_ERR_LAST_F);
+}
+
 void xdump(FILE * file, char *msg, void *p, int size)
 {
 #define HEX(x)  ((x) < 10 ? '0' + (x) : 'a' + ((x) -10))
libibmad/src/fields.c +11 -0
index c2f9585..d6f63cd 100644
@@ -458,6 +458,17 @@ static const ib_field_t ib_mad_f[] = {
 	{80, 16, "PortSwHOQLifetimeLimitDiscards", mad_dump_uint},
 	{0, 0},			/* IB_PC_XMT_DISC_LAST_F */
 
+	/*
+	 * PortRcvErrorDetails fields
+	 */
+	{32, 16, "PortLocalPhysicalErrors", mad_dump_uint},
+	{48, 16, "PortMalformedPktErrors", mad_dump_uint},
+	{64, 16, "PortBufferOverrunErrors", mad_dump_uint},
+	{80, 16, "PortDLIDMappingErrors", mad_dump_uint},
+	{96, 16, "PortVLMappingErrors", mad_dump_uint},
+	{112, 16, "PortLoopingErrors", mad_dump_uint},
+	{0, 0},                 /* IB_PC_RCV_ERR_LAST_F */
+
 	{0, 0}			/* IB_FIELD_LAST_ */
 
 };
libibmad/src/libibmad.map +1 -0
index 2a6a253..a9e5fcd 100644
@@ -25,6 +25,7 @@ IBMAD_1.3 {
 		mad_dump_perfcounters_xmt_sl;
 		mad_dump_perfcounters_rcv_sl;
 		mad_dump_perfcounters_xmt_disc;
+		mad_dump_perfcounters_rcv_err;
 		mad_dump_physportstate;
 		mad_dump_portcapmask;
 		mad_dump_portinfo;

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