[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the t
From: |
Nicholas A. Bellinger |
Subject: |
Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module |
Date: |
Thu, 31 Jan 2013 13:10:52 -0800 |
On Thu, 2013-01-31 at 13:12 +0200, Michael S. Tsirkin wrote:
> On Wed, Jan 30, 2013 at 05:41:22PM +0100, Paolo Bonzini wrote:
<SNIP>
> > Another small bug I found is an ordering problem between
> > VHOST_SET_VRING_KICK and VHOST_SCSI_SET_ENDPOINT. Starting the vq
> > causes a "vhost_scsi_handle_vq endpoint not set" error in dmesg.
> > Because of this I added the first two patches, which let me do
> > VHOST_SCSI_SET_ENDPOINT before VHOST_SET_VRING_KICK but after setting
> > up the vring.
> >
> > Unfortunately, this is not enough to fix the hang. And anyway, it's
> > probably simpler to avoid the two patches and remove this test from the
> > tcm_vhost.c vhost_scsi_set/clear_endpoint functions:
> >
> > mutex_lock(&vs->dev.mutex);
> > /* Verify that ring has been setup correctly. */
> > for (index = 0; index < vs->dev.nvqs; ++index) {
> > /* Verify that ring has been setup correctly. */
> > if (!vhost_vq_access_ok(&vs->vqs[index])) {
> > mutex_unlock(&vs->dev.mutex);
> > return -EFAULT;
> > }
> > }
> > mutex_unlock(&vs->dev.mutex);
>
> Well userspace should initialize the kick eventfd to 0,
> it seems to init it to 1 which is why we get the error.
> But I think the only issue is pr_err: vhost-net already
> ignores such a kick with no backend. So let's just
> remove it, preferably for 3.8.
>
That's fine with me. Applying to target-pending/master, and will
include in the next PULL request for v3.8.0.
Thanks,
--nab
> --->
> tcm_vhost: fix pr_err on early kick
>
> It's OK to get kick before backend is set or after
> it is cleared, we can just ignore it.
>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
>
> ---
>
> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c
> index b20df5c..22321cf 100644
> --- a/drivers/vhost/tcm_vhost.c
> +++ b/drivers/vhost/tcm_vhost.c
> @@ -575,10 +575,8 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs)
>
> /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */
> tv_tpg = vs->vs_tpg;
> - if (unlikely(!tv_tpg)) {
> - pr_err("%s endpoint not set\n", __func__);
> + if (unlikely(!tv_tpg))
> return;
> - }
>
> mutex_lock(&vq->mutex);
> vhost_disable_notify(&vs->dev, vq);
- [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Paolo Bonzini, 2013/01/30
- [Qemu-devel] [PATCH 1/4] vhost: do VHOST_SET_VRING_KICK after setting up all vrings, Paolo Bonzini, 2013/01/30
- [Qemu-devel] [PATCH 2/4] vhost: add set_vhost_endpoint and clear_vhost_endpoint callbacks, Paolo Bonzini, 2013/01/30
- [Qemu-devel] [PATCH 3/4] virtio-scsi: create VirtIOSCSICommon, Paolo Bonzini, 2013/01/30
- [Qemu-devel] [PATCH 4/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Paolo Bonzini, 2013/01/30
- Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Michael S. Tsirkin, 2013/01/30
- Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Nicholas A. Bellinger, 2013/01/31
- Re: [Qemu-devel] [PATCH WIP 0/4] vhost-scsi: new device supporting the tcm_vhost Linux kernel module, Michael S. Tsirkin, 2013/01/31