datapath: compat: Fix compilation 3.11
authorPravin B Shelar <pshelar@nicira.com>
Mon, 13 Oct 2014 09:02:44 +0000 (02:02 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Mon, 13 Oct 2014 18:03:40 +0000 (11:03 -0700)
Kernel 3.11 is only kernel where GRE APIs are available but
not vxlan. Add check for vxlan xmit to detect this case.

Reported-by: Dave Benson <dbenson@verdantnetworks.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
acinclude.m4
datapath/linux/compat/gre.c
datapath/linux/compat/include/net/gre.h
datapath/linux/compat/include/net/ip_tunnels.h
datapath/linux/compat/include/net/vxlan.h
datapath/linux/compat/ip_tunnels_core.c
datapath/linux/compat/vxlan.c

index c1dd90b..96b28c0 100644 (file)
@@ -325,6 +325,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be32])
   OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be64])
   OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_find_nested])
+  OVS_GREP_IFELSE([$KSRC/include/net/vxlan.h], [vxlan_xmit_skb])
 
   OVS_GREP_IFELSE([$KSRC/include/net/sctp/checksum.h], [sctp_compute_cksum])
 
index de3d6eb..c7f2551 100644 (file)
@@ -268,7 +268,7 @@ int gre_cisco_unregister(struct gre_cisco_protocol *proto)
 
 #endif /* !HAVE_GRE_CISCO_REGISTER */
 
-#ifndef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
+#ifndef USE_KERNEL_TUNNEL_API
 
 /* GRE TX side. */
 static void gre_csum_fix(struct sk_buff *skb)
index f091b32..b4bf2f1 100644 (file)
@@ -81,7 +81,7 @@ static inline __be16 tnl_flags_to_gre_flags(__be16 tflags)
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */
 #endif /* HAVE_GRE_CISCO_REGISTER */
 
-#ifndef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
+#ifndef USE_KERNEL_TUNNEL_API
 
 #define gre_build_header rpl_gre_build_header
 void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
index 4e406ef..4fc4fb4 100644 (file)
@@ -3,14 +3,15 @@
 
 #include <linux/version.h>
 #if defined(HAVE_GRE_HANDLE_OFFLOADS) && \
-     LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+     LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && \
+     defined(HAVE_VXLAN_XMIT_SKB)
 /* RHEL6 and RHEL7 both has backported tunnel API but RHEL6 has
  * older version, so avoid using RHEL6 backports.
  */
-#define GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
+#define USE_KERNEL_TUNNEL_API
 #endif
 
-#ifdef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
+#ifdef USE_KERNEL_TUNNEL_API
 #include_next <net/ip_tunnels.h>
 static inline int rpl_iptunnel_xmit(struct rtable *rt,
                                     struct sk_buff *skb, __be32 src,
index 0f0ff16..23877ad 100644 (file)
@@ -7,7 +7,7 @@
 #include <net/gre.h>
 
 #include <linux/version.h>
-#ifdef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
+#ifdef USE_KERNEL_TUNNEL_API
 #include_next <net/vxlan.h>
 
 static inline int rpl_vxlan_xmit_skb(struct vxlan_sock *vs,
index eb0380e..0e122c6 100644 (file)
@@ -36,7 +36,7 @@
 #include "compat.h"
 #include "gso.h"
 
-#ifndef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
+#ifndef USE_KERNEL_TUNNEL_API
 int iptunnel_xmit(struct rtable *rt,
                  struct sk_buff *skb,
                  __be32 src, __be32 dst, __u8 proto,
index 5f2c0b3..b86eb4d 100644 (file)
@@ -58,7 +58,7 @@
 #include "datapath.h"
 #include "gso.h"
 #include "vlan.h"
-#ifndef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
+#ifndef USE_KERNEL_TUNNEL_API
 
 #define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr))