[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 10/11] virtio: migration support for packed r

From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH v4 10/11] virtio: migration support for packed ring
Date: Tue, 19 Feb 2019 21:12:05 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

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,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 -

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]