datapath: Account for rename to vlan_insert_tag_set_proto()
authorThomas Graf <tgraf@noironetworks.com>
Wed, 7 Jan 2015 11:55:49 +0000 (12:55 +0100)
committerThomas Graf <tgraf@noironetworks.com>
Wed, 7 Jan 2015 11:55:49 +0000 (12:55 +0100)
__vlan_put_tag() was renamed to vlan_insert_tag_set_proto() with
the argument list kept intact.

Upstream: 62749e ("vlan: rename __vlan_put_tag to vlan_insert_tag_set_proto")
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
acinclude.m4
datapath/actions.c
datapath/datapath.c
datapath/linux/compat/gso.c
datapath/linux/compat/include/linux/if_vlan.h
datapath/linux/compat/vxlan.c
datapath/vport-geneve.c
datapath/vport-gre.c
datapath/vport-internal_dev.c

index 3121b09..05dc112 100644 (file)
@@ -376,6 +376,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
 
   OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD],
                   [OVS_DEFINE([HAVE_VLAN_BUG_WORKAROUND])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_insert_tag_set_proto])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/u64_stats_sync.h], [u64_stats_fetch_begin_irq])
 
index 5a1dbe2..9a49cd5 100644 (file)
@@ -292,7 +292,7 @@ static int push_vlan(struct sk_buff *skb, struct sw_flow_key *key,
                /* push down current VLAN tag */
                current_tag = vlan_tx_tag_get(skb);
 
-               if (!__vlan_put_tag(skb, skb->vlan_proto, current_tag))
+               if (!vlan_insert_tag_set_proto(skb, skb->vlan_proto, current_tag))
                        return -ENOMEM;
                /* Update mac_len for subsequent MPLS actions */
                skb->mac_len += VLAN_HLEN;
index 3607170..ebab68c 100644 (file)
@@ -428,7 +428,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
                if (!nskb)
                        return -ENOMEM;
 
-               nskb = __vlan_put_tag(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb));
+               nskb = vlan_insert_tag_set_proto(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb));
                if (!nskb)
                        return -ENOMEM;
 
index 5079f79..56f9493 100644 (file)
@@ -110,8 +110,8 @@ int rpl_dev_queue_xmit(struct sk_buff *skb)
                                features &= ~(NETIF_F_TSO | NETIF_F_TSO6 |
                                              NETIF_F_UFO | NETIF_F_FSO);
 
-                       skb = __vlan_put_tag(skb, skb->vlan_proto,
-                                            vlan_tx_tag_get(skb));
+                       skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
+                                                       vlan_tx_tag_get(skb));
                        if (unlikely(!skb))
                                return err;
                        vlan_set_tci(skb, 0);
index 730175b..616b3bf 100644 (file)
@@ -5,9 +5,10 @@
 #include <linux/version.h>
 #include_next <linux/if_vlan.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+#ifndef HAVE_VLAN_INSERT_TAG_SET_PROTO
 /*
- * The behavior of __vlan_put_tag() has changed over time:
+ * The behavior of __vlan_put_tag()/vlan_insert_tag_set_proto() has changed
+ * over time:
  *
  *      - In 2.6.26 and earlier, it adjusted both MAC and network header
  *        pointers.  (The latter didn't make any sense.)
  *
  *      - In 2.6.29 and later, it adjusts the MAC header pointer only.
  *
+ *      - In 3.19 and later, it was renamed to vlan_insert_tag_set_proto()
+ *
  * This is the version from 2.6.33.  We unconditionally substitute this version
  * to avoid the need to guess whether the version in the kernel tree is
  * acceptable.
  */
-#define __vlan_put_tag(skb, proto, tag)  rpl__vlan_put_tag(skb, tag)
-
-static inline struct sk_buff *rpl__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
+#define vlan_insert_tag_set_proto(skb, proto, vlan_tci) \
+       rpl_vlan_insert_tag_set_proto(skb, vlan_tci)
+static inline struct sk_buff *rpl_vlan_insert_tag_set_proto(struct sk_buff *skb,
+                                                           u16 vlan_tci)
 {
        struct vlan_ethhdr *veth;
 
@@ -46,7 +50,9 @@ static inline struct sk_buff *rpl__vlan_put_tag(struct sk_buff *skb, u16 vlan_tc
 
        return skb;
 }
+#endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 static inline struct sk_buff *rpl___vlan_hwaccel_put_tag(struct sk_buff *skb,
                                                     __be16 vlan_proto,
                                                     u16 vlan_tci)
@@ -55,7 +61,6 @@ static inline struct sk_buff *rpl___vlan_hwaccel_put_tag(struct sk_buff *skb,
 }
 
 #define __vlan_hwaccel_put_tag rpl___vlan_hwaccel_put_tag
-
 #endif
 
 /* All of these were introduced in a single commit preceding 2.6.33, so
index 0389b28..49d3864 100644 (file)
@@ -193,9 +193,9 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
        }
 
        if (vlan_tx_tag_present(skb)) {
-               if (unlikely(!__vlan_put_tag(skb,
-                                               skb->vlan_proto,
-                                               vlan_tx_tag_get(skb))))
+               if (unlikely(!vlan_insert_tag_set_proto(skb,
+                                                       skb->vlan_proto,
+                                                       vlan_tx_tag_get(skb))))
                        return -ENOMEM;
 
                vlan_set_tci(skb, 0);
index d54101e..86f90f5 100644 (file)
@@ -404,9 +404,9 @@ static int geneve_send(struct vport *vport, struct sk_buff *skb)
        }
 
        if (vlan_tx_tag_present(skb)) {
-               if (unlikely(!__vlan_put_tag(skb,
-                                            skb->vlan_proto,
-                                            vlan_tx_tag_get(skb)))) {
+               if (unlikely(!vlan_insert_tag_set_proto(skb,
+                                                       skb->vlan_proto,
+                                                       vlan_tx_tag_get(skb)))) {
                        err = -ENOMEM;
                        skb = NULL;
                        goto err_free_rt;
index daf7fc3..53df865 100644 (file)
@@ -175,9 +175,9 @@ static int __send(struct vport *vport, struct sk_buff *skb,
        }
 
        if (vlan_tx_tag_present(skb)) {
-               if (unlikely(!__vlan_put_tag(skb,
-                                            skb->vlan_proto,
-                                            vlan_tx_tag_get(skb)))) {
+               if (unlikely(!vlan_insert_tag_set_proto(skb,
+                                                       skb->vlan_proto,
+                                                       vlan_tx_tag_get(skb)))) {
                        err = -ENOMEM;
                        skb = NULL;
                        goto err_free_rt;
index a1c4949..997bb3f 100644 (file)
@@ -250,9 +250,9 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
        if (vlan_tx_tag_present(skb)) {
-               if (unlikely(!__vlan_put_tag(skb,
-                                            skb->vlan_proto,
-                                            vlan_tx_tag_get(skb))))
+               if (unlikely(!vlan_insert_tag_set_proto(skb,
+                                                       skb->vlan_proto,
+                                                       vlan_tx_tag_get(skb))))
                        return 0;
 
                if (skb->ip_summed == CHECKSUM_COMPLETE)