Message ID | CABUUfwNtq988Qcvwyhaj=xD6OGp9uJqADR_i4oq0LFNe2iJE5g@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Fri, Oct 09, 2015 at 08:40:27AM +0200, Thibaut Collet wrote: > Hi Michael, > > this patch is not correct. If we apply QEMU enters in a dead lock if > we have several queue pairs for virttio/vhost and vhost backend > crashes during the initialisation sequence > I have sent some comments yesterday to Marc to correct theses issues. > The attached fixup solves the issues (already sent to Marc Andre on > QEMU mailing list): > - The two first corrections solve the vhost backend crashes (the > message id used for some messages are the kernel IOCTL and not the > VHOST_USER id) > - the third patchs solves the QEMU dead lock in case of multiqueue > (VHOST_USER_GET_QUEUE_NUM is a one time message. This message is sent > through the new vhost_user_get_u64 function but except for the first > queue a blocking read is sent whereas no write has been sent before > that causes the lock) > > If you (and Marc Andre) agree this correction could you update this > patch with the fixup and resend the pull request ? > > Thanks > > Best regards. > > Thibaut. I dropped this and dependent patches from the tree for now. Thanks!
From effefe37d6ffa929657d788873311e026a5c0c80 Mon Sep 17 00:00:00 2001 From: Thibaut Collet <thibaut.collet@6wind.com> Date: Wed, 7 Oct 2015 17:41:42 +0200 Subject: [PATCH] FIXUP for vhost: use a function for each call Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com> --- hw/virtio/vhost-user.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index bbf5eeb..8b4ea0f 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -315,13 +315,13 @@ static int vhost_set_vring(struct vhost_dev *dev, static int vhost_user_set_vring_num(struct vhost_dev *dev, struct vhost_vring_state *ring) { - return vhost_set_vring(dev, VHOST_SET_VRING_NUM, ring); + return vhost_set_vring(dev, VHOST_USER_SET_VRING_NUM, ring); } static int vhost_user_set_vring_base(struct vhost_dev *dev, struct vhost_vring_state *ring) { - return vhost_set_vring(dev, VHOST_SET_VRING_BASE, ring); + return vhost_set_vring(dev, VHOST_USER_SET_VRING_BASE, ring); } static int vhost_user_set_vring_enable(struct vhost_dev *dev, int enable) @@ -440,6 +440,10 @@ static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t *u64) .flags = VHOST_USER_VERSION, }; + if (vhost_user_one_time_request(request) && dev->vq_index != 0) { + return 0; + } + vhost_user_write(dev, &msg, NULL, 0); if (vhost_user_read(dev, &msg) < 0) { -- 2.1.4