* [PATCH mlx5-next] RDMA/mlx5: Enable multiplane mode only when it is supported
@ 2024-12-19 12:23 Leon Romanovsky
2024-12-19 13:23 ` Michal Swiatkowski
2025-01-03 14:11 ` Jason Gunthorpe
0 siblings, 2 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-12-19 12:23 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Mark Zhang, Francesco Poli, linux-rdma, netdev, Saeed Mahameed,
Tariq Toukan
From: Mark Zhang <markzhang@nvidia.com>
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: 2a5db20fa532 ("RDMA/mlx5: Add support to multi-plane device and port")
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>
---
drivers/infiniband/hw/mlx5/main.c | 2 +-
include/linux/mlx5/mlx5_ifc.h | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index c2314797afc9..f5b59d02f4d3 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -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);
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 4fbbcf35498b..48d47181c7cd 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -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];
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mlx5-next] RDMA/mlx5: Enable multiplane mode only when it is supported
2024-12-19 12:23 [PATCH mlx5-next] RDMA/mlx5: Enable multiplane mode only when it is supported Leon Romanovsky
@ 2024-12-19 13:23 ` Michal Swiatkowski
2024-12-19 14:01 ` Leon Romanovsky
2025-01-03 14:11 ` Jason Gunthorpe
1 sibling, 1 reply; 4+ messages in thread
From: Michal Swiatkowski @ 2024-12-19 13:23 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Jason Gunthorpe, Mark Zhang, Francesco Poli, linux-rdma, netdev,
Saeed Mahameed, Tariq Toukan
On Thu, Dec 19, 2024 at 02:23:36PM +0200, Leon Romanovsky wrote:
> From: Mark Zhang <markzhang@nvidia.com>
>
> 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: 2a5db20fa532 ("RDMA/mlx5: Add support to multi-plane device and port")
> 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>
> ---
> drivers/infiniband/hw/mlx5/main.c | 2 +-
> include/linux/mlx5/mlx5_ifc.h | 4 +++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index c2314797afc9..f5b59d02f4d3 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -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);
> diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
> index 4fbbcf35498b..48d47181c7cd 100644
> --- a/include/linux/mlx5/mlx5_ifc.h
> +++ b/include/linux/mlx5/mlx5_ifc.h
> @@ -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];
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Just out of curiosity, don't you have mlx5-net or sth like that for
fixes?
>
> --
> 2.47.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mlx5-next] RDMA/mlx5: Enable multiplane mode only when it is supported
2024-12-19 13:23 ` Michal Swiatkowski
@ 2024-12-19 14:01 ` Leon Romanovsky
0 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-12-19 14:01 UTC (permalink / raw)
To: Michal Swiatkowski
Cc: Jason Gunthorpe, Mark Zhang, Francesco Poli, linux-rdma, netdev,
Saeed Mahameed, Tariq Toukan
On Thu, Dec 19, 2024 at 02:23:04PM +0100, Michal Swiatkowski wrote:
> On Thu, Dec 19, 2024 at 02:23:36PM +0200, Leon Romanovsky wrote:
> > From: Mark Zhang <markzhang@nvidia.com>
> >
> > 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: 2a5db20fa532 ("RDMA/mlx5: Add support to multi-plane device and port")
> > 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>
> > ---
> > drivers/infiniband/hw/mlx5/main.c | 2 +-
> > include/linux/mlx5/mlx5_ifc.h | 4 +++-
> > 2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > index c2314797afc9..f5b59d02f4d3 100644
> > --- a/drivers/infiniband/hw/mlx5/main.c
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -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);
> > diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
> > index 4fbbcf35498b..48d47181c7cd 100644
> > --- a/include/linux/mlx5/mlx5_ifc.h
> > +++ b/include/linux/mlx5/mlx5_ifc.h
> > @@ -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];
>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
>
> 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
>
> >
> > --
> > 2.47.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mlx5-next] RDMA/mlx5: Enable multiplane mode only when it is supported
2024-12-19 12:23 [PATCH mlx5-next] RDMA/mlx5: Enable multiplane mode only when it is supported Leon Romanovsky
2024-12-19 13:23 ` Michal Swiatkowski
@ 2025-01-03 14:11 ` Jason Gunthorpe
1 sibling, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2025-01-03 14:11 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Mark Zhang, Francesco Poli, linux-rdma, netdev, Saeed Mahameed,
Tariq Toukan
On Thu, Dec 19, 2024 at 02:23:36PM +0200, Leon Romanovsky wrote:
> From: Mark Zhang <markzhang@nvidia.com>
>
> 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: 2a5db20fa532 ("RDMA/mlx5: Add support to multi-plane device and port")
> 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>
> ---
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-03 14:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19 12:23 [PATCH mlx5-next] RDMA/mlx5: Enable multiplane mode only when it is supported Leon Romanovsky
2024-12-19 13:23 ` Michal Swiatkowski
2024-12-19 14:01 ` Leon Romanovsky
2025-01-03 14:11 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).