From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Greg Kurz <gkurz@linux.vnet.ibm.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
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
Date: Wed, 10 Feb 2016 14:12:55 +0100 [thread overview]
Message-ID: <20160210141255.5466f8e0.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <20160210131134.747352bd@bahia.huguette.org>
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.
next prev parent reply other threads:[~2016-02-10 13:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-13 17:09 [PATCH 0/2] vhost: cross-endian code cleanup Greg Kurz
2016-01-13 17:09 ` [PATCH 1/2] vhost: helpers to enable/disable vring endianness Greg Kurz
2016-01-21 9:55 ` Cornelia Huck
2016-02-10 11:21 ` Michael S. Tsirkin
2016-02-10 12:11 ` Greg Kurz
2016-02-10 13:12 ` Cornelia Huck [this message]
2016-02-10 15:08 ` Michael S. Tsirkin
2016-02-10 15:27 ` Greg Kurz
2016-01-13 17:09 ` [PATCH 2/2] vhost: disentangle vring endianness stuff from the core code Greg Kurz
2016-01-21 9:56 ` Cornelia Huck
2016-02-10 11:48 ` Michael S. Tsirkin
2016-02-10 13:08 ` Greg Kurz
2016-02-10 13:23 ` Cornelia Huck
2016-02-10 13:40 ` Greg Kurz
2016-01-27 10:25 ` [PATCH 0/2] vhost: cross-endian code cleanup Greg Kurz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160210141255.5466f8e0.cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=gkurz@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox