]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.7.9/ib-mlx5-fix-50g-per-lane-indication.patch
6.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.7.9 / ib-mlx5-fix-50g-per-lane-indication.patch
CommitLineData
59fa0e4e
SL
1From 66858e95f56b3551e9fff85010a84a9c8717f681 Mon Sep 17 00:00:00 2001
2From: Sasha Levin <sashal@kernel.org>
3Date: Tue, 7 Jul 2020 14:06:11 +0300
4Subject: IB/mlx5: Fix 50G per lane indication
5
6From: Aya Levin <ayal@mellanox.com>
7
8[ Upstream commit 530c8632b547ff72f11ff83654b22462a73f1f7b ]
9
10Some released FW versions mistakenly don't set the capability that 50G per
11lane link-modes are supported for VFs (ptys_extended_ethernet capability
12bit).
13
14Use PTYS.ext_eth_proto_capability instead, as this indication is always
15accurate. If PTYS.ext_eth_proto_capability is valid
16(has a non-zero value) conclude that the HCA supports 50G per lane.
17
18Otherwise, conclude that the HCA doesn't support 50G per lane.
19
20Fixes: 08e8676f1607 ("IB/mlx5: Add support for 50Gbps per lane link modes")
21Link: https://lore.kernel.org/r/20200707110612.882962-3-leon@kernel.org
22Signed-off-by: Aya Levin <ayal@mellanox.com>
23Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
24Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
25Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
26Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
27Signed-off-by: Sasha Levin <sashal@kernel.org>
28---
29 drivers/infiniband/hw/mlx5/main.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
31
32diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
33index 6679756506e60..820e407b3e260 100644
34--- a/drivers/infiniband/hw/mlx5/main.c
35+++ b/drivers/infiniband/hw/mlx5/main.c
36@@ -515,7 +515,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
37 mdev_port_num);
38 if (err)
39 goto out;
40- ext = MLX5_CAP_PCAM_FEATURE(dev->mdev, ptys_extended_ethernet);
41+ ext = !!MLX5_GET_ETH_PROTO(ptys_reg, out, true, eth_proto_capability);
42 eth_prot_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper);
43
44 props->active_width = IB_WIDTH_4X;
45--
462.25.1
47