vxlan: avoid vlan processing in vxlan device.
authorpravin shelar <pshelar@ovn.org>
Mon, 14 Nov 2016 04:43:52 +0000 (20:43 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Nov 2016 17:16:13 +0000 (12:16 -0500)
VxLan device does not have special handling for vlan taging on egress.
Therefore it does not make sense to expose vlan offloading feature.
This patch does not change vxlan functinality.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c
include/linux/if_vlan.h

index 5264c1a49d86de0b79b6c08bd6ffffab0ba85c1d..7bebce190270181e18a5b97a992e50fd4f80ecb9 100644 (file)
@@ -1750,18 +1750,13 @@ static int vxlan_build_skb(struct sk_buff *skb, struct dst_entry *dst,
        }
 
        min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len
-                       + VXLAN_HLEN + iphdr_len
-                       + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
+                       + VXLAN_HLEN + iphdr_len;
 
        /* Need space for new headers (invalidates iph ptr) */
        err = skb_cow_head(skb, min_headroom);
        if (unlikely(err))
                goto out_free;
 
-       skb = vlan_hwaccel_push_inside(skb);
-       if (WARN_ON(!skb))
-               return -ENOMEM;
-
        err = iptunnel_handle_offloads(skb, type);
        if (err)
                goto out_free;
@@ -2529,10 +2524,8 @@ static void vxlan_setup(struct net_device *dev)
        dev->features   |= NETIF_F_GSO_SOFTWARE;
 
        dev->vlan_features = dev->features;
-       dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
        dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
        dev->hw_features |= NETIF_F_GSO_SOFTWARE;
-       dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
        netif_keep_dst(dev);
        dev->priv_flags |= IFF_NO_QUEUE;
 
index 3319d97d789dfd84773a0b361633c69896d342f3..8d5fcd6284ce0f4702d9eb28703bf2ae80d7e399 100644 (file)
@@ -399,22 +399,6 @@ static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb)
                skb->vlan_tci = 0;
        return skb;
 }
-/*
- * vlan_hwaccel_push_inside - pushes vlan tag to the payload
- * @skb: skbuff to tag
- *
- * Checks is tag is present in @skb->vlan_tci and if it is, it pushes the
- * VLAN tag from @skb->vlan_tci inside to the payload.
- *
- * Following the skb_unshare() example, in case of error, the calling function
- * doesn't have to worry about freeing the original skb.
- */
-static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb)
-{
-       if (skb_vlan_tag_present(skb))
-               skb = __vlan_hwaccel_push_inside(skb);
-       return skb;
-}
 
 /**
  * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting