From patchwork Wed Mar 27 23:05:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 231857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 833992C00A0 for ; Thu, 28 Mar 2013 10:06:22 +1100 (EST) Received: from localhost ([::1]:48685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKzQC-0003JX-ET for incoming@patchwork.ozlabs.org; Wed, 27 Mar 2013 19:06:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKzPn-0003Bf-Sp for qemu-devel@nongnu.org; Wed, 27 Mar 2013 19:06:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKzPj-0003q3-JN for qemu-devel@nongnu.org; Wed, 27 Mar 2013 19:05:55 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:52043 helo=linux-iscsi.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKzPj-0003pu-6U for qemu-devel@nongnu.org; Wed, 27 Mar 2013 19:05:51 -0400 Received: from [192.168.1.68] (75-37-193-228.lightspeed.lsatca.sbcglobal.net [75.37.193.228]) (using SSLv3 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nab) by linux-iscsi.org (Postfix) with ESMTPSA id C0A3D22D9D0; Wed, 27 Mar 2013 22:54:47 +0000 (UTC) From: "Nicholas A. Bellinger" To: "Michael S. Tsirkin" In-Reply-To: <20130327225021.GA12858@redhat.com> References: <1364421586-29857-1-git-send-email-nab@linux-iscsi.org> <1364421586-29857-3-git-send-email-nab@linux-iscsi.org> <20130327222856.GC12518@redhat.com> <1364424342.17698.31.camel@haakon2.linux-iscsi.org> <20130327225021.GA12858@redhat.com> Date: Wed, 27 Mar 2013 16:05:47 -0700 Message-ID: <1364425547.17698.35.camel@haakon2.linux-iscsi.org> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 67.23.28.174 Cc: kvm-devel , qemu-devel , lf-virt , Anthony Liguori , target-devel , Stefan Hajnoczi , Paolo Bonzini , Asias He Subject: Re: [Qemu-devel] [PATCH 2/3] vhost-scsi: new device supporting the tcm_vhost Linux kernel module X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Thu, 2013-03-28 at 00:50 +0200, Michael S. Tsirkin wrote: > On Wed, Mar 27, 2013 at 03:45:42PM -0700, Nicholas A. Bellinger wrote: > > On Thu, 2013-03-28 at 00:28 +0200, Michael S. Tsirkin wrote: > > > On Wed, Mar 27, 2013 at 09:59:45PM +0000, Nicholas A. Bellinger wrote: > > > > From: Paolo Bonzini > > > > > > > > The WWPN specified in configfs is passed to "-device vhost-scsi-pci". > > > > The tgpt field of the SET_ENDPOINT ioctl is obsolete now, so it is not > > > > available from the QEMU command-line. Instead, I hardcode it to zero. > > > > > > > > Changes in V4: > > > > - Set event_idx=off by default (nab, thanks asias) > > > > > > Why? What's going on here? > > > > > > > Not disabling event_idx by default, or disabling from the command line > > ends up resulting in ->handle_kick() not getting called for subsequent > > commands.. > > > > I spent some time trying to track this down recently with no luck, and > > AFAICT it's always been required in order for vhost-scsi to function. > > Hmm this is a bug in kernel then. A better work-around is > to disable EVENT_IDX in kernel. Let's do it for 3.9? > Then when we fix it, things just work for userspace. > Mmmm, the following patch yields the same results with the event_idx=on default for DEFINE_VHOST_SCSI_PROPERTIES. Is there another method you had in mind to disable EVENT_IDX..? diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 0524267..757cbda 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -981,7 +981,7 @@ static void vhost_scsi_flush(struct vhost_scsi *vs) static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) { - if (features & ~VHOST_FEATURES) + if (features & ~VHOST_TCM_FEATURES) return -EOPNOTSUPP; mutex_lock(&vs->dev.mutex); @@ -1027,7 +1027,7 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl, return -EFAULT; return 0; case VHOST_GET_FEATURES: - features = VHOST_FEATURES; + features = VHOST_TCM_FEATURES; if (copy_to_user(featurep, &features, sizeof features)) return -EFAULT; return 0; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 17261e2..588536e 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -204,6 +204,9 @@ enum { VHOST_NET_FEATURES = VHOST_FEATURES | (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | (1ULL << VIRTIO_NET_F_MRG_RXBUF), + VHOST_TCM_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | + (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | + (1ULL << VHOST_F_LOG_ALL) }; static inline int vhost_has_feature(struct vhost_dev *dev, int bit)