search for: virtio_legacy_is_little_endian

Displaying 20 results from an estimated 143 matches for "virtio_legacy_is_little_endian".

2015 Apr 21
1
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...> +++ b/drivers/net/macvtap.c > @@ -51,7 +51,9 @@ struct macvtap_queue { > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > - return q->flags & MACVTAP_VNET_LE; > + if (q->flags & MACVTAP_VNET_LE) > + return true; > + return virtio_legacy_is_little_endian(); > } > I'd prefer a bit more symmetry: + if (q->flags & MACVTAP_VNET_LE) + return true; + else + return virtio_legacy_is_little_endian(); Or better just: return (q->flags & MACVTAP_VNET_LE) ? true : virtio_legacy_is_little_endian(); might make line long, but your...
2015 Apr 21
1
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...> +++ b/drivers/net/macvtap.c > @@ -51,7 +51,9 @@ struct macvtap_queue { > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > - return q->flags & MACVTAP_VNET_LE; > + if (q->flags & MACVTAP_VNET_LE) > + return true; > + return virtio_legacy_is_little_endian(); > } > I'd prefer a bit more symmetry: + if (q->flags & MACVTAP_VNET_LE) + return true; + else + return virtio_legacy_is_little_endian(); Or better just: return (q->flags & MACVTAP_VNET_LE) ? true : virtio_legacy_is_little_endian(); might make line long, but your...
2015 Apr 23
2
[PATCH v5 6/8] virtio: add explicit big-endian support to memory accessors
...ivers/net/macvtap.c > @@ -51,7 +51,10 @@ struct macvtap_queue { > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > - return q->flags & MACVTAP_VNET_LE; > + if (q->flags & MACVTAP_VNET_LE) > + return true; > + else > + return virtio_legacy_is_little_endian(); simply: return (q->flags & MACVTAP_VNET_LE) || virtio_legacy_is_little_endian(); ? > } > > static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 3c3d6c0..5b044d4 100644 >...
2015 Apr 23
2
[PATCH v5 6/8] virtio: add explicit big-endian support to memory accessors
...ivers/net/macvtap.c > @@ -51,7 +51,10 @@ struct macvtap_queue { > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > - return q->flags & MACVTAP_VNET_LE; > + if (q->flags & MACVTAP_VNET_LE) > + return true; > + else > + return virtio_legacy_is_little_endian(); simply: return (q->flags & MACVTAP_VNET_LE) || virtio_legacy_is_little_endian(); ? > } > > static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 3c3d6c0..5b044d4 100644 >...
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...> +++ b/drivers/net/macvtap.c > @@ -51,7 +51,9 @@ struct macvtap_queue { > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > - return q->flags & MACVTAP_VNET_LE; > + if (q->flags & MACVTAP_VNET_LE) > + return true; > + return virtio_legacy_is_little_endian(); > } > > static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) Hmm I'm not sure how well this will work once you actually make it dynamic. Remains to be seen. > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 3c3d6c0..053f9b6 100644 > -...
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...> +++ b/drivers/net/macvtap.c > @@ -51,7 +51,9 @@ struct macvtap_queue { > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > - return q->flags & MACVTAP_VNET_LE; > + if (q->flags & MACVTAP_VNET_LE) > + return true; > + return virtio_legacy_is_little_endian(); > } > > static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) Hmm I'm not sure how well this will work once you actually make it dynamic. Remains to be seen. > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > index 3c3d6c0..053f9b6 100644 > -...
2015 Oct 27
4
[PATCH] vhost: fix performance on LE hosts
commit 2751c9882b947292fcfb084c4f604e01724af804 ("vhost: cross-endian support for legacy devices") introduced a minor regression: even with cross-endian disabled, and even on LE host, vhost_is_little_endian is checking is_le flag so there's always a branch. To fix, simply check virtio_legacy_is_little_endian first. Cc: Greg Kurz <gkurz at linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/vhost/vhost.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..d3f7674 100644 --- a/drivers/vhost...
2015 Oct 27
4
[PATCH] vhost: fix performance on LE hosts
commit 2751c9882b947292fcfb084c4f604e01724af804 ("vhost: cross-endian support for legacy devices") introduced a minor regression: even with cross-endian disabled, and even on LE host, vhost_is_little_endian is checking is_le flag so there's always a branch. To fix, simply check virtio_legacy_is_little_endian first. Cc: Greg Kurz <gkurz at linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/vhost/vhost.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..d3f7674 100644 --- a/drivers/vhost...
2016 Feb 10
3
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...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? Existing reset seems to make sense. > +static void vhost_enable_user_be(struct vhost_virtqueue *vq, bool user_be) > +{ > + vq->user_be = user_be; >...
2016 Feb 10
3
[PATCH 1/2] vhost: helpers to enable/disable vring endianness
...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? Existing reset seems to make sense. > +static void vhost_enable_user_be(struct vhost_virtqueue *vq, bool user_be) > +{ > + vq->user_be = user_be; >...
2015 Apr 10
16
[PATCH v4 0/8] vhost: support for cross endian guests
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patch 7 got rewritten according to Cornelia's and Michael's comments. I have also introduced patch 8 that brings BE vnet headers support to tun/macvtap. This series is enough to have vhost_net working flawlessly. I could succesfully reboot guests from ppc64 to ppc64le and
2015 Apr 10
16
[PATCH v4 0/8] vhost: support for cross endian guests
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patch 7 got rewritten according to Cornelia's and Michael's comments. I have also introduced patch 8 that brings BE vnet headers support to tun/macvtap. This series is enough to have vhost_net working flawlessly. I could succesfully reboot guests from ppc64 to ppc64le and
2015 Apr 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...> > #define MACVTAP_VNET_LE 0x80000000 > +#define MACVTAP_VNET_BE 0x40000000 > + > +#ifdef CONFIG_TUN_VNET_BE > +static inline bool macvtap_legacy_is_little_endian(struct macvtap_queue *q) > +{ > + if (q->flags & MACVTAP_VNET_BE) > + return false; > + return virtio_legacy_is_little_endian(); > +} > +#else > +static inline bool macvtap_legacy_is_little_endian(struct macvtap_queue *q) > +{ > + return virtio_legacy_is_little_endian(); > +} > +#endif > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > if (q->flags &amp...
2015 Apr 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...> > #define MACVTAP_VNET_LE 0x80000000 > +#define MACVTAP_VNET_BE 0x40000000 > + > +#ifdef CONFIG_TUN_VNET_BE > +static inline bool macvtap_legacy_is_little_endian(struct macvtap_queue *q) > +{ > + if (q->flags & MACVTAP_VNET_BE) > + return false; > + return virtio_legacy_is_little_endian(); > +} > +#else > +static inline bool macvtap_legacy_is_little_endian(struct macvtap_queue *q) > +{ > + return virtio_legacy_is_little_endian(); > +} > +#endif > > static inline bool macvtap_is_little_endian(struct macvtap_queue *q) > { > if (q->flags &amp...
2015 Apr 07
0
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...8..0a03a66 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -51,7 +51,9 @@ struct macvtap_queue { static inline bool macvtap_is_little_endian(struct macvtap_queue *q) { - return q->flags & MACVTAP_VNET_LE; + if (q->flags & MACVTAP_VNET_LE) + return true; + return virtio_legacy_is_little_endian(); } static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 3c3d6c0..053f9b6 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -208,7 +208,9 @@ struct tun_struct { static inline bool tun_is_little_endian(st...
2015 Apr 10
0
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...8..0a03a66 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -51,7 +51,9 @@ struct macvtap_queue { static inline bool macvtap_is_little_endian(struct macvtap_queue *q) { - return q->flags & MACVTAP_VNET_LE; + if (q->flags & MACVTAP_VNET_LE) + return true; + return virtio_legacy_is_little_endian(); } static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 3c3d6c0..053f9b6 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -208,7 +208,9 @@ struct tun_struct { static inline bool tun_is_little_endian(st...
2015 Apr 24
0
[PATCH v6 6/8] virtio: add explicit big-endian support to memory accessors
...ap.c index a2f2958..0327d9d 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -51,7 +51,8 @@ struct macvtap_queue { static inline bool macvtap_is_little_endian(struct macvtap_queue *q) { - return q->flags & MACVTAP_VNET_LE; + return q->flags & MACVTAP_VNET_LE || + virtio_legacy_is_little_endian(); } static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 3c3d6c0..7c4f6b6 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -208,7 +208,8 @@ struct tun_struct { static inline bool tun_is_little_endian(st...
2015 Sep 24
2
[PATCH v2] Fix AF_PACKET ABI breakage in 4.2
...rtio: add explicit big-endian support to memory > accessors") accidentally changed the virtio_net header used by > AF_PACKET with PACKET_VNET_HDR from host-endian to big-endian. > Hi David, Oops my bad... I obviously overlooked this one when adding cross-endian support. > Since virtio_legacy_is_little_endian() is a very long identifier, > define a VIO_LE macro and use that throughout the code instead of the VIO usually refers to virtual IO adapters for the PowerPC pSeries platform. > hard-coded 'false' for little-endian. > What about introducing dedicated accessors as it is done in...
2015 Sep 24
2
[PATCH v2] Fix AF_PACKET ABI breakage in 4.2
...rtio: add explicit big-endian support to memory > accessors") accidentally changed the virtio_net header used by > AF_PACKET with PACKET_VNET_HDR from host-endian to big-endian. > Hi David, Oops my bad... I obviously overlooked this one when adding cross-endian support. > Since virtio_legacy_is_little_endian() is a very long identifier, > define a VIO_LE macro and use that throughout the code instead of the VIO usually refers to virtual IO adapters for the PowerPC pSeries platform. > hard-coded 'false' for little-endian. > What about introducing dedicated accessors as it is done in...
2015 Apr 23
0
[PATCH v5 6/8] virtio: add explicit big-endian support to memory accessors
...e 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -51,7 +51,10 @@ struct macvtap_queue { static inline bool macvtap_is_little_endian(struct macvtap_queue *q) { - return q->flags & MACVTAP_VNET_LE; + if (q->flags & MACVTAP_VNET_LE) + return true; + else + return virtio_legacy_is_little_endian(); } static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 3c3d6c0..5b044d4 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -208,7 +208,10 @@ struct tun_struct { static inline bool tun_is_little_endian(s...