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: 2353601 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 950B1DFE82 for ; Wed, 27 Mar 2013 23:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752625Ab3C0XFv (ORCPT ); Wed, 27 Mar 2013 19:05:51 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:41723 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751128Ab3C0XFu (ORCPT ); Wed, 27 Mar 2013 19:05:50 -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) Subject: Re: [PATCH 2/3] vhost-scsi: new device supporting the tcm_vhost Linux kernel module From: "Nicholas A. Bellinger" To: "Michael S. Tsirkin" Cc: target-devel , lf-virt , kvm-devel , qemu-devel , Stefan Hajnoczi , Paolo Bonzini , Asias He , Anthony Liguori 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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..? --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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)