From patchwork Mon Mar 27 15:36:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9647055 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 972FE601D7 for ; Mon, 27 Mar 2017 15:36:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85BCF28427 for ; Mon, 27 Mar 2017 15:36:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 796D228446; Mon, 27 Mar 2017 15:36:51 +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 DE9F728427 for ; Mon, 27 Mar 2017 15:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297AbdC0Pgu (ORCPT ); Mon, 27 Mar 2017 11:36:50 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35684 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146AbdC0Pgt (ORCPT ); Mon, 27 Mar 2017 11:36:49 -0400 Received: by mail-wr0-f194.google.com with SMTP id p52so11397961wrc.2 for ; Mon, 27 Mar 2017 08:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=7Z6jNQkggJA7+7G1cwGDGH0o7FF44J77ZEbzpK1K+tI=; b=JgMYPsez0DrohgCYhJUR8OvL3GoSfSB21yC5TZAVQCpYGbfMFjOYRMs5hovTxaFKX7 Q25Y9OJRh4ArV5yLzf8yE2Zflhjs6FKsDHqms7ocjfstcWSc6Bwu4ZkoKoB93K2S5wUx 98JBLdFqebpEd6zV+nYlDgv7/HB2k2Xwk/gzotqYKQxQ0Rnb1OkNCIkmfJ9r2gL6taRC P+DgS5vAl7scfqkA2nJmJ4t/kzm486yJynUZDzw58UQUKQofdsnE3+ION0AVVeiG1nM1 Af9lFDZRrYctyVx7pVvAXQWOrb5313pPbpywhPb3w1BNTEfEETNKpRnqK5yq3rcm/D/r M7Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=7Z6jNQkggJA7+7G1cwGDGH0o7FF44J77ZEbzpK1K+tI=; b=nQ7pNSaVOvybqUKvk9K3VEp2rRwEMvdTZbeIjz/dMPfTDZhJ1JhexPJ1vA6gbaIjFf /8dtTQOPpHhxBZbie/w2I0OqB5lym6DftOpPXK7G94ICcOqt49KXSVsSxzVIP3HUA1Pp SWAGkJdHF0w3Wos63r6j/ZK6ahbWWmX+/tv7bTKk9YlGajXiPtpf5RdfV9wFz+91OVgf bmE43TQh/wU57bBccCFaO7tPO50KK9PFKn3o/lU6Xak84LnTYqu5XEwOT1b4VdJm6KyN qdQA6V/Q2V6yQdBOr+jCl3n5Fkp4m8vL09+Qc2x6l4JGNG7dfDT/QL0D5Mu/H1uqOnZQ SMIA== X-Gm-Message-State: AFeK/H34AXAf1JLdL/Ob0+0s7oyFiyZsGL2+jUoc3PXBFy0SnD1pC795WyWs5v3QUVargw== X-Received: by 10.223.150.15 with SMTP id b15mr20566025wra.191.1490628974534; Mon, 27 Mar 2017 08:36:14 -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 q72sm1144370wrb.54.2017.03.27.08.36.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Mar 2017 08:36:13 -0700 (PDT) From: Hal Rosenstock Subject: [PATCH infiniband-diags 1/3] perfquery.c: Output PerfMgt ClassPortInfo CapabilityMask2 To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" Message-ID: Date: Mon, 27 Mar 2017 11:36:12 -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 --- 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; -- 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) {