qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Thibaut Collet" <thibaut.collet@6wind.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Victor Kaplansky" <victork@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH for-2.5 1/1] vhost-user: do not send SET_VRING_ENABLE at start
Date: Wed, 25 Nov 2015 09:32:15 +0800	[thread overview]
Message-ID: <20151125013215.GK2325@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <20151124232037-mutt-send-email-mst@redhat.com>

On Tue, Nov 24, 2015 at 11:23:34PM +0200, Michael S. Tsirkin wrote:
> On Tue, Nov 24, 2015 at 10:05:27PM +0100, Thibaut Collet wrote:
> > On Tue, Nov 24, 2015 at 9:52 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > On Tue, Nov 24, 2015 at 05:10:36PM +0100, Thibaut Collet wrote:
> > >> This patch reverts partially commit 3a12f32229a.
> > >>
> > >> In case of live migration several queues can be enabled and not only the first
> > >> one. So inform backend that only the first queue is enabled is wrong.
> > >>
> > >> Since commit 7263a0ad7899 backend is already notified of the state of the vring
> > >> through the vring attach operation. This function, called during the startup
> > >> sequence, provides the correct state of the vring, even in case of live
> > >> migration.
> > >>
> > >> So nothing has to be added to give the vring state to the backend at the startup.
> > >>
> > >> Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
> > >> ---
> > >>  hw/virtio/vhost.c | 5 -----
> > >>  1 file changed, 5 deletions(-)
> > >>
> > >> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> > >> index 1794f0d..870cd12 100644
> > >> --- a/hw/virtio/vhost.c
> > >> +++ b/hw/virtio/vhost.c
> > >> @@ -1226,11 +1226,6 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
> > >>          }
> > >>      }
> > >>
> > >> -    if (hdev->vhost_ops->vhost_set_vring_enable) {
> > >> -        /* only enable first vq pair by default */
> > >> -        hdev->vhost_ops->vhost_set_vring_enable(hdev, hdev->vq_index == 0);
> > >> -    }
> > >> -
> > >>      return 0;
> > >>  fail_log:
> > >>      vhost_log_put(hdev, false);
> > >> --
> > >> 2.1.4
> > >
> > > Yes - and I'm beginning to think that maybe we should revert
> > > all of 3a12f32229a then, for symmetry.
> > >
> > 
> > Keep the disable vring on the stop can be useful. For example if the
> > VM is rebooted all the vring will be disabled and backend will avoid
> > to send packet to the VM in this case (I am not sure the virtio ring
> > address is always valid during a reboot and writingg data in this
> > memory can cause unexpected behaviour in this case).
> 
> I think there's still some confusion:
> writing memory can still happen even if you disable the ring
> since the TX ring is still processed so we write into the used ring.
> 
> We call GET_VRING_BASE on stop and that ensures rings are
> stopped.

Yes, that's what I suggested first, which also makes the logic quite
simple: we use GET_VRING_BASE as the sign of vring stop. Intead of
GET_VRING_BASE when protocol not negotiated, and SET_VRING_ENABLE
when protocol is negotiated.

Michael, should I submit a revert patch, or you could do it directly?

	--yliu
> 
> 
> > > Yunnan, Victor - what do you think?
> > >
> > > --
> > > MST

  reply	other threads:[~2015-11-25  1:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 16:10 [Qemu-devel] [PATCH for-2.5 0/1] vhost-user: live migration with multiqueue fails Thibaut Collet
2015-11-24 16:10 ` [Qemu-devel] [PATCH for-2.5 1/1] vhost-user: do not send SET_VRING_ENABLE at start Thibaut Collet
2015-11-24 20:52   ` Michael S. Tsirkin
2015-11-24 21:05     ` Thibaut Collet
2015-11-24 21:23       ` Michael S. Tsirkin
2015-11-25  1:32         ` Yuanhan Liu [this message]
2015-11-25 11:04           ` Michael S. Tsirkin
2015-11-25 12:17             ` Thibaut Collet
2015-11-25 12:23               ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151125013215.GK2325@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=jasowang@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thibaut.collet@6wind.com \
    --cc=victork@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).