Skip to content

Commit

Permalink
datapath: Use kernel Geneve implementation on 4.0 and above.
Browse files Browse the repository at this point in the history
When Geneve was originally backported, it wasn't available as part
of a released kernel version but it is now, so we can take advantage
of the native implementation.

Note that Geneve was actually first available as part of the 3.18
kernel release but some drivers erroreously try to offload it as
if it were VXLAN, which was fixed in the 4.0 release. Since our
UDP tunnel compat layer already takes care of this, we continue
using the OVS Geneve implementation until 4.0.

Reported-by: Alex Wang <[email protected]>
Signed-off-by: Jesse Gross <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
  • Loading branch information
jessegross committed Apr 27, 2015
1 parent 7cbbd7a commit 15c69d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datapath/linux/compat/geneve.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/module.h>
Expand Down Expand Up @@ -242,3 +245,5 @@ void rpl_geneve_sock_release(struct geneve_sock *gs)
call_rcu(&gs->rcu, rcu_free_gs);
}
EXPORT_SYMBOL_GPL(rpl_geneve_sock_release);

#endif /* kernel < 4.0 */
8 changes: 8 additions & 0 deletions datapath/linux/compat/include/net/geneve.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#ifndef __NET_GENEVE_WRAPPER_H
#define __NET_GENEVE_WRAPPER_H 1

#include <linux/version.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
#include_next <net/geneve.h>
#else

#ifdef CONFIG_INET
#include <net/udp_tunnel.h>
#endif
Expand Down Expand Up @@ -93,4 +99,6 @@ int rpl_geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt,
bool csum, bool xnet);
#endif /*ifdef CONFIG_INET */

#endif /* kernel < 4.0 */

#endif /*ifdef__NET_GENEVE_WRAPPER_H */

0 comments on commit 15c69d2

Please sign in to comment.