On 2019/2/19 下午7:00, Wei Xu wrote:
On Tue, Feb 19, 2019 at 03:30:41PM +0800, Jason Wang wrote:
On 2019/2/14 下午12:26,w...@redhat.com wrote:
From: Wei Xu<w...@redhat.com>
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,
Well, what you did probably work for virtio-net. But again, virtio-net
is not the only device we want to support.
maybe we can
consider supporting other devices after we have got it verified.
Please don't and fix the issue, packed virtqueue is a generic layout
changes that should work for all kinds of virtio devices. It should be
specially optimized for net, but it doesn't mean it was only designed
for net.
Thanks