Displaying 20 results from an estimated 34 matches for "tun_vnet_le".
2015 Apr 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...TSO6 |
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 053f9b6..4e12488 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -111,6 +111,7 @@ do { \
> #define TUN_FASYNC IFF_ATTACH_QUEUE
> /* High bits in flags field are unused. */
> #define TUN_VNET_LE 0x80000000
> +#define TUN_VNET_BE 0x40000000
>
> #define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \
> IFF_MULTI_QUEUE)
> @@ -206,11 +207,25 @@ struct tun_struct {
> u32 flow_count;
> };
>
> +#ifdef CONFIG_TUN_VNET_BE
> +static i...
2015 Apr 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...TSO6 |
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 053f9b6..4e12488 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -111,6 +111,7 @@ do { \
> #define TUN_FASYNC IFF_ATTACH_QUEUE
> /* High bits in flags field are unused. */
> #define TUN_VNET_LE 0x80000000
> +#define TUN_VNET_BE 0x40000000
>
> #define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \
> IFF_MULTI_QUEUE)
> @@ -206,11 +207,25 @@ struct tun_struct {
> u32 flow_count;
> };
>
> +#ifdef CONFIG_TUN_VNET_BE
> +static i...
2015 Apr 23
0
[PATCH v5 2/8] tun: add tun_is_little_endian() helper
...ons(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 857dca4..3c3d6c0 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -206,14 +206,19 @@ struct tun_struct {
u32 flow_count;
};
+static inline bool tun_is_little_endian(struct tun_struct *tun)
+{
+ return tun->flags & TUN_VNET_LE;
+}
+
static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
{
- return __virtio16_to_cpu(tun->flags & TUN_VNET_LE, val);
+ return __virtio16_to_cpu(tun_is_little_endian(tun), val);
}
static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val)
{
- return __c...
2015 Apr 24
0
[PATCH v6 2/8] tun: add tun_is_little_endian() helper
...ons(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 857dca4..3c3d6c0 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -206,14 +206,19 @@ struct tun_struct {
u32 flow_count;
};
+static inline bool tun_is_little_endian(struct tun_struct *tun)
+{
+ return tun->flags & TUN_VNET_LE;
+}
+
static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
{
- return __virtio16_to_cpu(tun->flags & TUN_VNET_LE, val);
+ return __virtio16_to_cpu(tun_is_little_endian(tun), val);
}
static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val)
{
- return __c...
2015 Jun 01
1
[PATCH v6 2/8] tun: add tun_is_little_endian() helper
...et/tun.c
> index 857dca4..3c3d6c0 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -206,14 +206,19 @@ struct tun_struct {
> u32 flow_count;
> };
>
> +static inline bool tun_is_little_endian(struct tun_struct *tun)
> +{
> + return tun->flags & TUN_VNET_LE;
> +}
> +
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> {
> - return __virtio16_to_cpu(tun->flags & TUN_VNET_LE, val);
> + return __virtio16_to_cpu(tun_is_little_endian(tun), val);
> }
>
> static inline __virtio16 cpu_to_tun16(str...
2015 Jun 01
1
[PATCH v6 2/8] tun: add tun_is_little_endian() helper
...et/tun.c
> index 857dca4..3c3d6c0 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -206,14 +206,19 @@ struct tun_struct {
> u32 flow_count;
> };
>
> +static inline bool tun_is_little_endian(struct tun_struct *tun)
> +{
> + return tun->flags & TUN_VNET_LE;
> +}
> +
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> {
> - return __virtio16_to_cpu(tun->flags & TUN_VNET_LE, val);
> + return __virtio16_to_cpu(tun_is_little_endian(tun), val);
> }
>
> static inline __virtio16 cpu_to_tun16(str...
2015 Apr 21
0
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...driver and
> > + the host is little-endian.
> > +
> > + Unless you have a little-endian system hosting a big-endian virtual
> > + machine with a virtio NIC, you should say N.
> > +
>
> should mention cross-endian, not big-endian, right?
>
The current TUN_VNET_LE related code is already doing cross-endian: without
this patch, one can already run a LE guest on a BE host... wouldn't it be
confusing to mention cross-endian only when the guest is BE ?
What about having a completely distinct implementation for cross-endian that
don't reuse the existing...
2015 Apr 23
16
[PATCH v5 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. It is compatible with modern virtio and can be
fully compiled out through kernel config.
FWIW, I could flawlessly kexec/reboot guests from ppc64 to ppc64le and back.
I could also migrate from a ppc64 to a ppc64le host and back. No regressions
on x86 as expected. My experimental QEMU tree
2015 Apr 23
16
[PATCH v5 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. It is compatible with modern virtio and can be
fully compiled out through kernel config.
FWIW, I could flawlessly kexec/reboot guests from ppc64 to ppc64le and back.
I could also migrate from a ppc64 to a ppc64le host and back. No regressions
on x86 as expected. My experimental QEMU tree
2015 Apr 10
0
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...& ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 053f9b6..4e12488 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -111,6 +111,7 @@ do { \
#define TUN_FASYNC IFF_ATTACH_QUEUE
/* High bits in flags field are unused. */
#define TUN_VNET_LE 0x80000000
+#define TUN_VNET_BE 0x40000000
#define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \
IFF_MULTI_QUEUE)
@@ -206,11 +207,25 @@ struct tun_struct {
u32 flow_count;
};
+#ifdef CONFIG_TUN_VNET_BE
+static inline bool tun_legacy_is_little_endian(struct tun_...
2015 Apr 24
0
[PATCH v6 8/8] macvtap/tun: cross-endian support for little-endian hosts
...& ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7c4f6b6..9fa05d6 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -111,6 +111,7 @@ do { \
#define TUN_FASYNC IFF_ATTACH_QUEUE
/* High bits in flags field are unused. */
#define TUN_VNET_LE 0x80000000
+#define TUN_VNET_BE 0x40000000
#define TUN_FEATURES (IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR | \
IFF_MULTI_QUEUE)
@@ -206,10 +207,58 @@ struct tun_struct {
u32 flow_count;
};
+#ifdef CONFIG_TUN_VNET_CROSS_LE
+static inline bool tun_legacy_is_little_endian(struc...
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...it 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(struct tun_struct *tun)
> {
> - return tun->flags & TUN_VNET_LE;
> + if (tun->flags & TUN_VNET_LE)
> + return true;
> + return virtio_legacy_is_little_endian();
> }
>
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index 6a49960..4e9a186 1...
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...it 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(struct tun_struct *tun)
> {
> - return tun->flags & TUN_VNET_LE;
> + if (tun->flags & TUN_VNET_LE)
> + return true;
> + return virtio_legacy_is_little_endian();
> }
>
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index 6a49960..4e9a186 1...
2015 Apr 24
27
[PATCH v6 0/8] vhost: support for cross endian guests
Only cosmetic and documentation changes since v5.
---
Greg Kurz (8):
virtio: introduce virtio_is_little_endian() helper
tun: add tun_is_little_endian() helper
macvtap: introduce macvtap_is_little_endian() helper
vringh: introduce vringh_is_little_endian() helper
vhost: introduce vhost_is_little_endian() helper
virtio: add explicit big-endian support to memory
2015 Apr 24
27
[PATCH v6 0/8] vhost: support for cross endian guests
Only cosmetic and documentation changes since v5.
---
Greg Kurz (8):
virtio: introduce virtio_is_little_endian() helper
tun: add tun_is_little_endian() helper
macvtap: introduce macvtap_is_little_endian() helper
vringh: introduce vringh_is_little_endian() helper
vhost: introduce vhost_is_little_endian() helper
virtio: add explicit big-endian support to memory
2015 Apr 21
1
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...it 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(struct tun_struct *tun)
> {
> - return tun->flags & TUN_VNET_LE;
> + if (tun->flags & TUN_VNET_LE)
> + return true;
> + return virtio_legacy_is_little_endian();
> }
>
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index 6a49960..4e9a186 1...
2015 Apr 21
1
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...it 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(struct tun_struct *tun)
> {
> - return tun->flags & TUN_VNET_LE;
> + if (tun->flags & TUN_VNET_LE)
> + return true;
> + return virtio_legacy_is_little_endian();
> }
>
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
> index 6a49960..4e9a186 1...
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
...endian.
> > > +
> > > + Unless you have a little-endian system hosting a big-endian virtual
> > > + machine with a virtio NIC, you should say N.
> > > +
> >
> > should mention cross-endian, not big-endian, right?
> >
>
> The current TUN_VNET_LE related code is already doing cross-endian: without
> this patch, one can already run a LE guest on a BE host... wouldn't it be
> confusing to mention cross-endian only when the guest is BE ?
Hmm I think no - LE is also useful for virtio 1 - this is what it was
intended for after all.
&...