From patchwork Tue Mar 28 14:56:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9649897 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 0D19C60349 for ; Tue, 28 Mar 2017 14:56:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3DA120453 for ; Tue, 28 Mar 2017 14:56:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E889526D05; Tue, 28 Mar 2017 14:56:58 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 E9766283A6 for ; Tue, 28 Mar 2017 14:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752680AbdC1O4d (ORCPT ); Tue, 28 Mar 2017 10:56:33 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34937 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbdC1O4c (ORCPT ); Tue, 28 Mar 2017 10:56:32 -0400 Received: by mail-wm0-f68.google.com with SMTP id z133so163725wmb.2 for ; Tue, 28 Mar 2017 07:56:31 -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=Ht48PBEvAiWy1f7x1F3tghmdkHoyFdcifslV1T32xMA=; b=PJbckMuhkE8iBsS6mwJMfDVKZSsTHRe0h5DGTzE708OMQhBNWgX+0lRDFnW9FM3QMu d6KqqekLSdwjPv87Zp39WE/lQ7qdFpzQLRv82/FEA2VwOWf2jcGXkS7NKQ5kGn5RFsYS E0EBE8jaXm/hQ7dfx92/OKEfiL702Fl6322z8vU5yP14i+Yqwbjy51snoOye53HvDWci 0VCCkHdDZmXCb0OTubhcPB3g/62S+w+rW4WmoQaemydr/Uf2B0hgzff3A5r8YhBwZrcJ lUPMIO+0iJzcg9reXrs910OH44AA9+5YdfGKySzxgs6NidxNIZipcy8iVqLX4nGfCC96 copw== 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=Ht48PBEvAiWy1f7x1F3tghmdkHoyFdcifslV1T32xMA=; b=oC6bffMZ7vASDFUWnLpiVMLc4cv6B7QujiBMkxmILfxaZdbVhsigiIPerdqAyG4HLG 9XFde99busORLNjYnWs+Nf3W00vUMg5yvRXbbnMymaD8cGl6t3v6vScZmXVAwQXNB82J UCRLxzpfWqHjwpP+TfJ68Q+4v8olM/Lvuhe9TSVmN+tn3gAQPuUplfDKBViCIM+aL/zy 1y8EKqHe9LhHrrmWsQRAt7C1K6/jBl92ie2MRaanmFMYYXYPdz9M2ZT46rW4jWO5gd4y fe/kLXPcWWjTu/6ePmy3GfEttB3iXcoyiSj1cA6S8bZqYbGzXjjAGvS+a2wFxO9Vc0E9 kJCg== X-Gm-Message-State: AFeK/H0L4TIDnri3RKkTHLPDkw0m8BjaqwuyDXtCbIGqql8w4q6nKoKct5PYJI6hQfwK+Q== X-Received: by 10.28.71.87 with SMTP id u84mr15022323wma.101.1490712971111; Tue, 28 Mar 2017 07:56:11 -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 q29sm5176648wrc.49.2017.03.28.07.56.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 07:56:10 -0700 (PDT) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH RESEND infiniband-diags 1/3] perfquery.c: Output PerfMgt ClassPortInfo CapabilityMask2 Message-ID: <166e48ee-97ae-2acc-6a8d-b06541385f01@dev.mellanox.co.il> Date: Tue, 28 Mar 2017 10:56:08 -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 in addition to CapabilityMask for PortCountersExtended attribute MgtWG errata #9301 defines IsAdditionalPortCountersExtendedSupported bit in CapabilityMask2. 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/src/perfquery.c b/src/perfquery.c index 948ce52..ab6c0f8 100644 --- a/src/perfquery.c +++ b/src/perfquery.c @@ -296,7 +296,8 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid, } static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask, - ib_portid_t * portid, int port, int aggregate) + uint32_t cap_mask2, ib_portid_t * portid, + int port, int aggregate) { char buf[1024]; @@ -344,8 +345,9 @@ static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask, if (!aggregate) { if (extended) printf("# Port extended counters: %s port %d " - "(CapMask: 0x%02X)\n%s", - portid2str(portid), port, ntohs(cap_mask), buf); + "(CapMask: 0x%02X CapMask2: 0x%07X)\n%s", + portid2str(portid), port, ntohs(cap_mask), + cap_mask2, buf); else printf("# Port counters: %s port %d " "(CapMask: 0x%02X)\n%s", @@ -699,6 +701,7 @@ int main(int argc, char **argv) ib_portid_t portid = { 0 }; int mask = 0xffff; uint64_t ext_mask = 0xffffffffffffffffULL; + uint32_t cap_mask2; uint16_t cap_mask; int all_ports_loop = 0; int node_type, num_ports = 0; @@ -816,6 +819,9 @@ int main(int argc, char **argv) IBEXIT("classportinfo query"); /* ClassPortInfo should be supported as part of libibmad */ memcpy(&cap_mask, pc + 2, sizeof(cap_mask)); /* CapabilityMask */ + memcpy(&cap_mask2, pc + 4, sizeof(cap_mask2)); /* CapabilityMask2 */ + cap_mask2 = ntohl(cap_mask2) >> 5; + if (!(cap_mask & IB_PM_ALL_PORT_SELECT)) { /* bit 8 is AllPortSelect */ if (!all_ports && port == ALL_PORTS) IBEXIT("AllPortSelect not supported"); @@ -942,7 +948,8 @@ int main(int argc, char **argv) if (all_ports_loop || (loop_ports && (all_ports || port == ALL_PORTS))) { for (i = start_port; i <= num_ports; i++) - dump_perfcounters(extended, ibd_timeout, cap_mask, + dump_perfcounters(extended, ibd_timeout, + cap_mask, cap_mask2, &portid, i, (all_ports_loop && !loop_ports)); if (all_ports_loop && !loop_ports) { @@ -956,7 +963,7 @@ int main(int argc, char **argv) } else if (ports_count > 1) { for (i = 0; i < ports_count; i++) dump_perfcounters(extended, ibd_timeout, cap_mask, - &portid, ports[i], + cap_mask2, &portid, ports[i], (all_ports && !loop_ports)); if (all_ports && !loop_ports) { if (extended != 1) @@ -967,8 +974,8 @@ int main(int argc, char **argv) cap_mask); } } else - dump_perfcounters(extended, ibd_timeout, cap_mask, &portid, - port, 0); + dump_perfcounters(extended, ibd_timeout, cap_mask, cap_mask2, + &portid, port, 0); if (!reset) goto done;