vdpa/mlx5: Remove duplicate suspend code
authorDragos Tatulea <dtatulea@nvidia.com>
Wed, 26 Jun 2024 10:26:42 +0000 (13:26 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Jul 2024 12:42:44 +0000 (08:42 -0400)
Use the dedicated suspend_vqs() function instead.

Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20240626-stage-vdpa-vq-precreate-v2-6-560c491078df@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c

index 51630b1935f476d37bf2929c2b535948b9dc4969..eca6f68c2edafd043178b8653da2d557cb332203 100644 (file)
@@ -3355,17 +3355,12 @@ static int mlx5_vdpa_suspend(struct vdpa_device *vdev)
 {
        struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
        struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
-       struct mlx5_vdpa_virtqueue *mvq;
-       int i;
 
        mlx5_vdpa_info(mvdev, "suspending device\n");
 
        down_write(&ndev->reslock);
        unregister_link_notifier(ndev);
-       for (i = 0; i < ndev->cur_num_vqs; i++) {
-               mvq = &ndev->vqs[i];
-               suspend_vq(ndev, mvq);
-       }
+       suspend_vqs(ndev);
        mlx5_vdpa_cvq_suspend(mvdev);
        mvdev->suspended = true;
        up_write(&ndev->reslock);