summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--acinclude.m42
-rw-r--r--datapath/linux/compat/dst_cache.c2
-rw-r--r--datapath/linux/compat/include/net/dst_cache.h5
3 files changed, 9 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index dd264b39a..60186d33d 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 <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 */
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 <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