From patchwork Wed Nov 23 16:47:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9443817 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 A1ACB6075F for ; Wed, 23 Nov 2016 16:48:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A919027CF9 for ; Wed, 23 Nov 2016 16:48:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DA7827D0C; Wed, 23 Nov 2016 16:48:06 +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 214DF27CF9 for ; Wed, 23 Nov 2016 16:48:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752001AbcKWQsF (ORCPT ); Wed, 23 Nov 2016 11:48:05 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:34466 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbcKWQsE (ORCPT ); Wed, 23 Nov 2016 11:48:04 -0500 Received: by mail-wj0-f196.google.com with SMTP id xy5so1449469wjc.1 for ; Wed, 23 Nov 2016 08:48:03 -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=XiaOo88vuYtSpBgpBTkDrhsa9PlP0a1AKdBTV9xgh20=; b=hi91angrgQV4wdyF4HI49FXm0H80n7b1KWWuixH2iZINo+51SQF5ssnuibLVNyJZvy AQ0wAjnlD+4VxoCAe2j48/IMM9VdLevyPvUMMB+zN9AAiPjZhk8HLpfYx5Y80CvY7P1r A7CCAS+3oNkwoUL8iRdMQdbpj/Sm3mcMO5i/sC5sO7Ad99CCrOErek4xuQXQHdlTY77Q QOTwJCHd01Yj4+Gaei5ERlpO1/MFIZQeStdm0JgfSebpq3V034BqvnSp1obEXyZFQWkI wxQeQZwIjns0TGArk2mUC/leJaM8emrQBwHFxqqDU67RFLvMJzqUpjULXBiye96Ac6NN HYaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=XiaOo88vuYtSpBgpBTkDrhsa9PlP0a1AKdBTV9xgh20=; b=aXfrgXxF8TtkVXHQw0+CtWMMAQPW4UjqP8rHl04RDbhEOOx9s/r3OGXxbKHsAff9fz Z9mTRwMosydHTXPi2NYAA5noyZZHsETlEjZFTRq8tzIoAHtcir+E+OFSpF59inpB969R cywzny7363+cb2ZzW3XuidCDwdpRzvg4kkbBLXxViGlQNejImVKxrxuWckWQLQWedRDf QMAvXJnJefiNM5FqpXcR/JK2l5vKJ+vE0LeUhjbIb3/PPit/r55ukDw/rWVvBxSUtp5d CMPjv35sYpZ3pGh2gxJzlAdvwvmKwbYwH1i+yS6Adgtw1cBXTLzQ+ieyY7ooZ4sKGiZK aWcg== X-Gm-Message-State: AKaTC03iT+tr/GJNyJAmPIKTETif5OEXwEKTW3XzXxwBxaB+q89wTVFbfn/IJn81e7qqPg== X-Received: by 10.194.171.200 with SMTP id aw8mr3935042wjc.79.1479919682456; Wed, 23 Nov 2016 08:48:02 -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 m145sm3668074wma.3.2016.11.23.08.48.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 08:48:01 -0800 (PST) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10 Message-ID: <99b0d971-af69-1ad3-454f-6b6e4f47c892@dev.mellanox.co.il> Date: Wed, 23 Nov 2016 11:47:59 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 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 "Found link at QDR but expected speed is FDR10" for this case. Confusion is with words "Could be" since both QDR and FDR10 are both 10.0 Gbps. Signed-off-by: Hal Rosenstock --- 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 2a1e971..fa9a294 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, + "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,