RDMA/mlx5: Enable multiplane mode only when it is supported
Subsystems (5)
PATCH 1/1 RDMA/mlx5: Enable multiplane mode only when it is supported
From: Mark Zhang <[email protected]>
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.
--- drivers/infiniband/hw/mlx5/main.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/main.c +1 -1
@@ -2839,7 +2839,7 @@ static int mlx5_ib_get_plane_num(struct mlx5_core_dev *mdev, u8 *num_plane)int err; *num_plane =0 ; -if (!MLX5_CAP_GEN (mdev, ib_virt)) +if (!MLX5_CAP_GEN (mdev, ib_virt) || !MLX5_CAP_GEN_2 (mdev, multiplane))return 0 ; err =mlx5_query_hca_vport_context (mdev,0 ,1 ,0 , &vport_ctx);
include/linux/mlx5/mlx5_ifc.h +3 -1
@@ -2119,7 +2119,9 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {u8 migration_in_chunks[0x1 ];u8 reserved_at_d1[0x1 ];u8 sf_eq_usage[0x1 ]; -u8 reserved_at_d3[0xd ]; +u8 reserved_at_d3[0x5 ]; +u8 multiplane[0x1 ]; +u8 reserved_at_d9[0x7 ];u8 cross_vhca_object_to_object_supported[0x20 ];
Signature · 1 line
2.47.0
Quoted 37 lines · Leon Romanovsky
From: Mark Zhang <[email protected]>
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_planeonly when HCA_CAP2.multiplane bit is set.Fixes 2a5db20fa532 ("RDMA/mlx5: Add support to multi-plane device and port")Reported-by Francesco Poli <[email protected]>Closes https://lore.kernel.org/all/nvs4i2v7o6vn6zhmtq4sgazy2hu5kiulukxcntdelggmznnl7h@so3oul6uwgbl/ open hereSigned-off-by Mark Zhang <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>--- drivers/infiniband/hw/mlx5/main.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)drivers/infiniband/hw/mlx5/main.c +1
-1@@ -2839,7 +2839,7 @@ static int mlx5_ib_get_plane_num(struct mlx5_core_dev *mdev, u8 *num_plane)int err; *num_plane =0 ; -if (!MLX5_CAP_GEN (mdev, ib_virt)) +if (!MLX5_CAP_GEN (mdev, ib_virt) || !MLX5_CAP_GEN_2 (mdev, multiplane))return 0 ; err =mlx5_query_hca_vport_context (mdev,0 ,1 ,0 , &vport_ctx);include/linux/mlx5/mlx5_ifc.h +0
-0
include/linux/mlx5/mlx5_ifc.h struct mlx5_ifc_cmd_hca_cap_2_bits { · line 2126
Quoted 9 lines
include/linux/mlx5/mlx5_ifc.h +3
-1@@ -2119,7 +2119,9 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {u8 migration_in_chunks[0x1 ];u8 reserved_at_d1[0x1 ];u8 sf_eq_usage[0x1 ]; -u8 reserved_at_d3[0xd ]; +u8 reserved_at_d3[0x5 ]; +u8 multiplane[0x1 ]; +u8 reserved_at_d9[0x7 ];u8 cross_vhca_object_to_object_supported[0x20 ];
Just out of curiosity, don't you have mlx5-net or sth like that for fixes?
Quoted 3 lines
Signature · 2 lines
-- 2.47.0
Quoted 46 lines · Michal Swiatkowski
Quoted 45 lines · Leon Romanovsky
From: Mark Zhang <[email protected]>
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_planeonly when HCA_CAP2.multiplane bit is set.Fixes 2a5db20fa532 ("RDMA/mlx5: Add support to multi-plane device and port")Reported-by Francesco Poli <[email protected]>Closes https://lore.kernel.org/all/nvs4i2v7o6vn6zhmtq4sgazy2hu5kiulukxcntdelggmznnl7h@so3oul6uwgbl/ open hereSigned-off-by Mark Zhang <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>--- drivers/infiniband/hw/mlx5/main.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)drivers/infiniband/hw/mlx5/main.c +1
-1@@ -2839,7 +2839,7 @@ static int mlx5_ib_get_plane_num(struct mlx5_core_dev *mdev, u8 *num_plane)int err; *num_plane =0 ; -if (!MLX5_CAP_GEN (mdev, ib_virt)) +if (!MLX5_CAP_GEN (mdev, ib_virt) || !MLX5_CAP_GEN_2 (mdev, multiplane))return 0 ; err =mlx5_query_hca_vport_context (mdev,0 ,1 ,0 , &vport_ctx);include/linux/mlx5/mlx5_ifc.h +3
-1@@ -2119,7 +2119,9 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {u8 migration_in_chunks[0x1 ];u8 reserved_at_d1[0x1 ];u8 sf_eq_usage[0x1 ]; -u8 reserved_at_d3[0xd ]; +u8 reserved_at_d3[0x5 ]; +u8 multiplane[0x1 ]; +u8 reserved_at_d9[0x7 ];
Quoted 6 lines
include/linux/mlx5/mlx5_ifc.h struct mlx5_ifc_cmd_hca_cap_2_bits { · line 2126
Quoted 1 line
include/linux/mlx5/mlx5_ifc.h +0
-0u8 cross_vhca_object_to_object_supported[0x20 ];Reviewed-by Michal Swiatkowski <[email protected]>Just out of curiosity, don't you have mlx5-net or sth like that for fixes?
No, we don't have such as it is so rare situation that we have fix for shared branch. I wrote here mlx5-next target because this patch changes the shared mlx5_ifc.h file and for the visibility, but it doesn't affect mlx5 eth devices.
Most likely, we will end taking this patch directly to rdma-rc and sending as part of usual PR to Linus.
Thanks
Quoted 4 lines
Quoted 4 lines
Signature · 2 lines
-- 2.47.0
Quoted 15 lines · Leon Romanovsky
From: Mark Zhang <[email protected]>
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_planeonly when HCA_CAP2.multiplane bit is set.Fixes 2a5db20fa532 ("RDMA/mlx5: Add support to multi-plane device and port")Reported-by Francesco Poli <[email protected]>Closes https://lore.kernel.org/all/nvs4i2v7o6vn6zhmtq4sgazy2hu5kiulukxcntdelggmznnl7h@so3oul6uwgbl/ open hereSigned-off-by Mark Zhang <[email protected]>Signed-off-by Leon Romanovsky <[email protected]>Reviewed-by Michal Swiatkowski <[email protected]>
Quoted 4 lines
--- drivers/infiniband/hw/mlx5/main.c | 2 +- include/linux/mlx5/mlx5_ifc.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
Applied to for-rc thanks
Jason