diff options
author | Eli Cohen <elic@nvidia.com> | 2022-01-05 12:46:41 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-01-15 00:50:54 +0100 |
commit | 37e07e705888e4c3502f204e9c6785c9c2d6d86a (patch) | |
tree | 9c59a89cb41993e7fe57bdc3aa461fdb811cfd50 /drivers/vdpa | |
parent | vdpa: Add support for returning device configuration information (diff) | |
download | linux-37e07e705888e4c3502f204e9c6785c9c2d6d86a.tar.xz linux-37e07e705888e4c3502f204e9c6785c9c2d6d86a.zip |
vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps()
Restore ndev->cur_num_vqs to the original value in case change_num_qps()
fails.
Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support")
Reviewed-by: Si-Wei Liu<si-wei.liu@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20220105114646.577224-10-elic@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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index f31de859d175..931109db1517 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1541,9 +1541,11 @@ static int change_num_qps(struct mlx5_vdpa_dev *mvdev, int newqps) return 0; clean_added: - for (--i; i >= cur_qps; --i) + for (--i; i >= 2 * cur_qps; --i) teardown_vq(ndev, &ndev->vqs[i]); + ndev->cur_num_vqs = 2 * cur_qps; + return err; } |