[ovs-dev] [PATCH] datapath: Add support for Linux 3.11

Pravin B Shelar pshelar at nicira.com
Mon Oct 14 22:26:40 UTC 2013


Kernel 3.11 has support for extended GRE API required for
OVS datapath,  But vxlan still needs out of tree tunneling
compatibility.  Therefore to simplify, all tunneling modules
are forced to use compat tunneling.

CC: James Page <james.page at ubuntu.com>
Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
---
 FAQ                                             |    2 +-
 NEWS                                            |    2 +-
 acinclude.m4                                    |    4 ++--
 datapath/dp_notify.c                            |    2 +-
 datapath/linux/compat/include/linux/netdevice.h |    7 +++++++
 datapath/linux/compat/include/net/gre.h         |    6 ++++++
 6 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/FAQ b/FAQ
index d36495c..e904d35 100644
--- a/FAQ
+++ b/FAQ
@@ -148,7 +148,7 @@ A: The following table lists the Linux kernel versions against which the
        1.9.x      2.6.18 to 3.8
        1.10.x     2.6.18 to 3.8
        1.11.x     2.6.18 to 3.8
-       2.0.x      2.6.32 to 3.10
+       2.0.x      2.6.32 to 3.11
 
    Open vSwitch userspace should also work with the Linux kernel module
    built into Linux 3.3 and later.
diff --git a/NEWS b/NEWS
index 94e0da9..c8b9a21 100644
--- a/NEWS
+++ b/NEWS
@@ -33,7 +33,7 @@ v2.0.0 - xx xxx xxxx
       through database paths (e.g. Private key option with the database name
       should look like "--private-key=db:Open_vSwitch,SSL,private_key").
     - Added ovs-dev.py, a utility script helpful for Open vSwitch developers.
-    - Support for Linux kernels up to 3.10
+    - Support for Linux kernels up to 3.11
     - ovs-ofctl:
       * New "ofp-parse" for printing OpenFlow messages read from a file.
       * New commands for OpenFlow 1.1+ groups.
diff --git a/acinclude.m4 b/acinclude.m4
index c293d33..f987fa0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -134,10 +134,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
     AC_MSG_RESULT([$kversion])
 
     if test "$version" -ge 3; then
-       if test "$version" = 3 && test "$patchlevel" -le 10; then
+       if test "$version" = 3 && test "$patchlevel" -le 11; then
           : # Linux 3.x
        else
-         AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.10.x is not supported])
+         AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.11.x is not supported])
        fi
     else
        if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then
diff --git a/datapath/dp_notify.c b/datapath/dp_notify.c
index b5178fc..2f2145e 100644
--- a/datapath/dp_notify.c
+++ b/datapath/dp_notify.c
@@ -79,7 +79,7 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
 			   void *ptr)
 {
 	struct ovs_net *ovs_net;
-	struct net_device *dev = ptr;
+	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
 	struct vport *vport = NULL;
 
 	if (!ovs_is_internal_dev(dev))
diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h
index 2b2c855..4df5515 100644
--- a/datapath/linux/compat/include/linux/netdevice.h
+++ b/datapath/linux/compat/include/linux/netdevice.h
@@ -125,4 +125,11 @@ static inline void netdev_upper_dev_unlink(struct net_device *dev,
 int dev_queue_xmit(struct sk_buff *skb);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
+static inline struct net_device *netdev_notifier_info_to_dev(void *info)
+{
+	return info;
+}
+#endif
+
 #endif
diff --git a/datapath/linux/compat/include/net/gre.h b/datapath/linux/compat/include/net/gre.h
index 5f46aed..5b17dcc 100644
--- a/datapath/linux/compat/include/net/gre.h
+++ b/datapath/linux/compat/include/net/gre.h
@@ -74,12 +74,17 @@ static inline __be16 tnl_flags_to_gre_flags(__be16 tflags)
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */
 
 #define MAX_GRE_PROTO_PRIORITY 255
+#define gre_cisco_protocol rpl_gre_cisco_protocol
+
 struct gre_cisco_protocol {
 	int (*handler)(struct sk_buff *skb, const struct tnl_ptk_info *tpi);
 	u8 priority;
 };
 
+#define gre_cisco_register rpl_gre_cisco_register
 int gre_cisco_register(struct gre_cisco_protocol *proto);
+
+#define gre_cisco_unregister rpl_gre_cisco_unregister
 int gre_cisco_unregister(struct gre_cisco_protocol *proto);
 
 #define gre_build_header rpl_gre_build_header
@@ -89,6 +94,7 @@ void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
 #define gre_handle_offloads rpl_gre_handle_offloads
 struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum);
 
+#define ip_gre_calc_hlen rpl_ip_gre_calc_hlen
 static inline int ip_gre_calc_hlen(__be16 o_flags)
 {
 	int addend = 4;
-- 
1.7.1




More information about the dev mailing list