diff mbox series

[rdma-next] RDMA/mlx5: Change the key being sent for MPV device affiliation

Message ID ac7e66357d963fc68d7a419515180212c96d137d.1697705185.git.leon@kernel.org (mailing list archive)
State Accepted
Headers show
Series [rdma-next] RDMA/mlx5: Change the key being sent for MPV device affiliation | expand

Commit Message

Leon Romanovsky Oct. 19, 2023, 8:47 a.m. UTC
From: Patrisious Haddad <phaddad@nvidia.com>

Change the key that we send from IB driver to EN driver regarding the
MPV device affiliation, since at that stage the IB device is not yet
initialized, so its index would be zero for different IB devices and
cause wrong associations between unrelated master and slave devices.

Instead use a unique value from inside the core device which is already
initialized at this stage.

Fixes: 0d293714ac32 ("RDMA/mlx5: Send events from IB driver about device affiliation state")
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/hw/mlx5/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leon Romanovsky Oct. 24, 2023, 2:11 p.m. UTC | #1
On Thu, 19 Oct 2023 11:47:05 +0300, Leon Romanovsky wrote:
> Change the key that we send from IB driver to EN driver regarding the
> MPV device affiliation, since at that stage the IB device is not yet
> initialized, so its index would be zero for different IB devices and
> cause wrong associations between unrelated master and slave devices.
> 
> Instead use a unique value from inside the core device which is already
> initialized at this stage.
> 
> [...]

Applied, thanks!

[1/1] RDMA/mlx5: Change the key being sent for MPV device affiliation
      https://git.kernel.org/rdma/rdma/c/02e7d139e5e24a

Best regards,
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 06967366920c..9276811af961 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3298,7 +3298,7 @@  static bool mlx5_ib_bind_slave_port(struct mlx5_ib_dev *ibdev,
 
 	mlx5_ib_init_cong_debugfs(ibdev, port_num);
 
-	key = ibdev->ib_dev.index;
+	key = mpi->mdev->priv.adev_idx;
 	mlx5_core_mp_event_replay(mpi->mdev,
 				  MLX5_DRIVER_EVENT_AFFILIATION_DONE,
 				  &key);