From patchwork Mon Mar 27 15:34:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9647049 X-Patchwork-Delegate: ira.weiny@intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B71A601D7 for ; Mon, 27 Mar 2017 15:35:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BB6628427 for ; Mon, 27 Mar 2017 15:35:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0088A2842E; Mon, 27 Mar 2017 15:35:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67EDF28427 for ; Mon, 27 Mar 2017 15:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752913AbdC0PfI (ORCPT ); Mon, 27 Mar 2017 11:35:08 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35872 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752766AbdC0PfH (ORCPT ); Mon, 27 Mar 2017 11:35:07 -0400 Received: by mail-wr0-f193.google.com with SMTP id u1so14375204wra.3 for ; Mon, 27 Mar 2017 08:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=NYGYFqEyiMAkRM6rgyoBttyIEWiR14RzgdpjGN+d06U=; b=0iS1Hpe1M9+g0PRDY97PNRd0kUDkK0NY5XgV77ASOoGuuAl+cqQ0kOleXLcsV3gLl6 ediwV8m6IrbA0aLxOoKw2Z9oiVyD2DHxoFd8PEyIbdEfiO4aIsfW6g8ulxCRjZVfd9GE k36gbQPSglvVyhjngz9wLKy4yN1bOfPElT9c6JTg2vOCErZzEyUVWhxmK612ZI/Dj24/ 2Ybd8dEQAJDCGp5prLzHOVC/Kv9oFqsCJj6BowxtuwdWozR6yYNePz6O2br8LUX8czDz mJT6Z0W4x/O0tppRkQAHNwOmUdZB6IG2hCtspf82NawnCFcyXEjLkngDoqPX/RfdUi/R DGRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=NYGYFqEyiMAkRM6rgyoBttyIEWiR14RzgdpjGN+d06U=; b=VQ7R1OIbmAlMMAzjiy8/CSXZqeYDs2vHKCwOvprUCinl94i39RJB5RzCzcWKru1LVx /2XUEsfyv6Kt4yu36C7DMCf/WLLtM0/POVARBw+vfy9Kbe10y5oE4eJl71mjVkccE5Hn 6Z4DXADhvf8immHDTrB8mEf7i7FL8NtcG3/daJ4Uaj4tWYxzqdpW2q41MAnVTdH+9JXb lDuLh3C8ksNJJ7SO15XB2dorPukK6I4BofZZz9Yx7DGFzJHX8ykMefdXDfUKGfslpGtJ EHjrj179pTPjLRl8zN35s2omLZR1vF2s66QoNi3qAZE1Vw9YJ+MzRbYCSIzRxhy3qZLX sSaQ== X-Gm-Message-State: AFeK/H15tipQrSc8JgEOB7Fsxi2aNpMBBupH+GVUavMQtIbtFLPfWrhZjWUhzQu4OBCP7g== X-Received: by 10.28.54.89 with SMTP id d86mr10094666wma.137.1490628895115; Mon, 27 Mar 2017 08:34:55 -0700 (PDT) Received: from [192.168.1.183] (c-67-189-170-197.hsd1.ma.comcast.net. [67.189.170.197]) by smtp.googlemail.com with ESMTPSA id o196sm1334563wmg.12.2017.03.27.08.34.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2017 08:34:54 -0700 (PDT) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH libibmad 1/2] mad.h, [fields dump].c: Add support for additional PortCountersExtended fields Message-ID: Date: Mon, 27 Mar 2017 11:34:52 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP introduced by MgtWG errata #9301-9303 Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/infiniband/mad.h b/include/infiniband/mad.h index 946e034..50c5bc5 100644 --- a/include/infiniband/mad.h +++ b/include/infiniband/mad.h @@ -1290,6 +1290,26 @@ enum MAD_FIELDS { IB_PESC_PORT_FEC_CORR_SYMBOL_CTR_F, IB_PESC_RSFEC_LAST_F, + /* + * More PortCountersExtended fields + */ + IB_PC_EXT_COUNTER_SELECT2_F, + IB_PC_EXT_ERR_SYM_F, + IB_PC_EXT_LINK_RECOVERS_F, + IB_PC_EXT_LINK_DOWNED_F, + IB_PC_EXT_ERR_RCV_F, + IB_PC_EXT_ERR_PHYSRCV_F, + IB_PC_EXT_ERR_SWITCH_REL_F, + IB_PC_EXT_XMT_DISCARDS_F, + IB_PC_EXT_ERR_XMTCONSTR_F, + IB_PC_EXT_ERR_RCVCONSTR_F, + IB_PC_EXT_ERR_LOCALINTEG_F, + IB_PC_EXT_ERR_EXCESS_OVR_F, + IB_PC_EXT_VL15_DROPPED_F, + IB_PC_EXT_XMT_WAIT_F, + IB_PC_EXT_QP1_DROP_F, + IB_PC_EXT_ERR_LAST_F, + IB_FIELD_LAST_ /* must be last */ }; diff --git a/src/dump.c b/src/dump.c index b7ad381..b491bc2 100644 --- a/src/dump.c +++ b/src/dump.c @@ -792,7 +792,14 @@ void mad_dump_perfcounters(char *buf, int bufsz, void *val, int valsz) void mad_dump_perfcounters_ext(char *buf, int bufsz, void *val, int valsz) { - _dump_fields(buf, bufsz, val, IB_PC_EXT_FIRST_F, IB_PC_EXT_LAST_F); + int cnt; + + cnt = _dump_fields(buf, bufsz, val, IB_PC_EXT_FIRST_F, IB_PC_EXT_LAST_F); + if (cnt < 0) + return; + + _dump_fields(buf + cnt, bufsz - cnt, val, + IB_PC_EXT_COUNTER_SELECT2_F, IB_PC_EXT_ERR_LAST_F); } void mad_dump_perfcounters_xmt_sl(char *buf, int bufsz, void *val, int valsz) diff --git a/src/fields.c b/src/fields.c index fbade55..8273f97 100644 --- a/src/fields.c +++ b/src/fields.c @@ -984,6 +984,26 @@ static const ib_field_t ib_mad_f[] = { {1184, 32, "PortFECCorrectedSymbolCtr", mad_dump_uint}, {0, 0}, /* IB_PESC_RSFEC_LAST_F */ + /* + * More PortCountersExtended fields + */ + {32, 32, "CounterSelect2", mad_dump_hex}, + {576, 64, "SymbolErrorCounter", mad_dump_uint}, + {640, 64, "LinkErrorRecoveryCounter", mad_dump_uint}, + {704, 64, "LinkDownedCounter", mad_dump_uint}, + {768, 64, "PortRcvErrors", mad_dump_uint}, + {832, 64, "PortRcvRemotePhysicalErrors", mad_dump_uint}, + {896, 64, "PortRcvSwitchRelayErrors", mad_dump_uint}, + {960, 64, "PortXmitDiscards", mad_dump_uint}, + {1024, 64, "PortXmitConstraintErrors", mad_dump_uint}, + {1088, 64, "PortRcvConstraintErrors", mad_dump_uint}, + {1152, 64, "LocalLinkIntegrityErrors", mad_dump_uint}, + {1216, 64, "ExcessiveBufferOverrunErrors", mad_dump_uint}, + {1280, 64, "VL15Dropped", mad_dump_uint}, + {1344, 64, "PortXmitWait", mad_dump_uint}, + {1408, 64, "QP1Dropped", mad_dump_uint}, + {0, 0}, /* IB_PC_EXT_ERR_LAST_F */ + {0, 0} /* IB_FIELD_LAST_ */ };