From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751238AbcBJNNF (ORCPT ); Wed, 10 Feb 2016 08:13:05 -0500 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:42958 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbcBJNNE (ORCPT ); Wed, 10 Feb 2016 08:13:04 -0500 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: cornelia.huck@de.ibm.com X-IBM-RcptTo: kvm@vger.kernel.org;linux-kernel@vger.kernel.org;netdev@vger.kernel.org Date: Wed, 10 Feb 2016 14:12:55 +0100 From: Cornelia Huck To: Greg Kurz Cc: "Michael S. Tsirkin" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness Message-ID: <20160210141255.5466f8e0.cornelia.huck@de.ibm.com> In-Reply-To: <20160210131134.747352bd@bahia.huguette.org> References: <20160113170934.23705.62626.stgit@bahia.huguette.org> <20160113170941.23705.93915.stgit@bahia.huguette.org> <20160210131723-mutt-send-email-mst@redhat.com> <20160210131134.747352bd@bahia.huguette.org> Organization: IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz =?UTF-8?B?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= Dirk Wittkopp Sitz der Gesellschaft: =?UTF-8?B?QsO2Ymxpbmdlbg==?= Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16021013-0009-0000-0000-00000793A167 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Feb 2016 13:11:34 +0100 Greg Kurz wrote: > On Wed, 10 Feb 2016 13:21:22 +0200 > "Michael S. Tsirkin" wrote: > > > On Wed, Jan 13, 2016 at 06:09:41PM +0100, Greg Kurz wrote: > > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > > > index ad2146a9ab2d..e02e06755ab7 100644 > > > --- a/drivers/vhost/vhost.c > > > +++ b/drivers/vhost/vhost.c > > > @@ -43,11 +43,16 @@ enum { > > > #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) > > > > > > #ifdef CONFIG_VHOST_CROSS_ENDIAN_LEGACY > > > -static void vhost_vq_reset_user_be(struct vhost_virtqueue *vq) > > > +static void vhost_disable_user_be(struct vhost_virtqueue *vq) > > > { > > > vq->user_be = !virtio_legacy_is_little_endian(); > > > } > > > > > > > Hmm this doesn't look like an improvement to me. > > What does it mean to disable big endian? Make it little endian? > > The default behavior for the device is native endian. > > The SET_VRING_ENDIAN ioctl is used to make the device big endian > on little endian hosts, hence "enabling" cross-endian mode... > > > Existing reset seems to make sense. > > > > ... and we "disable" cross-endian mode on reset. > > > > +static void vhost_enable_user_be(struct vhost_virtqueue *vq, bool user_be) > > > +{ > > > + vq->user_be = user_be; > > > +} > > > + > > > > And this is maybe "init_user_be"? > > > > Anyway I don't mind changing the names to reset/init_user_be if you think it > is clearer. FWIW, I find the enable/disable terminology less confusing.