From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/2] virtio-net: use the backend cross-endian capabilities
Date: Fri, 13 Nov 2015 15:54:37 +0100 [thread overview]
Message-ID: <20151113155437.5ff8d0ff@bahia.local> (raw)
In-Reply-To: <20151113154606.11429148.cornelia.huck@de.ibm.com>
On Fri, 13 Nov 2015 15:46:06 +0100
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> On Fri, 13 Nov 2015 09:26:26 +0100
> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
>
> > On Thu, 12 Nov 2015 18:52:55 +0100
> > Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> >
> > > On Mon, 09 Nov 2015 18:41:33 +0100
> > > Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
>
> > > > +static bool virtio_net_needs_hdr_swap(VirtIONet *n)
> > > > +{
> > > > + /* virtio_needs_swap() is constant for fixed endian targets: call it
> > > > + * first to filter them out without penalty.
> > >
> > > What do you mean with 'constant' here? It still needs to retrieve the
> > > feature bit from the device, no?
> > >
> >
> > Yes the comment is inaccurate... With the "virtio: cross-endian helpers fixes"
> > series, virtio_needs_swap() indeed resolves to { return 0; } for fixed little
> > endian targets but we still need to check the feature bit when the target is big
> > endian.
> >
> > If I drop the call to virtio_needs_swap(), all targets will have the same
> > penalty. If I keep it, fixed little endian targets have no penalty but fixed
> > big endian targets get an extra check and bi-endian targets get two extra checks...
> >
> > Not sure what to decide...
>
> The impact probably isn't too large, but improving one configuration
> via penalizing others feels wrong.
>
> Just check the bool value to make the decision?
Sounds fair. I'll drop the call to virtio_needs_swap() then.
Thanks.
--
Greg
next prev parent reply other threads:[~2015-11-13 14:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 17:40 [Qemu-devel] [PATCH v2 0/2] virtio-net/vhost-net: share cross-endian enablement Greg Kurz
2015-11-09 17:41 ` [Qemu-devel] [PATCH v2 1/2] virtio-net: use the backend cross-endian capabilities Greg Kurz
2015-11-12 17:52 ` Cornelia Huck
2015-11-13 8:26 ` Greg Kurz
2015-11-13 14:46 ` Cornelia Huck
2015-11-13 14:54 ` Greg Kurz [this message]
2015-11-09 17:42 ` [Qemu-devel] [PATCH v2 2/2] Revert "vhost-net: tell tap backend about the vnet endianness" 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=20151113155437.5ff8d0ff@bahia.local \
--to=gkurz@linux.vnet.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).