From patchwork Mon Jul 31 16:57:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9872585 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 E0D746037D for ; Mon, 31 Jul 2017 16:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C154B28540 for ; Mon, 31 Jul 2017 16:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B42292855E; Mon, 31 Jul 2017 16:57:16 +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 7B87B28540 for ; Mon, 31 Jul 2017 16:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750999AbdGaQ5O (ORCPT ); Mon, 31 Jul 2017 12:57:14 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32932 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbdGaQ5N (ORCPT ); Mon, 31 Jul 2017 12:57:13 -0400 Received: by mail-wm0-f66.google.com with SMTP id q189so25494380wmd.0 for ; Mon, 31 Jul 2017 09:57:12 -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-language:content-transfer-encoding; bh=AyZzXbnaJ9R6LwsZ7bRSwZL93KIwYPr4c3N5I6thwsw=; b=D96KbGHkXe1cWFZCs06+iIDI+TsjWxT9bxB23ykcujG3RIXpOYxQpxQzIQXTMoKvqU K3LF+y633yU67BoU66rX9uEW/BUNtC3usaJpteXcXUm3Xuwl63T8HxIrHY6Ibc/wFHAB rBYB/vdoe6E+eCq90OKrAlD2YsQ/+4lb9q82gTW9nSXUwURkaLVQQtbW3dOXrtnH5XgQ bPJr57Tb0C5CxeG1IgXmXTDKpYRyh0UObFhjQwLnMDpBpSnnlacu5hD3u+6R4DYaLRex j7/Tfol7USH83edrQV4PrCQ9Cipc8wpX1fTqbtsmQxjcEAf2fHzvBvsGpyz/XL25t2IX rT1A== 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-language:content-transfer-encoding; bh=AyZzXbnaJ9R6LwsZ7bRSwZL93KIwYPr4c3N5I6thwsw=; b=aIYV/jRSYDBlkJZCZVl6Y6ytgpJQ/nHm9B1x79hTHGheC5Adqxj5uPoZ7dNcd0LJvZ dxWKwUtY7DnzSmYoUREvgesPy9BYzDFiwfsgAHNsDHF+l9SZ4YdqwUSG3b+dypktpI7K Pmng3X3e73Wcn6IPcb9NpD164TZZyGrNdSdxz/hCzEDRQY8psdEB4nyLrmfp0/o1jNVs IMWAcPNP7hwmtUCBaSVuky0KGChmrCnZ9LQx3socXE9sGl/d+pLrPD5PZm6Yrri59Gu2 U9cu4aeSkegI1ozmitdO7TEMfI+lcZqDws3lVMtZIl4EhgkjfbZyoXYmKBai1vsDut3I RJLA== X-Gm-Message-State: AIVw112dMVpKxy+g4Qj1vyOEgje3XawJdI9DautR4MTsq9c+kqa1dZUX IpX0zhPhVKuzmomSlCc= X-Received: by 10.28.38.133 with SMTP id m127mr7229895wmm.6.1501520231961; Mon, 31 Jul 2017 09:57:11 -0700 (PDT) Received: from [192.168.1.183] (c-73-182-207-166.hsd1.ma.comcast.net. [73.182.207.166]) by smtp.googlemail.com with ESMTPSA id e1sm37962147wrc.91.2017.07.31.09.57.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 09:57:11 -0700 (PDT) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH infiniband-diags] ibcc[config query].c: Make SwitchPortCongestionSetting IBA 1.3 compliant Message-ID: Date: Mon, 31 Jul 2017 12:57:09 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-US 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 IBA 1.3 supports 48 ports rather than 32 ports as at IBA 1.2.1 for SwitchCongestionSetting attribute. Signed-off-by: Hal Rosenstock --- src/ibccconfig.c | 2 +- src/ibccquery.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ibccconfig.c b/src/ibccconfig.c index 22b16db..64aa804 100644 --- a/src/ibccconfig.c +++ b/src/ibccconfig.c @@ -412,7 +412,7 @@ static char *switch_port_congestion_setting(ib_portid_t * dest, char **argv, int &cong_parm_marking_rate); if (!cc_config_status_via(payload, rcv, dest, IB_CC_ATTR_SWITCH_PORT_CONGESTION_SETTING, - portnum / 32, 0, NULL, srcport, cckey)) + portnum / 48, 0, NULL, srcport, cckey)) return "switch port congestion setting config failed"; return NULL; diff --git a/src/ibccquery.c b/src/ibccquery.c index 39e45b7..95e553d 100644 --- a/src/ibccquery.c +++ b/src/ibccquery.c @@ -224,11 +224,11 @@ static char *switch_port_congestion_setting(ib_portid_t * dest, char **argv, int memset(data, '\0', sizeof data); if (!cc_query_status_via(data, dest, IB_CC_ATTR_SWITCH_PORT_CONGESTION_SETTING, - portnum / 32, 0, NULL, srcport, cckey)) + portnum / 48, 0, NULL, srcport, cckey)) return "switch port congestion setting query failed"; mad_dump_cc_switchportcongestionsettingelement(buf, sizeof buf, - data + ((portnum % 32) * 4), + data + ((portnum % 48) * 4), 4); printf("%s", buf); return NULL; @@ -236,7 +236,7 @@ static char *switch_port_congestion_setting(ib_portid_t * dest, char **argv, int /* else get all port info */ - maxblocks = numports / 32 + 1; + maxblocks = numports / 48 + 1; for (i = 0; i < maxblocks; i++) { memset(data, '\0', sizeof data); @@ -244,8 +244,8 @@ static char *switch_port_congestion_setting(ib_portid_t * dest, char **argv, int i, 0, NULL, srcport, cckey)) return "switch port congestion setting query failed"; - for (j = 0; j < 32 && outputcount <= numports; j++) { - printf("Port:............................%u\n", i * 32 + j); + for (j = 0; j < 48 && outputcount <= numports; j++) { + printf("Port:............................%u\n", i * 48 + j); mad_dump_cc_switchportcongestionsettingelement(buf, sizeof buf, data + j * 4, 4);