[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/2] virtio-net: use the backend cross-endian
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/2] virtio-net: use the backend cross-endian capabilities |
Date: |
Fri, 13 Nov 2015 15:46:06 +0100 |
On Fri, 13 Nov 2015 09:26:26 +0100
Greg Kurz <address@hidden> wrote:
> On Thu, 12 Nov 2015 18:52:55 +0100
> Cornelia Huck <address@hidden> wrote:
>
> > On Mon, 09 Nov 2015 18:41:33 +0100
> > Greg Kurz <address@hidden> 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?
[Qemu-devel] [PATCH v2 2/2] Revert "vhost-net: tell tap backend about the vnet endianness", Greg Kurz, 2015/11/09