From patchwork Tue Nov 28 22:11:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 10081173 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 4681260353 for ; Tue, 28 Nov 2017 22:11:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37EDE29710 for ; Tue, 28 Nov 2017 22:11:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C77A29713; Tue, 28 Nov 2017 22:11: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.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 AC5DB29710 for ; Tue, 28 Nov 2017 22:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752170AbdK1WLt (ORCPT ); Tue, 28 Nov 2017 17:11:49 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:40584 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbdK1WLt (ORCPT ); Tue, 28 Nov 2017 17:11:49 -0500 Received: by mail-qt0-f196.google.com with SMTP id u42so1924390qte.7 for ; Tue, 28 Nov 2017 14:11:49 -0800 (PST) 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=00aAAURFL1eCcpCVRVJVQBiLlUqFbwsBkUI2YrqSkyE=; b=Tb+tQNc4UEAR7fIo+q6BAhkt5dfpP1qaLi3XsYZTQi90zralEvtR/zg0Ro8DDnxwfK pXjZU3a7YceOm/HUuUBg9+VB7B3CXqSpJp2LKSk/bCIr00wIcbZEP5HXEElqKdlHFx3k TwssV5DnrE/eyrKfbeAHOa3saa0Na+aM3u3PAHbvlA8ieRoSR1LMyP2v5HHXRRRnU9ru fIiLJozaQgVS9i9YraAaiIvjjOgVgwWSTrJ71ZBJ1ZXNK0xTjWqGPR45riYdhiF0M6U7 Mn1UJr8CLjtSegWcUKlo3I/GnpAFsOHIKuR4kU24ojTnyth2zGJ9j9rk3yA/x9Ny2DpE bY0w== 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=00aAAURFL1eCcpCVRVJVQBiLlUqFbwsBkUI2YrqSkyE=; b=sZW8EnJttusNsmWfUv3RkM2e0QxirXjupyYGuZ88dkEN2KRoq9OcgAh4Abq6ymbkgv IQakSEiOTKHB8S+g1MxMU047/hdSJji2YyDqSTLSLk+DRB2b0gZgPaY7CZaG1R/SLoEJ Wb2rlGAt9BH6FU8K6ofYqbd5tEabYuIZalvom1cWIM6JXbQyNkRk71uKcIZfku9uPW72 25sPXFzqrh5uJW4+kl3OmVie+eqnADVHgET+YILxMBQ+Angvav679fp0Hmyx/zbq9GjZ I4QzkW4f82jHQPfWOkmyb9pwYa0mrqXEfNEwqKDnplSxZWcGNoVGPO3QLUZSEJmlNfri lDDw== X-Gm-Message-State: AJaThX5OPqEJ3vsZBdNur/dCD9EgU5JDUeXAc4zK0IeUwjdjguxJ27uA B9KqR98ueOZlMuB2odONg9NOAyfX X-Google-Smtp-Source: AGs4zMYHOhEZsGs1HLx1l66v5i/FKSexliJww3Q05LnfQRfYbM1o3YCtubIWPEEtpJpv4Cwqj37r2A== X-Received: by 10.237.39.155 with SMTP id a27mr1194457qtd.201.1511907108610; Tue, 28 Nov 2017 14:11:48 -0800 (PST) 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 k20sm154516qtj.36.2017.11.28.14.11.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2017 14:11:48 -0800 (PST) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH infiniband-diags 2/6] libibmad/dump.c: Add HDR support for PortInfo LinkSpeedExt* fields Message-ID: <41adffa2-8e7e-20da-19d6-523e89bca9a8@dev.mellanox.co.il> Date: Tue, 28 Nov 2017 17:11:47 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 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 Per MgtWG comments #9364-9366 Signed-off-by: Hal Rosenstock --- libibmad/src/dump.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libibmad/src/dump.c b/libibmad/src/dump.c index 1f41e62..98d5a34 100644 --- a/libibmad/src/dump.c +++ b/libibmad/src/dump.c @@ -336,6 +336,9 @@ void mad_dump_linkspeedext(char *buf, int bufsz, void *val, int valsz) case 2: snprintf(buf, bufsz, "25.78125 Gbps"); break; + case 4: + snprintf(buf, bufsz, "53.125 Gbps"); + break; default: snprintf(buf, bufsz, "undefined (%d)", speed); break; @@ -355,13 +358,16 @@ static void dump_linkspeedext(char *buf, int bufsz, int speed) n += snprintf(buf + n, bufsz - n, "14.0625 Gbps or "); if (n < bufsz && speed & 0x2) n += snprintf(buf + n, bufsz - n, "25.78125 Gbps or "); + if (n < bufsz && speed & 0x4) + n += snprintf(buf + n, bufsz - n, "53.125 Gbps or "); + if (n >= bufsz) { if (bufsz > 3) buf[n - 4] = '\0'; return; } - if (speed >> 2) { + if (speed >> 3) { n += snprintf(buf + n, bufsz - n, "undefined (%d)", speed); return; } else if (bufsz > 3)