Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3285614pxk; Mon, 21 Sep 2020 09:42:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx//hY/WtaISLn9XFvaQt4/pyu/kmNA54BBaf9mKWKZEqtXiK/aJ72oPREP5QWHqF0XiI8w X-Received: by 2002:a17:906:68d2:: with SMTP id y18mr290464ejr.197.1600706520070; Mon, 21 Sep 2020 09:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706520; cv=none; d=google.com; s=arc-20160816; b=zrxM9QijJh7YGU2ShPg2a2x0dJgr9Fvcg0OaZXGTtgM/n2UoxiIIRGFPsgmb9xEmKV 9NTrcjsdL7pbWFpe9pTdDcF28jF+QI493UJp/WG45YHpNiEIvEK3QBZbY47/QToFhFHu vetGjPt7fwkM4OElXCca1cdTWCAOtiUUH/XOMlgkmOanT8DamBy4lCoU5G66U/mnd0D1 zEViOWu2n4MejgRH5B2JCQnEVi+J8OOGtfB48l64MwobAsj42EBm0UjIG0dehOQBXBmH 63sD3stWE4ozQkjYkzV+Zkw2B1qcuiisNWh5uZlEXlzh3+6MYmQ8JRXfZk42j0RwyJa3 OOlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AFrNYVGPusosqiebG4roN5ASZmynOo5wMDcq+8E2y4k=; b=Yj6CzOZAgei4e8EUL7g+IfUdlNGUTlnzBUp8j5KBIpZkCQuDba5iAjLQNZv6YRNvVO LdA9p0DP6kavwVc9QDteD6zYgG3ZJSdRl9wDOZD+bvA6nYLGemueijtmJMvnqoQYpFxq gx3Hk7v8by6RqS6akd9Jg/w+lo7zEHY5389jBQiJVmnI5UWmObY0ZlbMcEm8gwfnTXkA wnJeWI0BoFIqB7e9jP5w0uHUwou65wHSM3gnWmHb8MDVBYgSX+C4LZa2fLJ7eoeWEgq9 arqCgNhfN3kAamSq5txI1OCRTWTvSk5lFEkkk69zUxjla5vu6MfQ1AZJhW6t6ay3eraz v9PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c968Hcvf; 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 k14si8636455edr.96.2020.09.21.09.41.36; Mon, 21 Sep 2020 09:42: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=c968Hcvf; 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 S1729089AbgIUQhi (ORCPT + 99 others); Mon, 21 Sep 2020 12:37:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:37794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729057AbgIUQhY (ORCPT ); Mon, 21 Sep 2020 12:37:24 -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 43AE8206B7; Mon, 21 Sep 2020 16:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706243; bh=dbtyDDVHXZtymxgQ5+N4nFv7OzfwV5PgGvsXitx31ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c968Hcvf7NhjlDW4kDaLjm1F38v1t2UFx3i0p1uTNuTI1jByU89RpUM13LaDekdFS OBKWNbwR5mhORUyBHumE+kd2I1CECA9zi4lnCfxTJaO+VrPI/jXvMvceWPw/7binBw lM1ZPx95471F356VAtVkvKhna6MrLuRaNSBvu7sw= 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.14 05/94] RDMA/core: Fix reported speed and width Date: Mon, 21 Sep 2020 18:26:52 +0200 Message-Id: <20200921162035.785501491@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 d21c86dd27d86..01f02b3cb835e 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1343,7 +1343,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