Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp27734pxk; Tue, 15 Sep 2020 16:48:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9fZgXIheShaEaCOMqdciHfqmkDuCy1IJ11rDSGdjZC6Es/7DYoxP5PV4TMkCqoM7u8LNd X-Received: by 2002:a50:f69a:: with SMTP id d26mr24259304edn.21.1600213723229; Tue, 15 Sep 2020 16:48:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600213723; cv=none; d=google.com; s=arc-20160816; b=VTb+YkbvqS59I8yYez7Slvzm42WwooQqEq7Rg3aqRu2EGM11mBSnyOaqNFk1Eg7tD/ /iwDctBl4Mh7pYXlw/TO8fM+Td3QKw5lql2Csdv/yehBCC+PXOevE8zJQbVyBNYS1YAr qLmasj+jh+9gYmy7k1VIxFo4aDsaxm2Cl/P7GkMtdz5wJASx8J6kjIWDFWng3jxBa7td Njr7EPZwgqELbW1VD9hJ8dF0XXNaxEhgWuaVhEqGeaEQiRFGej0C3EeiOyG+sZtZROyW 1tUmbUwbo4SG3u6HCJaQz+jayi2Iwpc1HjMAjXr+zvtJ9daZG3NMTLpQR4+N1ErCEr+S 6zrA== 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=6RhZBjSY32PxX6X/SsR5OAYp90P7U/0uJhrkhXJ0CiE=; b=j+m0WbQOzB41/ux9t2v4P8xFpWf6qU4uz5YRYfCdSs/Vy69vits43ygONHcHY9S1a0 V81s0KmwKP9Beb7QeaeI68BnhRPvcBQt53/scXjPtzOi1Y74arh7PIMXeOr5mD7nsIEc IT9n8oxt6uxDPPOTTTFiGbUokCXOxP+B09Mma8MAQxae0vDdm1S0GXtugT5tcN438u4r EJupozDvKe+JPzTZPNK6KfhDWgcpswjdkvWtKNTqxHFIxI6mropr/x1G5ojF3ZYnEHc5 84zp7ZC2VMYIem9CCuKfqPVRXC60/+ovCQo3OFplxfkLGmAJXnUOCzSNxROF7gIjjXH1 G8nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ma1vjAr7; 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 e26si11078312edc.216.2020.09.15.16.48.21; Tue, 15 Sep 2020 16:48:43 -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=ma1vjAr7; 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 S1727463AbgIOXpt (ORCPT + 99 others); Tue, 15 Sep 2020 19:45:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:43890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbgIOOdX (ORCPT ); Tue, 15 Sep 2020 10:33:23 -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 D611323BEE; Tue, 15 Sep 2020 14:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179903; bh=rncgLFQieqc1c+0KLanBYlWKY6fYFuJQywdujbj/i90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ma1vjAr7tOx2/ooYlCbI/5Hc6OTh2clZr03HjRrwZ6sxWyOc2a6Oqts6sKcZpLfOR uN+dGOZAvnpzXmjtVaMf41xbLLzZHFFuDBmceU3HFprdYvFYCLVW+X6oFlO7H1yCMo FEOPOzWpNgpe1pT8HfG5kAYP6h4s46te+Jfau6z4= 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 5.8 031/177] RDMA/core: Fix reported speed and width Date: Tue, 15 Sep 2020 16:11:42 +0200 Message-Id: <20200915140655.131837751@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140653.610388773@linuxfoundation.org> References: <20200915140653.610388773@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 f369f0a19e851..1b0ea945756f0 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1803,7 +1803,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