RDMA/core: Fix reported speed and width
authorKamal Heib <kamalheib1@gmail.com>
Wed, 2 Sep 2020 12:43:04 +0000 (15:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 08:46:25 +0000 (10:46 +0200)
commit7c13561c749fed918babaa3a1d3373137d25e264
tree6c822a2a4d2e2f33ff49a285f360b71de59690d8
parentd0e73696ab4932be094dbd3cfff2f9122d639d8c
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>
drivers/infiniband/core/verbs.c