Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp49861pxk; Tue, 15 Sep 2020 17:28:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymcyzBdhryEeIV9XjFkcfMB20Q7XZA6genABpf06qO9NdZEshX5j/vxjDNcxpZ+xw+10Se X-Received: by 2002:aa7:cd90:: with SMTP id x16mr24444836edv.302.1600216080809; Tue, 15 Sep 2020 17:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600216080; cv=none; d=google.com; s=arc-20160816; b=AUS0o4drEFarlVxd9VAZbLZZAVCDxSx56cmxWt2nT3GKnnHlI0PeCsIq3tridYvrmT XCv/v6gWBR6vrqjizqgBq8K2zkLHiJnXhT8q1k2kINcmli63FUgOnEzT+b+BgyA2/V5e VV50wSZQygwI4Gb3hYV5UMMY1LakiLkl0YdXtiQ8yj1KzyrB5SOVlSak8d82bYBm60JO /7OKlA5lOz5vI4xoaLpVd/nfeMiHlZ27sXfMtFmYlveOZgeY1wqE36EEB8nZlu0+zo71 BOm04TWdceVkJs64sGFAvI/ScG5vGVzGgS+SeF0hJb25yTs04lHcXiu0AnPTxhVN40hC F3oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jvv3ENDKCuXlruKCjZgADEpPtXF3rmeB/JSYRUOf/4s=; b=n23Lz6MaIzLqUuBmLsaE3NttbidVJNym51lu+FK6WEMxjoy5bMOmgjmiNDZqT14dNE 5GoLcCoA89kuax6oGZWyWOHtfIJfdvs3J+9J4xgMaTR5qhdUc6/H44yAZlhV+hzyn1b+ +d4pa4E3fNxyON6SujaA2IW53LZ/oWoEf7E2CQUPa0oVnm4a/7eTYmOjGrxI7EPSlzwM kkjRd7jtI++ADL1bJvMTtP6KfJmvMN84yQuHH0bRdQGB+BeNhCHiUnYXaweMAfnlh/Lx ibCskhNr1pqfrKrz78vFyGxZakDSdEJvEWUmx9A/LWnhR0Qx6HKXIdxGscpzl3//fsc9 u1ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fLPI2MSW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si10603147edt.172.2020.09.15.17.27.38; Tue, 15 Sep 2020 17:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fLPI2MSW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727531AbgIPAZG (ORCPT + 99 others); Tue, 15 Sep 2020 20:25:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:60482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbgIOORJ (ORCPT ); Tue, 15 Sep 2020 10:17:09 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0589021D43; Tue, 15 Sep 2020 14:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179313; bh=Yt0b4gJDcQu0ta/aIo+Zh5yuVYciFiPTALHJWdllOX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fLPI2MSWHHBxWF9TuG2L1CLpaXe39lJzcATAqhv+vVBNxB09ybIlw4Q9UZRBHZ0uW omdWbvqQ5NwWkCX8BEm9etqzBYFig9M8ryhPkBBFGTl50GW+sxqj+Qfz8IF2E3Y01E mweRtJ30SHrRgVJmWEkv6Avc9a9jyZARDrzpARiM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kamal Heib , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 11/78] RDMA/core: Fix reported speed and width Date: Tue, 15 Sep 2020 16:12:36 +0200 Message-Id: <20200915140634.107587688@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kamal Heib [ Upstream commit 28b0865714b315e318ac45c4fc9156f3d4649646 ] When the returned speed from __ethtool_get_link_ksettings() is SPEED_UNKNOWN this will lead to reporting a wrong speed and width for providers that uses ib_get_eth_speed(), fix that by defaulting the netdev_speed to SPEED_1000 in case the returned value from __ethtool_get_link_ksettings() is SPEED_UNKNOWN. Fixes: d41861942fc5 ("IB/core: Add generic function to extract IB speed from netdev") Link: https://lore.kernel.org/r/20200902124304.170912-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/core/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index e8432876cc860..e1ecd4682c096 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1711,7 +1711,7 @@ int ib_get_eth_speed(struct ib_device *dev, u8 port_num, u8 *speed, u8 *width) dev_put(netdev); - if (!rc) { + if (!rc && lksettings.base.speed != (u32)SPEED_UNKNOWN) { netdev_speed = lksettings.base.speed; } else { netdev_speed = SPEED_1000; -- 2.25.1