vdpa/mlx5: should keep avail_index despite device status
authorSi-Wei Liu <si-wei.liu@oracle.com>
Thu, 1 Oct 2020 20:18:31 +0000 (16:18 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 8 Oct 2020 20:02:00 +0000 (16:02 -0400)
commit3176e974a750d6b700a10ffba0ec18d5a884fade
tree64298129035632eac87a9601d6a57ce57915a084
parent7ed9e3d97c32d969caded2dfb6e67c1a2cc5a0b1
vdpa/mlx5: should keep avail_index despite device status

A VM with mlx5 vDPA has below warnings while being reset:

vhost VQ 0 ring restore failed: -1: Resource temporarily unavailable (11)
vhost VQ 1 ring restore failed: -1: Resource temporarily unavailable (11)

We should allow userspace emulating the virtio device be
able to get to vq's avail_index, regardless of vDPA device
status. Save the index that was last seen when virtq was
stopped, so that userspace doesn't complain.

Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Link: https://lore.kernel.org/r/1601583511-15138-1-git-send-email-si-wei.liu@oracle.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eli Cohen <elic@nvidia.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c