aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2018-03-05 13:09:47 -0500
committerJason Gunthorpe <jgg@mellanox.com>2018-03-06 22:08:38 -0500
commit210b1f78076f88cad25b333fffafbac6ae870fcc (patch)
treeb9369b5c1485f04320159585aadf68734a304dbc /drivers
parenta18177925c252da7801149abe217c05b80884798 (diff)
IB/mlx5: When not in dual port RoCE mode, use provided port as native
The series that introduced dual port RoCE mode assumed that we don't have a dual port HCA that use the mlx5 driver, this is not the case for Connect-IB HCAs. This reasoning led to assigning 1 as the native port index which causes issue when the second port is used. For example query_pkey() when called on the second port will return values of the first port. Make sure that we assign the right port index as the native port index. Fixes: 32f69e4be269 ("{net, IB}/mlx5: Manage port association for multiport RoCE") Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx5/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index bab38c6647d7..033b6af90de9 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -245,12 +245,16 @@ struct mlx5_core_dev *mlx5_ib_get_native_port_mdev(struct mlx5_ib_dev *ibdev,
245 struct mlx5_ib_multiport_info *mpi; 245 struct mlx5_ib_multiport_info *mpi;
246 struct mlx5_ib_port *port; 246 struct mlx5_ib_port *port;
247 247
248 if (!mlx5_core_mp_enabled(ibdev->mdev) ||
249 ll != IB_LINK_LAYER_ETHERNET) {
250 if (native_port_num)
251 *native_port_num = ib_port_num;
252 return ibdev->mdev;
253 }
254
248 if (native_port_num) 255 if (native_port_num)
249 *native_port_num = 1; 256 *native_port_num = 1;
250 257
251 if (!mlx5_core_mp_enabled(ibdev->mdev) || ll != IB_LINK_LAYER_ETHERNET)
252 return ibdev->mdev;
253
254 port = &ibdev->port[ib_port_num - 1]; 258 port = &ibdev->port[ib_port_num - 1];
255 if (!port) 259 if (!port)
256 return NULL; 260 return NULL;