From: Dragos Tatulea Date: Wed, 26 Jun 2024 10:27:00 +0000 (+0300) Subject: vdpa/mlx5: Don't enable non-active VQs in .set_vq_ready() X-Git-Tag: v6.11-rc1~110^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e0751af1b1162342904dcb0410e8a8ef9cbf70b;p=thirdparty%2Fkernel%2Flinux.git vdpa/mlx5: Don't enable non-active VQs in .set_vq_ready() VQ indices in the range [cur_num_qps, max_vqs) represent queues that have not yet been activated. .set_vq_ready should not activate these VQs. Reviewed-by: Cosmin Ratiu Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20240626-stage-vdpa-vq-precreate-v2-24-560c491078df@nvidia.com> Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 573dc01df8c33..fa78e8288ebbf 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1575,6 +1575,9 @@ static int resume_vq(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mvq if (!mvq->initialized) return 0; + if (mvq->index >= ndev->cur_num_vqs) + return 0; + switch (mvq->fw_state) { case MLX5_VIRTIO_NET_Q_OBJECT_STATE_INIT: /* Due to a FW quirk we need to modify the VQ fields first then change state.