From patchwork Mon Dec 19 22:25:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9480805 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 3E572601C0 for ; Mon, 19 Dec 2016 22:25:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DB60284E8 for ; Mon, 19 Dec 2016 22:25:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FB1F284FC; Mon, 19 Dec 2016 22:25:18 +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 8DE60284E8 for ; Mon, 19 Dec 2016 22:25:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753125AbcLSWZQ (ORCPT ); Mon, 19 Dec 2016 17:25:16 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36399 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbcLSWZP (ORCPT ); Mon, 19 Dec 2016 17:25:15 -0500 Received: by mail-wm0-f68.google.com with SMTP id m203so21068571wma.3 for ; Mon, 19 Dec 2016 14:25:15 -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-transfer-encoding; bh=wuU9iGw735YkMvvP9PurCc2ZfXjR9d1y97RtIUpkhPM=; b=PPGh90X5nNvdHqEBeszDC2W1IL6TikqfPFeHW6tU/PY7VKGGQSem+9J7DskK0pVJcO gGiplZnIaxcSWj4nPqvhuIkr5/f3dA68pYD5jhLLBH/pTxkB+ODnCzqWHCu8WXVskFAk bScpB0pQboiKeLtWj7ORvREyvDSPH9xT+BJ9El2O8MXA+NU8ZNV8htkpkA/8K7tfZjXL u6h2R5CHjd0saeD3qs+IhYxMkzino90YU1C5yJtczukNGM9Ox8zqCFT+bihBHBRN/h7v EK1Y1nyr+f3YiLussoqQk0AmGDyfmFsoyllDJXlInG+4x0hELEN4s4CdX2J0ahJJaU3H 1CcA== 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=wuU9iGw735YkMvvP9PurCc2ZfXjR9d1y97RtIUpkhPM=; b=fpwP/GXp2eJS5r5QlQEn3rZ8Y8T6K8TCup5PjRaqgq7+p3GIUPFMhqP9Zv6ascrVhN VvI97qTwIkgMVspw8CK/c7rM8CjUpiYX455Wo5ItlKQ+dhaON7ir/W8WhX7KNOC9Yhbc wOBNCYFOS1c3YXtfnD2ELTKr1ntEzDWuBILWq6A3dygh8vMOVKxzLleU9mQS2RH08d5B 3O02Xepg6Ah8cPuLwM1HGGHQvhOf9rJiuqMv8BZpa9r5WkEiBTBnVh9Qiurrn86kTR3j 499Iq1G85d+mwRSbEnYv2xc0EOsaUvoy68S+QAds2lqtRazTnAiJ6GBg8cMTlsXOUNhy p/ng== X-Gm-Message-State: AIkVDXKzEjHUDMyS7OOc70+HvzIk56M2W2iMimhb+lj5R+cNRS6lF5qw6rOwns8+yLh/CQ== X-Received: by 10.28.15.138 with SMTP id 132mr14370896wmp.41.1482186314166; Mon, 19 Dec 2016 14:25:14 -0800 (PST) Received: from [192.168.1.183] (c-50-177-105-67.hsd1.ma.comcast.net. [50.177.105.67]) by smtp.googlemail.com with ESMTPSA id v3sm22641367wjp.13.2016.12.19.14.25.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 14:25:13 -0800 (PST) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH v2 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10 Message-ID: <094d3fd9-a478-ce30-b2de-8983c783c411@dev.mellanox.co.il> Date: Mon, 19 Dec 2016 17:25:11 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.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 Rather than printing "Could be FDR10", print "Could be FDR10 (Found link at QDR but expected speed is FDR10)" for this case. Confusion is with words "Could be" and fact that both QDR and FDR10 are both 10.0 Gbps. Signed-off-by: Hal Rosenstock --- Change since v1: Preserved original "Could be FDR10" so can grep for "Could be" along with adding new language. src/ibdiag_common.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 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/ibdiag_common.c b/src/ibdiag_common.c index f74eed4..ad8551f 100644 --- a/src/ibdiag_common.c +++ b/src/ibdiag_common.c @@ -814,8 +814,14 @@ check_ext_speed: check_fdr10_active: if ((mad_get_field(port->ext_info, 0, - IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) - snprintf(speed_msg, msg_size, "Could be FDR10"); + IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0) { + /* Special case QDR to try to avoid confusion with FDR10 */ + if (mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F) == 4) + snprintf(speed_msg, msg_size, + "Could be FDR10 (Found link at QDR but expected speed is FDR10)"); + else + snprintf(speed_msg, msg_size, "Could be FDR10"); + } } int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,