Skip to content

Commit

Permalink
compat: Fix upstream 4.4.119 kernel
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gvrose8192 authored and pshelar committed May 9, 2018
1 parent b37bef8 commit f0513c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion acinclude.m4
Expand Up @@ -482,7 +482,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
[iptunnel_pull_offloads],
[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/linux/net.h], [sock_create_kern.*net],
[OVS_DEFINE([HAVE_SOCK_CREATE_KERN_NET])])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [ndo_fill_metadata_dst])
Expand Down
2 changes: 2 additions & 0 deletions datapath/linux/compat/dst_cache.c
Expand Up @@ -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>
Expand Down Expand Up @@ -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 */
5 changes: 5 additions & 0 deletions 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)
Expand Down Expand Up @@ -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

0 comments on commit f0513c1

Please sign in to comment.