aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-12-16 08:05:10 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-16 11:19:42 -0500
commit01b07fb3508890b637b97f0fe3a4053a6a7f6fc3 (patch)
tree9dc1793c1cedbbff47754a05a90518bd5b906d28
parent1cf8e410b6d3906aa1ecacdd15dd9b448c9ce111 (diff)
macvtap: drop broken IFF_VNET_LE
Use TUNSETVNETLE/TUNGETVNETLE instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/macvtap.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 80fdb82352fa..7df221788cd4 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -46,16 +46,18 @@ struct macvtap_queue {
46 struct list_head next; 46 struct list_head next;
47}; 47};
48 48
49#define MACVTAP_FEATURES (IFF_VNET_HDR | IFF_VNET_LE | IFF_MULTI_QUEUE) 49#define MACVTAP_FEATURES (IFF_VNET_HDR | IFF_MULTI_QUEUE)
50
51#define MACVTAP_VNET_LE 0x80000000
50 52
51static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val) 53static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val)
52{ 54{
53 return __virtio16_to_cpu(q->flags & IFF_VNET_LE, val); 55 return __virtio16_to_cpu(q->flags & MACVTAP_VNET_LE, val);
54} 56}
55 57
56static inline __virtio16 cpu_to_macvtap16(struct macvtap_queue *q, u16 val) 58static inline __virtio16 cpu_to_macvtap16(struct macvtap_queue *q, u16 val)
57{ 59{
58 return __cpu_to_virtio16(q->flags & IFF_VNET_LE, val); 60 return __cpu_to_virtio16(q->flags & MACVTAP_VNET_LE, val);
59} 61}
60 62
61static struct proto macvtap_proto = { 63static struct proto macvtap_proto = {
@@ -1070,6 +1072,21 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
1070 q->vnet_hdr_sz = s; 1072 q->vnet_hdr_sz = s;
1071 return 0; 1073 return 0;
1072 1074
1075 case TUNGETVNETLE:
1076 s = !!(q->flags & MACVTAP_VNET_LE);
1077 if (put_user(s, sp))
1078 return -EFAULT;
1079 return 0;
1080
1081 case TUNSETVNETLE:
1082 if (get_user(s, sp))
1083 return -EFAULT;
1084 if (s)
1085 q->flags |= MACVTAP_VNET_LE;
1086 else
1087 q->flags &= ~MACVTAP_VNET_LE;
1088 return 0;
1089
1073 case TUNSETOFFLOAD: 1090 case TUNSETOFFLOAD:
1074 /* let the user check for future flags */ 1091 /* let the user check for future flags */
1075 if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | 1092 if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 |