From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: [PATCH] tcm_vhost: Expose ABI version via VHOST_SCSI_GET_ABI_VERSION Date: Wed, 25 Jul 2012 23:35:59 +0100 Message-ID: <20120725223559.GA4786@stefanha-thinkpad.localdomain> References: <1343093180-5598-1-git-send-email-nab@linux-iscsi.org> <20120724015634.GD4093@kroah.com> <1343162724.1813.111.camel@haakon2.linux-iscsi.org> <20120725115552.GB11098@stefanha-thinkpad.localdomain> <1343250890.1813.173.camel@haakon2.linux-iscsi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1343250890.1813.173.camel@haakon2.linux-iscsi.org> Sender: target-devel-owner@vger.kernel.org To: "Nicholas A. Bellinger" Cc: Greg Kroah-Hartman , target-devel , linux-scsi , lf-virt , kvm-devel , qemu-devel , Zhi Yong Wu , Anthony Liguori , Paolo Bonzini , "Michael S. Tsirkin" , Christoph Hellwig , Jens Axboe , Hannes Reinecke , Zhi Yong Wu , Avi Kivity List-Id: linux-scsi@vger.kernel.org On Wed, Jul 25, 2012 at 02:14:50PM -0700, Nicholas A. Bellinger wrote: > On Wed, 2012-07-25 at 12:55 +0100, Stefan Hajnoczi wrote: > > On Tue, Jul 24, 2012 at 01:45:24PM -0700, Nicholas A. Bellinger wrote: > > > On Mon, 2012-07-23 at 18:56 -0700, Greg Kroah-Hartman wrote: > > > > On Tue, Jul 24, 2012 at 01:26:20AM +0000, Nicholas A. Bellinger wrote: > > > > > From: Nicholas Bellinger > > > > > > > > > > > diff --git a/drivers/vhost/tcm_vhost.h b/drivers/vhost/tcm_vhost.h > > > > > index e942df9..3d5378f 100644 > > > > > --- a/drivers/vhost/tcm_vhost.h > > > > > +++ b/drivers/vhost/tcm_vhost.h > > > > > @@ -80,7 +80,17 @@ struct tcm_vhost_tport { > > > > > > > > > > #include > > > > > > > > > > +/* > > > > > + * Used by QEMU userspace to ensure a consistent vhost-scsi ABI. > > > > > + * > > > > > + * ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code > > > > > + * ABI Rev 1: 2012 version for v3.6 kernel merge candiate > > > > > + */ > > > > > + > > > > > +#define VHOST_SCSI_ABI_VERSION 1 > > > > > + > > > > > struct vhost_scsi_target { > > > > > + int abi_version; > > > > > unsigned char vhost_wwpn[TRANSPORT_IQN_LEN]; > > > > > unsigned short vhost_tpgt; > > > > > }; > > > > > @@ -88,3 +98,4 @@ struct vhost_scsi_target { > > > > > /* VHOST_SCSI specific defines */ > > > > > #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target) > > > > > #define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) > > > > > +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target) > > > > > > > > No, you just broke the ABI for version "0" here, that's not how you do > > > > this at all. > > > > > > > > > > The intention of this patch is use ABI=1 as a starting point for > > > tcm_vhost moving forward, with no back-wards compat for the ABI=0 > > > prototype userspace code because: > > > > > > - It's based on a slightly older version of QEMU (updating the QEMU series now) > > > - It does not have an GET_ABI_VERSION ioctl cmd (that starts with ABI=1) > > > - It has a small user-base of target + virtio-scsi developers > > > > > > So I did consider just starting from ABI=0, but figured this would help > > > reduce the confusion for QEMU userspace wrt to the vhost-scsi code > > > that's been floating around out-of-tree for the last 2 years. > > > > There is no real user base beyond the handful of people who have hacked > > on this. Adding the GET_ABI_VERSION ioctl() at this stage is fine, > > especially considering that the userspace code that talks to tcm_vhost > > isn't in mainline in userspace yet either. > > > Do you have a preference for a VHOST_SCSI_ABI_VERSION starting point > here..? > > I thought that v1 would be helpful to avoid confusion with the older > userspace code, but don't really have a strong opinion either way.. > > Let me know what you'd prefer here, and I'll make the changes to > tcm_vhost + vhost-scsi patch series accordingly. I don't think 0 for out-of-tree is needed. I'd start at 0 but either way is okay. The main thing I would like to confirm is that this only versions the tcm_vhost ioctls? In that case a single version number works. Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuABc-00074S-6R for qemu-devel@nongnu.org; Wed, 25 Jul 2012 18:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuABa-0006zP-TS for qemu-devel@nongnu.org; Wed, 25 Jul 2012 18:36:08 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:56173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuABa-0006yb-LD for qemu-devel@nongnu.org; Wed, 25 Jul 2012 18:36:06 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Jul 2012 23:36:03 +0100 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6PMa19p2895948 for ; Wed, 25 Jul 2012 23:36:01 +0100 Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6PMa0lX031631 for ; Wed, 25 Jul 2012 16:36:01 -0600 Date: Wed, 25 Jul 2012 23:35:59 +0100 From: Stefan Hajnoczi Message-ID: <20120725223559.GA4786@stefanha-thinkpad.localdomain> References: <1343093180-5598-1-git-send-email-nab@linux-iscsi.org> <20120724015634.GD4093@kroah.com> <1343162724.1813.111.camel@haakon2.linux-iscsi.org> <20120725115552.GB11098@stefanha-thinkpad.localdomain> <1343250890.1813.173.camel@haakon2.linux-iscsi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1343250890.1813.173.camel@haakon2.linux-iscsi.org> Subject: Re: [Qemu-devel] [PATCH] tcm_vhost: Expose ABI version via VHOST_SCSI_GET_ABI_VERSION List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Nicholas A. Bellinger" Cc: Jens Axboe , linux-scsi , kvm-devel , "Michael S. Tsirkin" , Greg Kroah-Hartman , Zhi Yong Wu , qemu-devel , lf-virt , Anthony Liguori , target-devel , Hannes Reinecke , Paolo Bonzini , Zhi Yong Wu , Christoph Hellwig , Avi Kivity On Wed, Jul 25, 2012 at 02:14:50PM -0700, Nicholas A. Bellinger wrote: > On Wed, 2012-07-25 at 12:55 +0100, Stefan Hajnoczi wrote: > > On Tue, Jul 24, 2012 at 01:45:24PM -0700, Nicholas A. Bellinger wrote: > > > On Mon, 2012-07-23 at 18:56 -0700, Greg Kroah-Hartman wrote: > > > > On Tue, Jul 24, 2012 at 01:26:20AM +0000, Nicholas A. Bellinger wrote: > > > > > From: Nicholas Bellinger > > > > > > > > > > > diff --git a/drivers/vhost/tcm_vhost.h b/drivers/vhost/tcm_vhost.h > > > > > index e942df9..3d5378f 100644 > > > > > --- a/drivers/vhost/tcm_vhost.h > > > > > +++ b/drivers/vhost/tcm_vhost.h > > > > > @@ -80,7 +80,17 @@ struct tcm_vhost_tport { > > > > > > > > > > #include > > > > > > > > > > +/* > > > > > + * Used by QEMU userspace to ensure a consistent vhost-scsi ABI. > > > > > + * > > > > > + * ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code > > > > > + * ABI Rev 1: 2012 version for v3.6 kernel merge candiate > > > > > + */ > > > > > + > > > > > +#define VHOST_SCSI_ABI_VERSION 1 > > > > > + > > > > > struct vhost_scsi_target { > > > > > + int abi_version; > > > > > unsigned char vhost_wwpn[TRANSPORT_IQN_LEN]; > > > > > unsigned short vhost_tpgt; > > > > > }; > > > > > @@ -88,3 +98,4 @@ struct vhost_scsi_target { > > > > > /* VHOST_SCSI specific defines */ > > > > > #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target) > > > > > #define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) > > > > > +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target) > > > > > > > > No, you just broke the ABI for version "0" here, that's not how you do > > > > this at all. > > > > > > > > > > The intention of this patch is use ABI=1 as a starting point for > > > tcm_vhost moving forward, with no back-wards compat for the ABI=0 > > > prototype userspace code because: > > > > > > - It's based on a slightly older version of QEMU (updating the QEMU series now) > > > - It does not have an GET_ABI_VERSION ioctl cmd (that starts with ABI=1) > > > - It has a small user-base of target + virtio-scsi developers > > > > > > So I did consider just starting from ABI=0, but figured this would help > > > reduce the confusion for QEMU userspace wrt to the vhost-scsi code > > > that's been floating around out-of-tree for the last 2 years. > > > > There is no real user base beyond the handful of people who have hacked > > on this. Adding the GET_ABI_VERSION ioctl() at this stage is fine, > > especially considering that the userspace code that talks to tcm_vhost > > isn't in mainline in userspace yet either. > > > Do you have a preference for a VHOST_SCSI_ABI_VERSION starting point > here..? > > I thought that v1 would be helpful to avoid confusion with the older > userspace code, but don't really have a strong opinion either way.. > > Let me know what you'd prefer here, and I'll make the changes to > tcm_vhost + vhost-scsi patch series accordingly. I don't think 0 for out-of-tree is needed. I'd start at 0 but either way is okay. The main thing I would like to confirm is that this only versions the tcm_vhost ioctls? In that case a single version number works. Stefan