Commit 8e0751af authored by Dragos Tatulea's avatar Dragos Tatulea Committed by Michael S. Tsirkin
Browse files

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: default avatarCosmin Ratiu <cratiu@nvidia.com>
Acked-by: default avatarEugenio Pérez <eperezma@redhat.com>
Signed-off-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20240626-stage-vdpa-vq-precreate-v2-24-560c491078df@nvidia.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 2638134f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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.