[ovs-dev] [PATCH v4 2/2] datapath: use skb_clear_hash instead of skb_clear_rxhash.

Pritesh Kothari pritesh.kothari at cisco.com
Tue Apr 22 21:08:57 UTC 2014


Signed-off-by: Pritesh Kothari <pritesh.kothari at cisco.com>
---
 acinclude.m4                                 |  1 +
 datapath/actions.c                           | 10 +++++-----
 datapath/linux/compat/include/linux/skbuff.h |  4 ++++
 datapath/linux/compat/ip_tunnels_core.c      |  4 ++--
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 06983cb..d40ee13 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -292,6 +292,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_reset_mac_len])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_unclone])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_get_hash])
+  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_clear_hash])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/types.h], [bool],
                   [OVS_DEFINE([HAVE_BOOL_TYPE])])
diff --git a/datapath/actions.c b/datapath/actions.c
index b91bc8b..96cab80 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -166,7 +166,7 @@ static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh,
 	}
 
 	csum_replace4(&nh->check, *addr, new_addr);
-	skb_clear_rxhash(skb);
+	skb_clear_hash(skb);
 	*addr = new_addr;
 }
 
@@ -200,7 +200,7 @@ static void set_ipv6_addr(struct sk_buff *skb, u8 l4_proto,
 	if (recalculate_csum)
 		update_ipv6_checksum(skb, l4_proto, addr, new_addr);
 
-	skb_clear_rxhash(skb);
+	skb_clear_hash(skb);
 	memcpy(addr, new_addr, sizeof(__be32[4]));
 }
 
@@ -297,7 +297,7 @@ static void set_tp_port(struct sk_buff *skb, __be16 *port,
 {
 	inet_proto_csum_replace2(check, skb, *port, new_port, 0);
 	*port = new_port;
-	skb_clear_rxhash(skb);
+	skb_clear_hash(skb);
 }
 
 static void set_udp_port(struct sk_buff *skb, __be16 *port, __be16 new_port)
@@ -311,7 +311,7 @@ static void set_udp_port(struct sk_buff *skb, __be16 *port, __be16 new_port)
 			uh->check = CSUM_MANGLED_0;
 	} else {
 		*port = new_port;
-		skb_clear_rxhash(skb);
+		skb_clear_hash(skb);
 	}
 }
 
@@ -382,7 +382,7 @@ static int set_sctp(struct sk_buff *skb,
 		/* Carry any checksum errors through. */
 		sh->checksum = old_csum ^ old_correct_csum ^ new_csum;
 
-		skb_clear_rxhash(skb);
+		skb_clear_hash(skb);
 	}
 
 	return 0;
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index b0d0190..f47ccfe 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -280,6 +280,10 @@ int skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len,
 #define skb_get_hash skb_get_rxhash
 #endif
 
+#ifndef HAVE_SKB_CLEAR_HASH
+#define skb_clear_hash skb_clear_rxhash
+#endif
+
 #ifndef HAVE_SKB_HAS_FRAG_LIST
 #define skb_has_frag_list skb_has_frags
 #endif
diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c
index 779075d..d650be2 100644
--- a/datapath/linux/compat/ip_tunnels_core.c
+++ b/datapath/linux/compat/ip_tunnels_core.c
@@ -48,7 +48,7 @@ int iptunnel_xmit(struct rtable *rt,
 
 	nf_reset(skb);
 	secpath_reset(skb);
-	skb_clear_rxhash(skb);
+	skb_clear_hash(skb);
 	skb_dst_drop(skb);
 	skb_dst_set(skb, &rt_dst(rt));
 #if 0
@@ -104,7 +104,7 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
 
 	nf_reset(skb);
 	secpath_reset(skb);
-	skb_clear_rxhash(skb);
+	skb_clear_hash(skb);
 	skb_dst_drop(skb);
 	vlan_set_tci(skb, 0);
 	skb_set_queue_mapping(skb, 0);
-- 
1.9.1




More information about the dev mailing list