From patchwork Tue Dec 20 16:28:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9481803 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 C3B9C60237 for ; Tue, 20 Dec 2016 16:28:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B30862811E for ; Tue, 20 Dec 2016 16:28:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A61D72816B; Tue, 20 Dec 2016 16:28:44 +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 2DA6B2811E for ; Tue, 20 Dec 2016 16:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933598AbcLTQ2m (ORCPT ); Tue, 20 Dec 2016 11:28:42 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35302 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934606AbcLTQ2l (ORCPT ); Tue, 20 Dec 2016 11:28:41 -0500 Received: by mail-wm0-f65.google.com with SMTP id f82so180281wmf.2 for ; Tue, 20 Dec 2016 08:28:41 -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=MAHPdn0PtnaKjF/u2lZJoxPNLSgDqaRdPsOZW5TAT3A=; b=2NXET7Is01dtnpYiMRDiPRQtFq7rZqzIX2nMBpCKQMvq7Aorpa92M5WyBsBjmoYHyS blR6kSJydQQ0ktFTcduMYs+ARbI+0JQ/uKtbDoI3yaATUJBBscgYz0ncAgkoTUKT38DR l2rrYdtOde7rFNOZuf39mOcJDmXKALj+iWKdUlpsOEJUoThuZMdcqaiv3srowh2P63Gw /qdh89ZTJ8sxDg09hn9jdkUZUvTJDoH0dO68AonnLNATRlHx7vOpddh8s4+QitlMmcG3 KxXBgEl9XAy1OaCtlKnOZ1SVx+HWYDpmml2BvhyOsUvhj4KLuxeGkUh10zsGWdE7atJq +Leg== 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=MAHPdn0PtnaKjF/u2lZJoxPNLSgDqaRdPsOZW5TAT3A=; b=Ocpi8rPM78ryUBGmQulxhx1jY/eJUhXraAMH0GiyyQ3bHc9SirEVAt/OEqlk7dAGHm 55oDoUepmPfL7nRT9RwhPyUxjFdYD5sGMtHxpeYfBoIuF5/iYzLUBQAra+8o3O7JIVNq g0qSdtE9nFhx0/7DI3l1M0ooLlkFhfnxQ81XQHjT0aK6pGSuc77Dhqah0Qx3wcECpCc1 s5P1VK9/43F+j5fYFXw1nOppKEXhOWDWbhCoJ+X1Rig78V1QqwhIZJz6BzxXxGJFabzu yWvrMIVxT8vlEpoRWUDzgn8e3PJBnKLtH1D8p0uqjCh7L/BHNEIp++uLgZTas+nI7UsN kRpA== X-Gm-Message-State: AIkVDXImC6K+4jP3zWpbbru2FfeIf9dbywbKX/Cq8ioHpTqG1I268+uecg6uUfJiSDKGjA== X-Received: by 10.28.218.129 with SMTP id r123mr2577360wmg.137.1482251320459; Tue, 20 Dec 2016 08:28:40 -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 k2sm26390972wjv.11.2016.12.20.08.28.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2016 08:28:39 -0800 (PST) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH v3 infiniband-diags] ibdiag_common.c: Disambiguate link speed when QDR and could be FDR10 Message-ID: Date: Tue, 20 Dec 2016 11:28:38 -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 Reviewed-By: Yuval Shaia --- Change since v2: Added Active comment to clarify value of 4 for PortInfo:LinkSpeedActive 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..8cad03a 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) /* QDR (10.0 Gbps) */ + 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,