diff options
author | Kamal Heib <kamalheib1@gmail.com> | 2020-09-02 15:43:04 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-17 13:47:43 +0200 |
commit | 0b4662709cedf1b1d044bb63e03f64cd3e33f4ce (patch) | |
tree | 050c54b7d7a8eeca7f121b28eb169f73da37296c /drivers/infiniband/core | |
parent | b3f6c2ca326b14594386610895d4239f284e1f21 (diff) | |
download | linux-stable-0b4662709cedf1b1d044bb63e03f64cd3e33f4ce.tar.gz linux-stable-0b4662709cedf1b1d044bb63e03f64cd3e33f4ce.tar.bz2 linux-stable-0b4662709cedf1b1d044bb63e03f64cd3e33f4ce.zip |
RDMA/core: Fix reported speed and width
[ 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 <kamalheib1@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index d4815f29cfd2..5d896f6b2b61 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1749,7 +1749,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; |