summaryrefslogtreecommitdiffstats
path: root/drivers/vdpa
diff options
context:
space:
mode:
authorDragos Tatulea <dtatulea@nvidia.com>2024-06-26 12:26:41 +0200
committerMichael S. Tsirkin <mst@redhat.com>2024-07-09 14:42:44 +0200
commit34bd86c7202222ee588a33aee993fa29cd181e83 (patch)
tree0027b425337b6a665aff296cd6bd5e75ddbd329f /drivers/vdpa
parentvdpa/mlx5: Drop redundant check in teardown_virtqueues() (diff)
downloadlinux-34bd86c7202222ee588a33aee993fa29cd181e83.tar.xz
linux-34bd86c7202222ee588a33aee993fa29cd181e83.zip
vdpa/mlx5: Iterate over active VQs during suspend/resume
No need to iterate over max number of VQs. Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Acked-by: Eugenio PĂ©rez <eperezma@redhat.com> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com> Message-Id: <20240626-stage-vdpa-vq-precreate-v2-5-560c491078df@nvidia.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vdpa')
-rw-r--r--drivers/vdpa/mlx5/net/mlx5_vnet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 96782b34e2b2..51630b1935f4 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -1504,7 +1504,7 @@ static void suspend_vqs(struct mlx5_vdpa_net *ndev)
{
int i;
- for (i = 0; i < ndev->mvdev.max_vqs; i++)
+ for (i = 0; i < ndev->cur_num_vqs; i++)
suspend_vq(ndev, &ndev->vqs[i]);
}
@@ -1522,7 +1522,7 @@ static void resume_vq(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mv
static void resume_vqs(struct mlx5_vdpa_net *ndev)
{
- for (int i = 0; i < ndev->mvdev.max_vqs; i++)
+ for (int i = 0; i < ndev->cur_num_vqs; i++)
resume_vq(ndev, &ndev->vqs[i]);
}