On Tue, Feb 19, 2019 at 03:30:41PM +0800, Jason Wang wrote:
On 2019/2/14 下午12:26,address@hidden wrote:
From: Wei Xu<address@hidden>
Both userspace and vhost-net/user are supported with this patch.
A new subsection is introduced for packed ring, only 'last_avail_idx'
and 'last_avail_wrap_counter' are saved/loaded presumably based on
all the others relevant data(inuse, used/avail index and wrap count
should be the same.
This is probably only true for net device, see comment in virtio_load():
/*
* Some devices migrate VirtQueueElements that have been popped
* from the avail ring but not yet returned to the used ring.
* Since max ring size < UINT16_MAX it's safe to use modulo
* UINT16_MAX + 1 subtraction.
*/
vdev->vq[i].inuse = (uint16_t)(vdev->vq[i].last_avail_idx -
vdev->vq[i].used_idx);
So you need to migrate used_idx and used_wrap_counter since we don't have
used idx.
This is trying to align with vhost-net/user as we discussed, since all we
have done is to support virtio-net device for packed ring,