From patchwork Thu Jan 14 14:11:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 72838 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 o0EEJNdo030831 for ; Thu, 14 Jan 2010 14:19:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584Ab0ANOTW (ORCPT ); Thu, 14 Jan 2010 09:19:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751852Ab0ANOTW (ORCPT ); Thu, 14 Jan 2010 09:19:22 -0500 Received: from qmta07.westchester.pa.mail.comcast.net ([76.96.62.64]:49384 "EHLO qmta07.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584Ab0ANOTV (ORCPT ); Thu, 14 Jan 2010 09:19:21 -0500 Received: from omta07.westchester.pa.mail.comcast.net ([76.96.62.59]) by qmta07.westchester.pa.mail.comcast.net with comcast id VRd61d0041GhbT857SKM2W; Thu, 14 Jan 2010 14:19:21 +0000 Received: from hal.comcast.net ([75.69.247.31]) by omta07.westchester.pa.mail.comcast.net with comcast id VSKL1d0060hNrtn3TSKL9z; Thu, 14 Jan 2010 14:19:21 +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 o0EEEiuc012222; Thu, 14 Jan 2010 09:14:49 -0500 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id o0EEBvGK012187; Thu, 14 Jan 2010 09:11:57 -0500 Date: Thu, 14 Jan 2010 09:11:56 -0500 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH] libibmad: Add support for PortSamplesControl counter Message-ID: <20100114141156.GA12180@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 cadce6c..02ef551 100644 --- a/libibmad/include/infiniband/mad.h +++ b/libibmad/include/infiniband/mad.h @@ -671,6 +671,41 @@ enum MAD_FIELDS { IB_PC_RCV_LOOPING_ERR_F, IB_PC_RCV_ERR_LAST_F, + /* + * PortSamplesControl fields + */ + IB_PSC_OPCODE_F, + IB_PSC_PORT_SELECT_F, + IB_PSC_TICK_F, + IB_PSC_COUNTER_WIDTH_F, + IB_PSC_COUNTER_MASK0_F, + IB_PSC_COUNTER_MASKS1TO9_F, + IB_PSC_COUNTER_MASKS10TO14_F, + IB_PSC_SAMPLE_MECHS_F, + IB_PSC_SAMPLE_STATUS_F, + IB_PSC_OPTION_MASK_F, + IB_PSC_VENDOR_MASK_F, + IB_PSC_SAMPLE_START_F, + IB_PSC_SAMPLE_INTVL_F, + IB_PSC_TAG_F, + IB_PSC_COUNTER_SEL0_F, + IB_PSC_COUNTER_SEL1_F, + IB_PSC_COUNTER_SEL2_F, + IB_PSC_COUNTER_SEL3_F, + IB_PSC_COUNTER_SEL4_F, + IB_PSC_COUNTER_SEL5_F, + IB_PSC_COUNTER_SEL6_F, + IB_PSC_COUNTER_SEL7_F, + IB_PSC_COUNTER_SEL8_F, + IB_PSC_COUNTER_SEL9_F, + IB_PSC_COUNTER_SEL10_F, + IB_PSC_COUNTER_SEL11_F, + IB_PSC_COUNTER_SEL12_F, + IB_PSC_COUNTER_SEL13_F, + IB_PSC_COUNTER_SEL14_F, + IB_PSC_SAMPLES_ONLY_OPT_MASK_F, + IB_PSC_LAST_F, + IB_FIELD_LAST_ /* must be last */ }; @@ -993,7 +1028,8 @@ 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_rcv_err; + mad_dump_perfcounters_xmt_disc, mad_dump_perfcounters_rcv_err, + mad_dump_portsamples_control; MAD_EXPORT int ibdebug; diff --git a/libibmad/src/dump.c b/libibmad/src/dump.c index 13524e3..335e190 100644 --- a/libibmad/src/dump.c +++ b/libibmad/src/dump.c @@ -749,6 +749,11 @@ void mad_dump_perfcounters_rcv_err(char *buf, int bufsz, void *val, int valsz) IB_PC_RCV_ERR_LAST_F); } +void mad_dump_portsamples_control(char *buf, int bufsz, void *val, int valsz) +{ + _dump_fields(buf, bufsz, val, IB_PSC_OPCODE_F, IB_PSC_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 d6f63cd..a5a510a 100644 --- a/libibmad/src/fields.c +++ b/libibmad/src/fields.c @@ -469,6 +469,41 @@ static const ib_field_t ib_mad_f[] = { {112, 16, "PortLoopingErrors", mad_dump_uint}, {0, 0}, /* IB_PC_RCV_ERR_LAST_F */ + /* + * PortSamplesControl fields + */ + {BITSOFFS(0, 8), "OpCode", mad_dump_hex}, + {BITSOFFS(8, 8), "PortSelect", mad_dump_uint}, + {BITSOFFS(16, 8), "Tick", mad_dump_hex}, + {BITSOFFS(29, 3), "CounterWidth", mad_dump_uint}, + {BITSOFFS(34, 3), "CounterMask0", mad_dump_hex}, + {BITSOFFS(37, 27), "CounterMasks1to9", mad_dump_hex}, + {BITSOFFS(65, 15), "CounterMasks10to14", mad_dump_hex}, + {BITSOFFS(80, 8), "SampleMechanisms", mad_dump_uint}, + {BITSOFFS(94, 2), "SampleStatus", mad_dump_uint}, + {96, 64, "OptionMask", mad_dump_hex}, + {160, 64, "VendorMask", mad_dump_hex}, + {224, 32, "SampleStart", mad_dump_uint}, + {256, 32, "SampleInterval", mad_dump_uint}, + {288, 16, "Tag", mad_dump_hex}, + {304, 16, "CounterSelect0", mad_dump_hex}, + {320, 16, "CounterSelect1", mad_dump_hex}, + {336, 16, "CounterSelect2", mad_dump_hex}, + {352, 16, "CounterSelect3", mad_dump_hex}, + {368, 16, "CounterSelect4", mad_dump_hex}, + {384, 16, "CounterSelect5", mad_dump_hex}, + {400, 16, "CounterSelect6", mad_dump_hex}, + {416, 16, "CounterSelect7", mad_dump_hex}, + {432, 16, "CounterSelect8", mad_dump_hex}, + {448, 16, "CounterSelect9", mad_dump_hex}, + {464, 16, "CounterSelect10", mad_dump_hex}, + {480, 16, "CounterSelect11", mad_dump_hex}, + {496, 16, "CounterSelect12", mad_dump_hex}, + {512, 16, "CounterSelect13", mad_dump_hex}, + {528, 16, "CounterSelect14", mad_dump_hex}, + {576, 64, "SamplesOnlyOptionMask", mad_dump_hex}, + {0, 0}, /* IB_PSC_LAST_F */ + {0, 0} /* IB_FIELD_LAST_ */ }; diff --git a/libibmad/src/libibmad.map b/libibmad/src/libibmad.map index a9e5fcd..e2d0b05 100644 --- a/libibmad/src/libibmad.map +++ b/libibmad/src/libibmad.map @@ -29,6 +29,7 @@ IBMAD_1.3 { mad_dump_physportstate; mad_dump_portcapmask; mad_dump_portinfo; + mad_dump_portsamples_control; mad_dump_portstates; mad_dump_portstate; mad_dump_rhex;