Displaying 20 results from an estimated 31 matches for "tun16_to_cpu".
2016 Jun 08
7
[PATCH 0/6] virtio_net: use common code for virtio_net_hdr and skb GSO conversion
Hi,
This patches introduce virtio_net_hdr_{from,to}_skb functions for
conversion of GSO information between skb and virtio_net_hdr.
Mike Rapoport (6):
virtio_net: add _UAPI prefix to virtio_net header guards
virtio_net: introduce virtio_net_hdr_{from,to}_skb
macvtap: use common code for virtio_net_hdr and skb GSO conversion
tuntap: use common code for virtio_net_hdr and skb GSO
2016 Jun 08
7
[PATCH 0/6] virtio_net: use common code for virtio_net_hdr and skb GSO conversion
Hi,
This patches introduce virtio_net_hdr_{from,to}_skb functions for
conversion of GSO information between skb and virtio_net_hdr.
Mike Rapoport (6):
virtio_net: add _UAPI prefix to virtio_net header guards
virtio_net: introduce virtio_net_hdr_{from,to}_skb
macvtap: use common code for virtio_net_hdr and skb GSO conversion
tuntap: use common code for virtio_net_hdr and skb GSO
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...ct 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 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -175,7 +175,9 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int...
2015 Apr 07
1
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...ct 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 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -175,7 +175,9 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int...
2015 Apr 21
1
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...ct 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 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -175,7 +175,9 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int...
2015 Apr 21
1
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...ct 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 100644
> --- a/drivers/vhost/vhost.h
> +++ b/drivers/vhost/vhost.h
> @@ -175,7 +175,9 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int...
2015 Apr 23
0
[PATCH v5 2/8] tun: add tun_is_little_endian() helper
...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 __cpu_to_virtio16(tun->flags & TUN...
2015 Apr 24
0
[PATCH v6 2/8] tun: add tun_is_little_endian() helper
...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 __cpu_to_virtio16(tun->flags & TUN...
2015 Jun 01
1
[PATCH v6 2/8] tun: add tun_is_little_endian() helper
...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 _...
2015 Jun 01
1
[PATCH v6 2/8] tun: add tun_is_little_endian() helper
...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 _...
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 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...}
> +#endif
> +
> static inline bool tun_is_little_endian(struct tun_struct *tun)
> {
> if (tun->flags & TUN_VNET_LE)
> return true;
> - return virtio_legacy_is_little_endian();
> + return tun_legacy_is_little_endian(tun);
> }
>
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> @@ -1836,6 +1851,43 @@ unlock:
> return ret;
> }
>
> +#ifdef CONFIG_TUN_VNET_BE
> +static long tun_get_vnet_be(struct tun_struct *tun, int __user *argp)
> +{
> + int be = !!(tun->flags & TUN_VNET_BE);
> +
> + if (pu...
2015 Apr 21
2
[PATCH v4 8/8] macvtap/tun: add VNET_BE flag
...}
> +#endif
> +
> static inline bool tun_is_little_endian(struct tun_struct *tun)
> {
> if (tun->flags & TUN_VNET_LE)
> return true;
> - return virtio_legacy_is_little_endian();
> + return tun_legacy_is_little_endian(tun);
> }
>
> static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
> @@ -1836,6 +1851,43 @@ unlock:
> return ret;
> }
>
> +#ifdef CONFIG_TUN_VNET_BE
> +static long tun_get_vnet_be(struct tun_struct *tun, int __user *argp)
> +{
> + int be = !!(tun->flags & TUN_VNET_BE);
> +
> + if (pu...
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 07
0
[PATCH v3 6/7] virtio: add explicit big-endian support to memory accessors
...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 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -175,7 +175,9 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
static inline boo...
2015 Apr 10
0
[PATCH v4 6/8] virtio: add explicit big-endian support to memory accessors
...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 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -175,7 +175,9 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
static inline boo...
2015 Apr 24
0
[PATCH v6 6/8] virtio: add explicit big-endian support to memory accessors
.../drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -208,7 +208,8 @@ struct tun_struct {
static inline bool tun_is_little_endian(struct tun_struct *tun)
{
- return tun->flags & TUN_VNET_LE;
+ return tun->flags & TUN_VNET_LE ||
+ 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..a4fa33a 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -175,7 +175,8 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
static inline boo...
2015 Apr 23
0
[PATCH v5 6/8] virtio: add explicit big-endian support to memory accessors
...rivers/net/tun.c
@@ -208,7 +208,10 @@ 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;
+ else
+ 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..954c657 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -175,7 +175,7 @@ static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
static inline boo...