This macro is not required as we drop support for unsupported kernel versions.
Signed-off-by: Pravin B Shelar <pshe...@ovn.org> --- acinclude.m4 | 9 --------- datapath/compat.h | 5 ----- datapath/linux/compat/include/linux/netfilter_ipv6.h | 7 ------- datapath/linux/compat/include/net/inet_frag.h | 2 -- datapath/linux/compat/include/net/inetpeer.h | 5 ++--- datapath/linux/compat/include/net/ip.h | 20 ++------------------ datapath/linux/compat/include/net/ip6_route.h | 9 --------- datapath/linux/compat/include/net/ipv6.h | 2 +- .../include/net/netfilter/ipv6/nf_defrag_ipv6.h | 11 ----------- datapath/linux/compat/inet_fragment.c | 4 ++-- datapath/linux/compat/ip6_output.c | 4 ++-- datapath/linux/compat/ip_fragment.c | 4 ++-- datapath/linux/compat/reassembly.c | 6 +++--- 13 files changed, 14 insertions(+), 74 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 0ae6a81..78743d9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -551,15 +551,6 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/linux/utsrelease.h], [el6], [OVS_DEFINE([HAVE_RHEL6_PER_CPU])]) - dnl Conntrack support, and therefore, IP fragment handling backport, should - dnl only be enabled on kernels 3.10+. In future when OVS drops support for - dnl kernels older than 3.10, this macro could be removed from the codebase. - if test "$version" = 4; then - OVS_DEFINE([OVS_FRAGMENT_BACKPORT]) - elif test "$version" = 3 && test "$patchlevel" -ge 10; then - OVS_DEFINE([OVS_FRAGMENT_BACKPORT]) - fi - if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then rm datapath/linux/kcompat.h.new diff --git a/datapath/compat.h b/datapath/compat.h index 8bf779f..816f754 100644 --- a/datapath/compat.h +++ b/datapath/compat.h @@ -35,7 +35,6 @@ #define GROUP_ID(grp) 0 #endif -#ifdef OVS_FRAGMENT_BACKPORT #ifdef HAVE_NF_IPV6_OPS_FRAGMENT static inline int __init ip6_output_init(void) { return 0; } static inline void ip6_output_exit(void) { } @@ -74,9 +73,5 @@ static inline void compat_exit(void) nf_ct_frag6_cleanup(); rpl_ipfrag_fini(); } -#else -static inline int __init compat_init(void) { return 0; } -static inline void compat_exit(void) { } -#endif #endif /* compat.h */ diff --git a/datapath/linux/compat/include/linux/netfilter_ipv6.h b/datapath/linux/compat/include/linux/netfilter_ipv6.h index 3939e14..8d896fb 100644 --- a/datapath/linux/compat/include/linux/netfilter_ipv6.h +++ b/datapath/linux/compat/include/linux/netfilter_ipv6.h @@ -18,7 +18,6 @@ struct ovs_nf_ipv6_ops { }; #define nf_ipv6_ops ovs_nf_ipv6_ops -#if defined(OVS_FRAGMENT_BACKPORT) static struct ovs_nf_ipv6_ops ovs_ipv6_ops = { .fragment = ip6_fragment, }; @@ -27,12 +26,6 @@ static inline struct ovs_nf_ipv6_ops *ovs_nf_get_ipv6_ops(void) { return &ovs_ipv6_ops; } -#else /* !OVS_FRAGMENT_BACKPORT */ -static inline const struct ovs_nf_ipv6_ops *ovs_nf_get_ipv6_ops(void) -{ - return NULL; -} -#endif #define nf_get_ipv6_ops ovs_nf_get_ipv6_ops #endif /* HAVE_NF_IPV6_OPS_FRAGMENT */ diff --git a/datapath/linux/compat/include/net/inet_frag.h b/datapath/linux/compat/include/net/inet_frag.h index 606e952..aa9a019 100644 --- a/datapath/linux/compat/include/net/inet_frag.h +++ b/datapath/linux/compat/include/net/inet_frag.h @@ -13,7 +13,6 @@ } while (0) #endif -#ifdef OVS_FRAGMENT_BACKPORT #ifdef HAVE_INET_FRAGS_LAST_IN #define q_flags(q) (q->last_in) #define qp_flags(qp) (qp->q.last_in) @@ -80,6 +79,5 @@ void rpl_inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); void rpl_inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f); #define inet_frag_destroy(q, f, work) rpl_inet_frag_destroy(q, f) #endif /* !HAVE_CORRECT_MRU_HANDLING */ -#endif /* OVS_FRAGMENT_BACKPORT */ #endif /* inet_frag.h */ diff --git a/datapath/linux/compat/include/net/inetpeer.h b/datapath/linux/compat/include/net/inetpeer.h index c086f3b..c5f5eb1 100644 --- a/datapath/linux/compat/include/net/inetpeer.h +++ b/datapath/linux/compat/include/net/inetpeer.h @@ -3,8 +3,7 @@ #include_next <net/inetpeer.h> -#if defined(OVS_FRAGMENT_BACKPORT) && \ - !defined(HAVE_INETPEER_VIF_SUPPORT) +#ifndef HAVE_INETPEER_VIF_SUPPORT static inline struct inet_peer *rpl_inet_getpeer_v4(struct inet_peer_base *base, __be32 v4daddr, int vif, int create) @@ -12,6 +11,6 @@ static inline struct inet_peer *rpl_inet_getpeer_v4(struct inet_peer_base *base, return inet_getpeer_v4(base, v4daddr, create); } #define inet_getpeer_v4 rpl_inet_getpeer_v4 -#endif /* OVS_FRAGMENT_BACKPORT */ +#endif /* HAVE_INETPEER_VIF_SUPPORT */ #endif /* _NET_INETPEER_WRAPPER_H */ diff --git a/datapath/linux/compat/include/net/ip.h b/datapath/linux/compat/include/net/ip.h index cd87bcc..c544b33 100644 --- a/datapath/linux/compat/include/net/ip.h +++ b/datapath/linux/compat/include/net/ip.h @@ -77,7 +77,7 @@ static inline unsigned int rpl_ip_skb_dst_mtu(const struct sk_buff *skb) * correctly, which would lead to reassembled packets not being refragmented. * So, we backport all of ip_defrag() in these cases. */ -#if !defined(HAVE_CORRECT_MRU_HANDLING) && defined(OVS_FRAGMENT_BACKPORT) +#ifndef HAVE_CORRECT_MRU_HANDLING #if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) static inline bool ip_defrag_user_in_between(u32 user, @@ -119,25 +119,9 @@ static inline int rpl_ip_do_fragment(struct sock *sk, struct sk_buff *skb, int rpl_ip_defrag(struct sk_buff *skb, u32 user); #define ip_defrag rpl_ip_defrag +#endif /* HAVE_CORRECT_MRU_HANDLING */ int __init rpl_ipfrag_init(void); void rpl_ipfrag_fini(void); -#else /* HAVE_CORRECT_MRU_HANDLING || !OVS_FRAGMENT_BACKPORT */ - -/* We have no good way to detect the presence of upstream commit 8282f27449bf - * ("inet: frag: Always orphan skbs inside ip_defrag()"), but it should be - * always included in kernels 4.5+. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) -static inline int rpl_ip_defrag(struct sk_buff *skb, u32 user) -{ - skb_orphan(skb); - return ip_defrag(skb, user); -} -#define ip_defrag rpl_ip_defrag -#endif - -static inline int rpl_ipfrag_init(void) { return 0; } -static inline void rpl_ipfrag_fini(void) { } -#endif /* HAVE_CORRECT_MRU_HANDLING && OVS_FRAGMENT_BACKPORT */ #define ipfrag_init rpl_ipfrag_init #define ipfrag_fini rpl_ipfrag_fini diff --git a/datapath/linux/compat/include/net/ip6_route.h b/datapath/linux/compat/include/net/ip6_route.h index 16027e4..e49ca39 100644 --- a/datapath/linux/compat/include/net/ip6_route.h +++ b/datapath/linux/compat/include/net/ip6_route.h @@ -31,17 +31,8 @@ struct dst_entry *rpl_ip6_route_output(struct net *net, const struct sock *sk, #endif /* 2.6.39 */ #ifndef HAVE_NF_IPV6_OPS_FRAGMENT -#ifdef OVS_FRAGMENT_BACKPORT int rpl_ip6_fragment(struct sock *sk, struct sk_buff *skb, int (*output)(OVS_VPORT_OUTPUT_PARAMS)); -#else -static inline int rpl_ip6_fragment(struct sock *sk, struct sk_buff *skb, - int (*output)(struct sk_buff *)) -{ - kfree_skb(skb); - return -ENOTSUPP; -} -#endif /* OVS_FRAGMENT_BACKPORT */ #define ip6_fragment rpl_ip6_fragment #endif /* HAVE_NF_IPV6_OPS_FRAGMENT */ diff --git a/datapath/linux/compat/include/net/ipv6.h b/datapath/linux/compat/include/net/ipv6.h index 30b5061..ac1564b 100644 --- a/datapath/linux/compat/include/net/ipv6.h +++ b/datapath/linux/compat/include/net/ipv6.h @@ -47,7 +47,7 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a) } #endif -#if defined(OVS_FRAGMENT_BACKPORT) && !defined(HAVE___IPV6_ADDR_JHASH) +#ifndef HAVE___IPV6_ADDR_JHASH static inline u32 __ipv6_addr_jhash(const struct in6_addr *a, const u32 unused) { return ipv6_addr_jhash(a); diff --git a/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h index 97052cc..416caff 100644 --- a/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h +++ b/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h @@ -13,22 +13,11 @@ */ #if defined(HAVE_NF_CT_FRAG6_CONSUME_ORIG) || \ defined(HAVE_NF_CT_FRAG6_OUTPUT) -#if defined(OVS_FRAGMENT_BACKPORT) #define OVS_NF_DEFRAG6_BACKPORT 1 struct sk_buff *rpl_nf_ct_frag6_gather(struct sk_buff *skb, u32 user); int __init rpl_nf_ct_frag6_init(void); void rpl_nf_ct_frag6_cleanup(void); void rpl_nf_ct_frag6_consume_orig(struct sk_buff *skb); -#else /* !OVS_FRAGMENT_BACKPORT */ -static inline struct sk_buff *rpl_nf_ct_frag6_gather(struct sk_buff *skb, - u32 user) -{ - return skb; -} -static inline int __init rpl_nf_ct_frag6_init(void) { return 0; } -static inline void rpl_nf_ct_frag6_cleanup(void) { } -static inline void rpl_nf_ct_frag6_consume_orig(struct sk_buff *skb) { } -#endif /* OVS_FRAGMENT_BACKPORT */ #define nf_ct_frag6_gather rpl_nf_ct_frag6_gather #else /* HAVE_NF_CT_FRAG6_CONSUME_ORIG */ static inline int __init rpl_nf_ct_frag6_init(void) { return 0; } diff --git a/datapath/linux/compat/inet_fragment.c b/datapath/linux/compat/inet_fragment.c index 10db99f..4479450 100644 --- a/datapath/linux/compat/inet_fragment.c +++ b/datapath/linux/compat/inet_fragment.c @@ -13,7 +13,7 @@ #include <linux/version.h> -#if !defined(HAVE_CORRECT_MRU_HANDLING) && defined(OVS_FRAGMENT_BACKPORT) +#ifndef HAVE_CORRECT_MRU_HANDLING #include <linux/list.h> #include <linux/spinlock.h> @@ -557,4 +557,4 @@ void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, net_dbg_ratelimited("%s%s", prefix, msg); } -#endif /* !HAVE_CORRECT_MRU_HANDLING && OVS_FRAGMENT_BACKPORT */ +#endif /* !HAVE_CORRECT_MRU_HANDLING */ diff --git a/datapath/linux/compat/ip6_output.c b/datapath/linux/compat/ip6_output.c index c3ef46c..6888842 100644 --- a/datapath/linux/compat/ip6_output.c +++ b/datapath/linux/compat/ip6_output.c @@ -31,7 +31,7 @@ #include <linux/version.h> -#if !defined(HAVE_NF_IPV6_OPS_FRAGMENT) && defined(OVS_FRAGMENT_BACKPORT) +#ifndef HAVE_NF_IPV6_OPS_FRAGMENT #include <linux/errno.h> #include <linux/kernel.h> @@ -467,4 +467,4 @@ void ip6_output_exit(void) kfree(ip_idents); } -#endif /* OVS_FRAGMENT_BACKPORT */ +#endif /* !HAVE_NF_IPV6_OPS_FRAGMENT */ diff --git a/datapath/linux/compat/ip_fragment.c b/datapath/linux/compat/ip_fragment.c index cf2daaa..66b56aa 100644 --- a/datapath/linux/compat/ip_fragment.c +++ b/datapath/linux/compat/ip_fragment.c @@ -25,7 +25,7 @@ #include <linux/version.h> -#if !defined(HAVE_CORRECT_MRU_HANDLING) && defined(OVS_FRAGMENT_BACKPORT) +#ifndef HAVE_CORRECT_MRU_HANDLING #define pr_fmt(fmt) "IPv4: " fmt @@ -747,4 +747,4 @@ void rpl_ipfrag_fini(void) unregister_pernet_subsys(&ip4_frags_ops); } -#endif /* !HAVE_CORRECT_MRU_HANDLING && OVS_FRAGMENT_BACKPORT */ +#endif /* !HAVE_CORRECT_MRU_HANDLING */ diff --git a/datapath/linux/compat/reassembly.c b/datapath/linux/compat/reassembly.c index 716d875..d40ba73 100644 --- a/datapath/linux/compat/reassembly.c +++ b/datapath/linux/compat/reassembly.c @@ -32,8 +32,8 @@ #define pr_fmt(fmt) "IPv6: " fmt -#if defined(OVS_FRAGMENT_BACKPORT) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) +#include <linux/version.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) #include <linux/errno.h> #include <linux/types.h> @@ -107,4 +107,4 @@ out: inet_frag_put(&fq->q, frags); } -#endif /* OVS_FRAGMENT_BACKPORT */ +#endif -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev