RDMA/mlx5: Don't create IB representors when in multiport RoCE mode
authorMark Bloch <markb@mellanox.com>
Thu, 28 Mar 2019 13:46:27 +0000 (15:46 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 22 Apr 2019 18:24:05 +0000 (15:24 -0300)
Switchdev mode and mutiport RoCE mode aren't compatible at this point.
Don't create IB reps when a user switches to switchdev mode and the driver
operates in that mode.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c

index 795db12..d40c394 100644 (file)
@@ -6630,7 +6630,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
 
        if (MLX5_ESWITCH_MANAGER(mdev) &&
            mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
-               mlx5_ib_register_vport_reps(mdev);
+               if (!mlx5_core_mp_enabled(mdev))
+                       mlx5_ib_register_vport_reps(mdev);
                return mdev;
        }