From patchwork Fri Aug 4 12:06:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9881171 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 6EA036031B for ; Fri, 4 Aug 2017 12:12:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4547A287C1 for ; Fri, 4 Aug 2017 12:12:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A1BC289BE; Fri, 4 Aug 2017 12:12:29 +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 9956B28854 for ; Fri, 4 Aug 2017 12:12:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752604AbdHDMMM (ORCPT ); Fri, 4 Aug 2017 08:12:12 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33704 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752342AbdHDMGw (ORCPT ); Fri, 4 Aug 2017 08:06:52 -0400 Received: by mail-wm0-f65.google.com with SMTP id q189so5492400wmd.0 for ; Fri, 04 Aug 2017 05:06:51 -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=ZX5OM/Hun5jmm4R2YwUTSkr85GNZOjYqhJfHdd/ktEI=; b=qHgmvujgq+FY3fFEMfEfMSjVYdzWwN4IGFPX5Gn/iupu7f3vlzPaINa7r+tBu7+cJr GJvUiKzB1isnAF7ODJZaQoGJlh6Ry2o0fZ1nIBpk4bOaiaOemtkJcnJMFm4CV/g4xniR 3ld/Bg/fHP0zGwB+w3wAul2xXMBCjSfe+S9uhSwyv2CI9OLDjW5rITwwyomNL4dzC6Pw pX29E/YCTjt3a/ceRe/ESVH58CEx9G9P7Hbh/LdycS44zek78RkTY5J3WC2EdU6rwxdM rIMq7XA8iTqEOKTUU2fv27QdATHlhpIffP1JQyhNl4xnQK6tJ1w60awFxBXd5AhOBjxy 04hw== 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=ZX5OM/Hun5jmm4R2YwUTSkr85GNZOjYqhJfHdd/ktEI=; b=AMX2LnFIUhWajIFGE4nQ5bH6dRSNwlk4SefB+taU+xWcSznS2m4ccIpUVjUwzfdtJT sQRdsITe1rymjADr9HcEID2iAVlHE+GHHG1ZK0/U8ei4saiT4Kw0pqUapecny09i64wy yjdXm/l3BMzz2t1PYc5pVjYpwu0FWbTljk0+KtlFxA5G1UVI9HT0X0v4+C3C/eucw4bn aEwbOeIaU0XYATaSKpOq5inl82qbt64xSfAtw1kkRNAbv1tjrT8lBaDDGRY89IEnTfwh LqIWq47FggTb1TzMU3ZAMtTGiAhRJhReNRvtB/vPmp4aBS38dxaht12KOPYKFhHVYVuG 4vqA== X-Gm-Message-State: AHYfb5irynmB3PQJfo3KvHpoFWKIZwsaSZnZE7+P4PQG0nIW+PO1FXeE lTbZb+nIhGO2u2HeV90= X-Received: by 10.28.59.8 with SMTP id i8mr1442391wma.53.1501848410980; Fri, 04 Aug 2017 05:06:50 -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 f85sm3173827wme.0.2017.08.04.05.06.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Aug 2017 05:06:50 -0700 (PDT) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCHv2 infiniband-diags] ibcc[config query].c: Make SwitchPortCongestionSetting IBA 1.3 compliant Message-ID: <284e8cb0-ed96-3bb7-75f1-3b852c169b2d@dev.mellanox.co.il> Date: Fri, 4 Aug 2017 08:06:48 -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 SwitchPortCongestionSetting attribute. Signed-off-by: Hal Rosenstock --- Change since v1: Updated description to indicate SwitchPortCongestionSetting rather than SwitchCongestionSetting attribute. 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);