]> git.proxmox.com Git - ovs.git/commitdiff
datapath: Use kernel Geneve implementation on 4.0 and above.
authorJesse Gross <jesse@nicira.com>
Sun, 26 Apr 2015 00:00:11 +0000 (17:00 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 27 Apr 2015 03:57:38 +0000 (20:57 -0700)
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 <alexw@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
datapath/linux/compat/geneve.c
datapath/linux/compat/include/net/geneve.h

index 9ec161c67b68261779a46edd34250ac841204645..78d339541632817a9371b5a60f6d2f5054cff6c0 100644 (file)
@@ -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>
@@ -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 */
index 452dddbc3c65803efd713414680e412f794df02f..58f5def99f3171c979ce60687c180e8fef442bd3 100644 (file)
@@ -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
@@ -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 */