From: Greg Rose Date: Fri, 20 Apr 2018 18:13:07 +0000 (-0700) Subject: compat: Fix upstream 4.4.119 kernel X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f86ff468866d6bbfc80fda0d2c3e51a6b56c4e15;p=ovs.git compat: Fix upstream 4.4.119 kernel The Linux 4.4.119 kernel (and perhaps others) from kernel.org backports some dst_cache code that breaks the openvswitch kernel due to a duplicated name "dst_cache_destroy". For most cases the "USE_UPSTREAM_TUNNEL" covers this but in this case the dst_cache feature needs to be separated out. Add the necessary compatibility detection layer in acinclude.m4 and then fixup the source files so that if the built-in kernel includes dst_cache support then exclude our own compatibility code. Signed-off-by: Greg Rose Acked-by: Pravin B Shelar --- diff --git a/acinclude.m4 b/acinclude.m4 index e27fc66e3..76f64381f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -533,6 +533,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_GREP_IFELSE([$KSRC/include/net/dst_cache.h], [dst_cache], [OVS_DEFINE([USE_UPSTREAM_TUNNEL])])])]) + OVS_GREP_IFELSE([$KSRC/include/net/dst_cache.h], [dst_cache], + [OVS_DEFINE([USE_BUILTIN_DST_CACHE])]) OVS_GREP_IFELSE([$KSRC/include/net/mpls.h], [mpls_hdr], [OVS_DEFINE([MPLS_HEADER_IS_L3])]) OVS_GREP_IFELSE([$KSRC/include/linux/net.h], [sock_create_kern.*net], diff --git a/datapath/linux/compat/dst_cache.c b/datapath/linux/compat/dst_cache.c index b93651670..45990cba7 100644 --- a/datapath/linux/compat/dst_cache.c +++ b/datapath/linux/compat/dst_cache.c @@ -9,6 +9,7 @@ * (at your option) any later version. */ +#ifndef USE_BUILTIN_DST_CACHE #include #include #include @@ -169,3 +170,4 @@ void rpl_dst_cache_destroy(struct dst_cache *dst_cache) } EXPORT_SYMBOL_GPL(rpl_dst_cache_destroy); #endif /*USE_UPSTREAM_TUNNEL */ +#endif /* USE_BUILTIN_DST_CACHE */ diff --git a/datapath/linux/compat/include/net/dst_cache.h b/datapath/linux/compat/include/net/dst_cache.h index ff4d83b83..6084d4eea 100644 --- a/datapath/linux/compat/include/net/dst_cache.h +++ b/datapath/linux/compat/include/net/dst_cache.h @@ -1,6 +1,10 @@ #ifndef _NET_DST_CACHE_WRAPPER_H #define _NET_DST_CACHE_WRAPPER_H +#ifdef USE_BUILTIN_DST_CACHE +#include_next +#else + #include #include #if IS_ENABLED(CONFIG_IPV6) @@ -106,4 +110,5 @@ int rpl_dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp); void rpl_dst_cache_destroy(struct dst_cache *dst_cache); #endif /* USE_UPSTREAM_TUNNEL */ +#endif /* USE_BUILTIN_DST_CACHE */ #endif