Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1331154

Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness

From Cornelia Huck <cornelia.huck@de.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness
Date 2016-02-10 14:20 +0100
Message-ID <r0CQy-2ES-3@gated-at.bofh.it> (permalink)
References <qQx5M-2Pq-9@gated-at.bofh.it> <qQx5N-2Pq-35@gated-at.bofh.it> <r0B86-1xR-13@gated-at.bofh.it> <r0BUu-25C-15@gated-at.bofh.it>
Organization IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Show all headers | View raw


On Wed, 10 Feb 2016 13:11:34 +0100
Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:

> On Wed, 10 Feb 2016 13:21:22 +0200
> "Michael S. Tsirkin" <mst@redhat.com> 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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness "Michael S. Tsirkin" <mst@redhat.com> - 2016-02-10 12:30 +0100
  Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness Greg Kurz <gkurz@linux.vnet.ibm.com> - 2016-02-10 13:20 +0100
    Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness Cornelia Huck <cornelia.huck@de.ibm.com> - 2016-02-10 14:20 +0100
    Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness "Michael S. Tsirkin" <mst@redhat.com> - 2016-02-10 16:10 +0100
      Re: [PATCH 1/2] vhost: helpers to enable/disable vring endianness Greg Kurz <gkurz@linux.vnet.ibm.com> - 2016-02-10 16:30 +0100

csiph-web