Skip to contentSkip to conversation

RDMA/core: Fix reported speed and width

PATCH Applied Kamal Heib 2 participants 2 messages Sep 2, 2020 InfiniBand

lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 RDMA/core: Fix reported speed and width

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")
---
 drivers/infiniband/core/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/verbs.c +1 -1
index 3096e73797b7..307886737646 100644
@@ -1801,7 +1801,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;
Signature · 1 line
2.26.2
maintainer Applied
#1 lore raw
Quoted 11 lines · Kamal Heib

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")
---
 drivers/infiniband/core/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason