RDMA/mlx5: Change the key being sent for MPV device affiliation
authorPatrisious Haddad <phaddad@nvidia.com>
Thu, 19 Oct 2023 08:47:05 +0000 (11:47 +0300)
committerLeon Romanovsky <leon@kernel.org>
Tue, 24 Oct 2023 14:10:58 +0000 (17:10 +0300)
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>
Link: https://lore.kernel.org/r/ac7e66357d963fc68d7a419515180212c96d137d.1697705185.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/main.c

index 71597aa6c52a0a4e63729ba7f2350bbcd060521a..ec7c45272764e2c1add9d33731307f62719e63d6 100644 (file)
@@ -3267,7 +3267,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);