Skip to content

Commit b196f0a

Browse files
MarkZhang81arighi
authored andcommitted
RDMA/mlx5: Enable multiplane mode only when it is supported
Driver queries vport_cxt.num_plane and enables multiplane when it is greater then 0, but some old FWs (versions from x.40.1000 till x.42.1000), report vport_cxt.num_plane = 1 unexpectedly. Fix it by querying num_plane only when HCA_CAP2.multiplane bit is set. Fixes: 2a5db20 ("RDMA/mlx5: Add support to multi-plane device and port") Link: https://patch.msgid.link/r/1ef901acdf564716fcf550453cf5e94f343777ec.1734610916.git.leon@kernel.org Cc: stable@vger.kernel.org Reported-by: Francesco Poli <invernomuto@paranoici.org> Closes: https://lore.kernel.org/all/nvs4i2v7o6vn6zhmtq4sgazy2hu5kiulukxcntdelggmznnl7h@so3oul6uwgbl/ Signed-off-by: Mark Zhang <markzhang@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> (cherry picked from commit 45d339fefaa3dcd237038769e0d34584fb867390) Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
1 parent e8767dd commit b196f0a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/infiniband/hw/mlx5/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2788,7 +2788,7 @@ static int mlx5_ib_get_plane_num(struct mlx5_core_dev *mdev, u8 *num_plane)
27882788
int err;
27892789

27902790
*num_plane = 0;
2791-
if (!MLX5_CAP_GEN(mdev, ib_virt))
2791+
if (!MLX5_CAP_GEN(mdev, ib_virt) || !MLX5_CAP_GEN_2(mdev, multiplane))
27922792
return 0;
27932793

27942794
err = mlx5_query_hca_vport_context(mdev, 0, 1, 0, &vport_ctx);

include/linux/mlx5/mlx5_ifc.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
19671967
u8 multiplane_qp_ud[0x1];
19681968
u8 reserved_at_cb[0x5];
19691969
u8 migration_in_chunks[0x1];
1970-
u8 reserved_at_d1[0xf];
1970+
u8 reserved_at_d1[0x1];
1971+
u8 sf_eq_usage[0x1];
1972+
u8 reserved_at_d3[0x5];
1973+
u8 multiplane[0x1];
1974+
u8 reserved_at_d9[0x7];
19711975

19721976
u8 reserved_at_e0[0xc0];
19731977

0 commit comments

Comments
 (0)