From patchwork Thu Dec 31 16:57:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 70412 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBVH1nFN025504 for ; Thu, 31 Dec 2009 17:01:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752675AbZLaRBs (ORCPT ); Thu, 31 Dec 2009 12:01:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752750AbZLaRBs (ORCPT ); Thu, 31 Dec 2009 12:01:48 -0500 Received: from qmta08.westchester.pa.mail.comcast.net ([76.96.62.80]:56027 "EHLO QMTA08.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752675AbZLaRBr (ORCPT ); Thu, 31 Dec 2009 12:01:47 -0500 Received: from OMTA16.westchester.pa.mail.comcast.net ([76.96.62.88]) by QMTA08.westchester.pa.mail.comcast.net with comcast id Pqaa1d0051uE5Es58t1nep; Thu, 31 Dec 2009 17:01:47 +0000 Received: from hal.comcast.net ([75.69.247.31]) by OMTA16.westchester.pa.mail.comcast.net with comcast id PtDf1d00B0hNrtn3ctDfZR; Thu, 31 Dec 2009 17:13:40 +0000 Received: from hal.comcast.net (localhost.localdomain [127.0.0.1]) by hal.comcast.net (8.14.3/8.14.3) with ESMTP id nBVGx3E8009166; Thu, 31 Dec 2009 11:59:09 -0500 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id nBVGvYQI009130; Thu, 31 Dec 2009 11:57:34 -0500 Date: Thu, 31 Dec 2009 11:57:34 -0500 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH] libibmad: Add support for optional PortRcvErrorDetails counter Message-ID: <20091231165734.GA9123@comcast.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h index b9f42c0..cadce6c 100644 --- a/libibmad/include/infiniband/mad.h +++ b/libibmad/include/infiniband/mad.h @@ -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; diff --git a/libibmad/src/dump.c b/libibmad/src/dump.c index 3039f03..13524e3 100644 --- a/libibmad/src/dump.c +++ b/libibmad/src/dump.c @@ -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)) diff --git a/libibmad/src/fields.c b/libibmad/src/fields.c index c2f9585..d6f63cd 100644 --- a/libibmad/src/fields.c +++ b/libibmad/src/fields.c @@ -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_ */ }; diff --git a/libibmad/src/libibmad.map b/libibmad/src/libibmad.map index 2a6a253..a9e5fcd 100644 --- a/libibmad/src/libibmad.map +++ b/libibmad/src/libibmad.map @@ -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;