Set ib_device::adversarial_mode during capability init from mlx5_is_adversarial(), so that every mlx5 device in a CC guest runs in adversarial mode. The core then keeps the kernel ULPs off the device. The mlx5_ib checks for adversarial mode, added by the next patches, read this per-device field. Signed-off-by: Yishai Hadas --- drivers/infiniband/hw/mlx5/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 65455aedd559..69e11c06bd9c 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -4770,6 +4770,7 @@ static int mlx5_ib_stage_caps_init(struct mlx5_ib_dev *dev) } dev->ib_dev.use_cq_dim = true; + dev->ib_dev.adversarial_mode = mlx5_is_adversarial(dev->mdev); return 0; -- 2.18.1