[ovs-dev] [PATCH 1/7] datapath: Account for rename to vlan_insert_tag_set_proto()

Thomas Graf tgraf at noironetworks.com
Tue Dec 30 00:19:58 UTC 2014


__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 at noironetworks.com>
---
 acinclude.m4                                  | 1 +
 datapath/actions.c                            | 2 +-
 datapath/datapath.c                           | 2 +-
 datapath/linux/compat/gso.c                   | 4 ++--
 datapath/linux/compat/include/linux/if_vlan.h | 6 ++++++
 datapath/vport-geneve.c                       | 6 +++---
 datapath/vport-gre.c                          | 6 +++---
 datapath/vport-internal_dev.c                 | 6 +++---
 8 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 3121b09..05dc112 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -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])
 
diff --git a/datapath/actions.c b/datapath/actions.c
index 5a1dbe2..9a49cd5 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -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;
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 3607170..ebab68c 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -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;
 
diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
index 5079f79..56f9493 100644
--- a/datapath/linux/compat/gso.c
+++ b/datapath/linux/compat/gso.c
@@ -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);
diff --git a/datapath/linux/compat/include/linux/if_vlan.h b/datapath/linux/compat/include/linux/if_vlan.h
index 730175b..e3456ac 100644
--- a/datapath/linux/compat/include/linux/if_vlan.h
+++ b/datapath/linux/compat/include/linux/if_vlan.h
@@ -5,6 +5,10 @@
 #include <linux/version.h>
 #include_next <linux/if_vlan.h>
 
+#ifndef HAVE_VLAN_INSERT_TAG_SET_PROTO
+#define vlan_insert_tag_set_proto __vlan_put_tag
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 /*
  * The behavior of __vlan_put_tag() has changed over time:
@@ -16,6 +20,8 @@
  *
  *      - 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.
diff --git a/datapath/vport-geneve.c b/datapath/vport-geneve.c
index d54101e..86f90f5 100644
--- a/datapath/vport-geneve.c
+++ b/datapath/vport-geneve.c
@@ -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;
diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
index daf7fc3..53df865 100644
--- a/datapath/vport-gre.c
+++ b/datapath/vport-gre.c
@@ -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;
diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index a1c4949..997bb3f 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -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)
-- 
1.9.3




More information about the dev mailing list