qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] libvhost-user: Start VQs on SET_VRING_CALL
@ 2017-01-13  1:14 Felipe Franciosi
  2017-01-13 15:03 ` Marc-André Lureau
  2017-01-16 18:22 ` Michael S. Tsirkin
  0 siblings, 2 replies; 14+ messages in thread
From: Felipe Franciosi @ 2017-01-13  1:14 UTC (permalink / raw)
  To: Michael S. Tsirkin, Paolo Bonzini, Stefan Hajnoczi,
	Marc-Andre Lureau
  Cc: qemu-devel@nongnu.org, Peter Maydell, Eric Blake,
	Markus Armbruster, Daniel P. Berrange, Felipe Franciosi

Currently, VQs are started as soon as a SET_VRING_KICK is received. That
is too early in the VQ setup process, as the backend might not yet have
a callfd to notify in case it received a kick and fully processed the
request/command. This patch only starts a VQ when a SET_VRING_CALL is
received.

Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
---
 contrib/libvhost-user/libvhost-user.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index af4faad..a46ef90 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -607,19 +607,6 @@ vu_set_vring_kick_exec(VuDev *dev, VhostUserMsg *vmsg)
         DPRINT("Got kick_fd: %d for vq: %d\n", vmsg->fds[0], index);
     }
 
-    dev->vq[index].started = true;
-    if (dev->iface->queue_set_started) {
-        dev->iface->queue_set_started(dev, index, true);
-    }
-
-    if (dev->vq[index].kick_fd != -1 && dev->vq[index].handler) {
-        dev->set_watch(dev, dev->vq[index].kick_fd, VU_WATCH_IN,
-                       vu_kick_cb, (void *)(long)index);
-
-        DPRINT("Waiting for kicks on fd: %d for vq: %d\n",
-               dev->vq[index].kick_fd, index);
-    }
-
     return false;
 }
 
@@ -661,6 +648,19 @@ vu_set_vring_call_exec(VuDev *dev, VhostUserMsg *vmsg)
 
     DPRINT("Got call_fd: %d for vq: %d\n", vmsg->fds[0], index);
 
+    dev->vq[index].started = true;
+    if (dev->iface->queue_set_started) {
+        dev->iface->queue_set_started(dev, index, true);
+    }
+
+    if (dev->vq[index].kick_fd != -1 && dev->vq[index].handler) {
+        dev->set_watch(dev, dev->vq[index].kick_fd, VU_WATCH_IN,
+                       vu_kick_cb, (void *)(long)index);
+
+        DPRINT("Waiting for kicks on fd: %d for vq: %d\n",
+               dev->vq[index].kick_fd, index);
+    }
+
     return false;
 }
 
-- 
1.9.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-01-19 10:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-13  1:14 [Qemu-devel] [PATCH] libvhost-user: Start VQs on SET_VRING_CALL Felipe Franciosi
2017-01-13 15:03 ` Marc-André Lureau
2017-01-13 15:09   ` Felipe Franciosi
2017-01-13 17:04     ` Michael S. Tsirkin
2017-01-13 17:15       ` Felipe Franciosi
2017-01-13 18:18         ` Michael S. Tsirkin
2017-01-13 22:29           ` Felipe Franciosi
2017-01-17 18:41             ` Michael S. Tsirkin
2017-01-17 18:53               ` Felipe Franciosi
2017-01-17 19:00                 ` Michael S. Tsirkin
2017-01-19 10:26                   ` Paolo Bonzini
2017-01-16 18:22 ` Michael S. Tsirkin
2017-01-16 18:27   ` Felipe Franciosi
2017-01-17 18:43     ` Michael S. Tsirkin

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).