Skip to content

Commit ca60fd1

Browse files
kaleshap86rleon
authored andcommitted
IB/core: Add more speed parsing in ib_get_width_and_speed()
When the Ethernet driver does not provide the number of lanes in the __ethtool_get_link_ksettings() response, the function ib_get_width_and_speed() does not take consideration of 50G, 100G and 200G speeds while calculating the IB width and speed. Update the width and speed for the above netdev speeds. Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Link: https://lore.kernel.org/r/1690966823-8159-1-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 40cc695 commit ca60fd1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

drivers/infiniband/core/verbs.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1899,9 +1899,18 @@ static void ib_get_width_and_speed(u32 netdev_speed, u32 lanes,
18991899
} else if (netdev_speed <= SPEED_40000) {
19001900
*width = IB_WIDTH_4X;
19011901
*speed = IB_SPEED_FDR10;
1902-
} else {
1902+
} else if (netdev_speed <= SPEED_50000) {
1903+
*width = IB_WIDTH_2X;
1904+
*speed = IB_SPEED_EDR;
1905+
} else if (netdev_speed <= SPEED_100000) {
19031906
*width = IB_WIDTH_4X;
19041907
*speed = IB_SPEED_EDR;
1908+
} else if (netdev_speed <= SPEED_200000) {
1909+
*width = IB_WIDTH_4X;
1910+
*speed = IB_SPEED_HDR;
1911+
} else {
1912+
*width = IB_WIDTH_4X;
1913+
*speed = IB_SPEED_NDR;
19051914
}
19061915

19071916
return;

0 commit comments

Comments
 (0)