]> git.proxmox.com Git - ovs.git/commitdiff
compat: Fix upstream 4.4.119 kernel
authorGreg Rose <gvrose8192@gmail.com>
Fri, 20 Apr 2018 18:13:07 +0000 (11:13 -0700)
committerPravin B Shelar <pshelar@ovn.org>
Wed, 9 May 2018 00:26:43 +0000 (17:26 -0700)
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 <gvrose8192@gmail.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
acinclude.m4
datapath/linux/compat/dst_cache.c
datapath/linux/compat/include/net/dst_cache.h

index e27fc66e337f88d810e11e79ae5fca99a6803cb4..76f64381f2ad2277c763e1a3e453dfe3d79fb57d 100644 (file)
@@ -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],
index b93651670b082d9fe418fbbac8bdd7e76367af30..45990cba778debc52066b694d48b2f4b2e3ad831 100644 (file)
@@ -9,6 +9,7 @@
  * (at your option) any later version.
  */
 
+#ifndef USE_BUILTIN_DST_CACHE
 #include <linux/kernel.h>
 #include <linux/percpu.h>
 #include <net/dst_cache.h>
@@ -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 */
index ff4d83b83f0d16daf62f8bb1d61d35015b27bb9f..6084d4eea43f1cbdeb04b759e38a021ead0e0213 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _NET_DST_CACHE_WRAPPER_H
 #define _NET_DST_CACHE_WRAPPER_H
 
+#ifdef USE_BUILTIN_DST_CACHE
+#include_next <net/dst_cache.h>
+#else
+
 #include <linux/jiffies.h>
 #include <net/dst.h>
 #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