Signed-off-by: Pravin B Shelar <pshe...@ovn.org> --- datapath/linux/compat/include/net/udp.h | 2 +- datapath/linux/compat/udp.c | 19 ++----------------- datapath/linux/compat/udp_tunnel.c | 17 +---------------- 3 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/datapath/linux/compat/include/net/udp.h b/datapath/linux/compat/include/net/udp.h index 266e70a..4479992 100644 --- a/datapath/linux/compat/include/net/udp.h +++ b/datapath/linux/compat/include/net/udp.h @@ -54,7 +54,7 @@ static inline __sum16 udp_v4_check(int len, __be32 saddr, } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +#ifndef USE_UPSTREAM_TUNNEL #define udp_set_csum rpl_udp_set_csum void rpl_udp_set_csum(bool nocheck, struct sk_buff *skb, __be32 saddr, __be32 daddr, int len); diff --git a/datapath/linux/compat/udp.c b/datapath/linux/compat/udp.c index 4cd22fa..dbeb307 100644 --- a/datapath/linux/compat/udp.c +++ b/datapath/linux/compat/udp.c @@ -1,6 +1,6 @@ #include <linux/version.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +#ifndef USE_UPSTREAM_TUNNEL #include <net/udp.h> @@ -16,28 +16,13 @@ void rpl_udp_set_csum(bool nocheck, struct sk_buff *skb, uh->check = 0; else if (skb_is_gso(skb)) uh->check = ~udp_v4_check(len, saddr, daddr, 0); - else if (skb_dst(skb) && skb_dst(skb)->dev && - (skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) { - + else { BUG_ON(skb->ip_summed == CHECKSUM_PARTIAL); skb->ip_summed = CHECKSUM_PARTIAL; skb->csum_start = skb_transport_header(skb) - skb->head; skb->csum_offset = offsetof(struct udphdr, check); uh->check = ~udp_v4_check(len, saddr, daddr, 0); - } else { - int l4_offset = skb_transport_offset(skb); - __wsum csum; - - BUG_ON(skb->ip_summed == CHECKSUM_PARTIAL); - - uh->check = 0; - csum = skb_checksum(skb, l4_offset, len, 0); - uh->check = udp_v4_check(len, saddr, daddr, csum); - if (uh->check == 0) - uh->check = CSUM_MANGLED_0; - - skb->ip_summed = CHECKSUM_UNNECESSARY; } } EXPORT_SYMBOL_GPL(rpl_udp_set_csum); diff --git a/datapath/linux/compat/udp_tunnel.c b/datapath/linux/compat/udp_tunnel.c index 9cf7286..c7ceaab 100644 --- a/datapath/linux/compat/udp_tunnel.c +++ b/datapath/linux/compat/udp_tunnel.c @@ -193,28 +193,13 @@ static void udp6_set_csum(bool nocheck, struct sk_buff *skb, uh->check = 0; else if (skb_is_gso(skb)) uh->check = ~udp_v6_check(len, saddr, daddr, 0); - else if (skb_dst(skb) && skb_dst(skb)->dev && - (skb_dst(skb)->dev->features & NETIF_F_IPV6_CSUM)) { - + else { BUG_ON(skb->ip_summed == CHECKSUM_PARTIAL); skb->ip_summed = CHECKSUM_PARTIAL; skb->csum_start = skb_transport_header(skb) - skb->head; skb->csum_offset = offsetof(struct udphdr, check); uh->check = ~udp_v6_check(len, saddr, daddr, 0); - } else { - int l4_offset = skb_transport_offset(skb); - __wsum csum; - - BUG_ON(skb->ip_summed == CHECKSUM_PARTIAL); - - uh->check = 0; - csum = skb_checksum(skb, l4_offset, len, 0); - uh->check = udp_v6_check(len, saddr, daddr, csum); - if (uh->check == 0) - uh->check = CSUM_MANGLED_0; - - skb->ip_summed = CHECKSUM_UNNECESSARY; } } -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev