diff options
author | Kalesh AP <kalesh-anakkur.purayil@broadcom.com> | 2023-08-02 02:00:23 -0700 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-08-13 10:41:57 +0300 |
commit | ca60fd116c7ee1a4471a8ad0fe07cdfa57f24c11 (patch) | |
tree | 7ff84a49704f8ba9deaef31b90a52dd309812709 /drivers/infiniband | |
parent | 40cc695d63352137c832170b125293ef043d4db7 (diff) | |
download | linux-stable-ca60fd116c7ee1a4471a8ad0fe07cdfa57f24c11.tar.gz linux-stable-ca60fd116c7ee1a4471a8ad0fe07cdfa57f24c11.tar.bz2 linux-stable-ca60fd116c7ee1a4471a8ad0fe07cdfa57f24c11.zip |
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 25367bd6dd97..41ff5595c860 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1899,9 +1899,18 @@ static void ib_get_width_and_speed(u32 netdev_speed, u32 lanes, } else if (netdev_speed <= SPEED_40000) { *width = IB_WIDTH_4X; *speed = IB_SPEED_FDR10; - } else { + } else if (netdev_speed <= SPEED_50000) { + *width = IB_WIDTH_2X; + *speed = IB_SPEED_EDR; + } else if (netdev_speed <= SPEED_100000) { *width = IB_WIDTH_4X; *speed = IB_SPEED_EDR; + } else if (netdev_speed <= SPEED_200000) { + *width = IB_WIDTH_4X; + *speed = IB_SPEED_HDR; + } else { + *width = IB_WIDTH_4X; + *speed = IB_SPEED_NDR; } return; |