diff mbox series

[ovs-dev] porting: Add fixes to support kernel 4.15.x

Message ID 1534421212-6691-1-git-send-email-pkusunyifeng@gmail.com
State Superseded
Headers show
Series [ovs-dev] porting: Add fixes to support kernel 4.15.x | expand

Commit Message

Yifeng Sun Aug. 16, 2018, 12:06 p.m. UTC
This patch enables OVS kernel module to run on kernel 4.15.x.
Two conntrack-related tests failed:
 - conntrack - multiple zones, local
 - conntrack - multi-stage pipeline, local
This might be due to conntrack policy changes for packets coming
from local ports on kernel 4.15. More survey will be done later.

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
---
 acinclude.m4                  |  6 ++++--
 datapath/linux/compat/vxlan.c | 10 ++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

Comments

Gregory Rose Aug. 16, 2018, 6:14 p.m. UTC | #1
On 8/16/2018 5:06 AM, Yifeng Sun wrote:
> This patch enables OVS kernel module to run on kernel 4.15.x.
> Two conntrack-related tests failed:
>   - conntrack - multiple zones, local
>   - conntrack - multi-stage pipeline, local
> This might be due to conntrack policy changes for packets coming
> from local ports on kernel 4.15. More survey will be done later.
>
> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> ---
>   acinclude.m4                  |  6 ++++--
>   datapath/linux/compat/vxlan.c | 10 ++++++++++
>   2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index 6e7ea4c..9fffe9c 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -151,10 +151,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
>       AC_MSG_RESULT([$kversion])
>   
>       if test "$version" -ge 4; then
> -       if test "$version" = 4 && test "$patchlevel" -le 14; then
> +       if test "$version" = 4 && test "$patchlevel" -le 15; then
>             : # Linux 4.x
>          else
> -          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.14.x is not supported (please refer to the FAQ for advice)])
> +          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.15.x is not supported (please refer to the FAQ for advice)])
>          fi
>       elif test "$version" = 3 && test "$patchlevel" -ge 10; then
>          : # Linux 3.x
> @@ -883,6 +883,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
>     OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h],
>                     [void.*ndo_get_stats64],
>                     [OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])])
> +  OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable],
> +                  [OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])])
>   
>     if cmp -s datapath/linux/kcompat.h.new \
>               datapath/linux/kcompat.h >/dev/null 2>&1; then
> diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
> index 8f5a921..b38a7be 100644
> --- a/datapath/linux/compat/vxlan.c
> +++ b/datapath/linux/compat/vxlan.c
> @@ -1275,9 +1275,15 @@ netdev_tx_t rpl_vxlan_xmit(struct sk_buff *skb)
>   EXPORT_SYMBOL_GPL(rpl_vxlan_xmit);
>   
>   /* Walk the forwarding table and purge stale entries */
> +#ifdef HAVE_INIT_TIMER_DEFERRABLE
>   static void vxlan_cleanup(unsigned long arg)
>   {
>   	struct vxlan_dev *vxlan = (struct vxlan_dev *) arg;
> +#else
> +static void vxlan_cleanup(struct timer_list *t)
> +{
> +       struct vxlan_dev *vxlan = from_timer(vxlan, t, age_timer);
> +#endif
>   	unsigned long next_timer = jiffies + FDB_AGE_INTERVAL;
>   	unsigned int h;
>   
> @@ -1638,9 +1644,13 @@ static void vxlan_setup(struct net_device *dev)
>   	INIT_LIST_HEAD(&vxlan->next);
>   	spin_lock_init(&vxlan->hash_lock);
>   
> +#ifdef HAVE_INIT_TIMER_DEFERRABLE
>   	init_timer_deferrable(&vxlan->age_timer);
>   	vxlan->age_timer.function = vxlan_cleanup;
>   	vxlan->age_timer.data = (unsigned long) vxlan;
> +#else
> +	timer_setup(&vxlan->age_timer, vxlan_cleanup, TIMER_DEFERRABLE);
> +#endif
>   
>   	vxlan->cfg.dst_port = htons(vxlan_port);
>   

Hi Yifeng,

thanks for the patch!  It works fine for enabling the 4.15 kernel. 
However, we usually also update the
Travis configuration file as at this time and then update the faq in 
Documentation/faq/releases.rst.

How about the following incremental?

diff --git a/.travis.yml b/.travis.yml
index 4d7bbd8..998b33d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,11 +35,11 @@ env:
    - BUILD_ENV="-m32" OPTS="--disable-ssl"
    - KERNEL=3.16.54 DPDK=1
    - KERNEL=3.16.54 DPDK=1 OPTS="--enable-shared"
-  - KERNEL=4.14.47
-  - KERNEL=4.9.105
-  - KERNEL=4.4.135
-  - KERNEL=4.1.52
-  - KERNEL=3.16.56
+  - KERNEL=4.15.18
+  - KERNEL=4.14.63
+  - KERNEL=4.9.120
+  - KERNEL=4.4.148
+  - KERNEL=3.16.57
    - TESTSUITE=1 LIBS=-ljemalloc

  matrix:
diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst
index 50ca5f6..54c4b54 100644
--- a/Documentation/faq/releases.rst
+++ b/Documentation/faq/releases.rst
@@ -67,7 +67,7 @@ Q: What Linux kernel versions does each Open vSwitch 
release w
      2.7.x        3.10 to 4.9
      2.8.x        3.10 to 4.12
      2.9.x        3.10 to 4.13
-    2.10.x       3.10 to 4.14
+    2.10.x       3.10 to 4.15
      ============ ==============

      Open vSwitch userspace should also work with the Linux kernel 
module built

Thanks,

- Greg
Yifeng Sun Aug. 16, 2018, 6:21 p.m. UTC | #2
Thanks Greg, I added your diff to the patch and added you in signed-off-by.

Yifeng

On Thu, Aug 16, 2018 at 11:14 AM, Gregory Rose <gvrose8192@gmail.com> wrote:

> On 8/16/2018 5:06 AM, Yifeng Sun wrote:
>
> This patch enables OVS kernel module to run on kernel 4.15.x.
> Two conntrack-related tests failed:
>  - conntrack - multiple zones, local
>  - conntrack - multi-stage pipeline, local
> This might be due to conntrack policy changes for packets coming
> from local ports on kernel 4.15. More survey will be done later.
>
> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> <pkusunyifeng@gmail.com>
> ---
>  acinclude.m4                  |  6 ++++--
>  datapath/linux/compat/vxlan.c | 10 ++++++++++
>  2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index 6e7ea4c..9fffe9c 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -151,10 +151,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
>      AC_MSG_RESULT([$kversion])
>
>      if test "$version" -ge 4; then
> -       if test "$version" = 4 && test "$patchlevel" -le 14; then
> +       if test "$version" = 4 && test "$patchlevel" -le 15; then
>            : # Linux 4.x
>         else
> -          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.14.x is not supported (please refer to the FAQ for advice)])
> +          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.15.x is not supported (please refer to the FAQ for advice)])
>         fi
>      elif test "$version" = 3 && test "$patchlevel" -ge 10; then
>         : # Linux 3.x
> @@ -883,6 +883,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
>    OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h],
>                    [void.*ndo_get_stats64],
>                    [OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])])
> +  OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable],
> +                  [OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])])
>
>    if cmp -s datapath/linux/kcompat.h.new \
>              datapath/linux/kcompat.h >/dev/null 2>&1; then
> diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
> index 8f5a921..b38a7be 100644
> --- a/datapath/linux/compat/vxlan.c
> +++ b/datapath/linux/compat/vxlan.c
> @@ -1275,9 +1275,15 @@ netdev_tx_t rpl_vxlan_xmit(struct sk_buff *skb)
>  EXPORT_SYMBOL_GPL(rpl_vxlan_xmit);
>
>  /* Walk the forwarding table and purge stale entries */
> +#ifdef HAVE_INIT_TIMER_DEFERRABLE
>  static void vxlan_cleanup(unsigned long arg)
>  {
>  	struct vxlan_dev *vxlan = (struct vxlan_dev *) arg;
> +#else
> +static void vxlan_cleanup(struct timer_list *t)
> +{
> +       struct vxlan_dev *vxlan = from_timer(vxlan, t, age_timer);
> +#endif
>  	unsigned long next_timer = jiffies + FDB_AGE_INTERVAL;
>  	unsigned int h;
>
> @@ -1638,9 +1644,13 @@ static void vxlan_setup(struct net_device *dev)
>  	INIT_LIST_HEAD(&vxlan->next);
>  	spin_lock_init(&vxlan->hash_lock);
>
> +#ifdef HAVE_INIT_TIMER_DEFERRABLE
>  	init_timer_deferrable(&vxlan->age_timer);
>  	vxlan->age_timer.function = vxlan_cleanup;
>  	vxlan->age_timer.data = (unsigned long) vxlan;
> +#else
> +	timer_setup(&vxlan->age_timer, vxlan_cleanup, TIMER_DEFERRABLE);
> +#endif
>
>  	vxlan->cfg.dst_port = htons(vxlan_port);
>
>
>
> Hi Yifeng,
>
> thanks for the patch!  It works fine for enabling the 4.15 kernel.
> However, we usually also update the
> Travis configuration file as at this time and then update the faq in
> Documentation/faq/releases.rst.
>
> How about the following incremental?
>
> diff --git a/.travis.yml b/.travis.yml
> index 4d7bbd8..998b33d 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -35,11 +35,11 @@ env:
>    - BUILD_ENV="-m32" OPTS="--disable-ssl"
>    - KERNEL=3.16.54 DPDK=1
>    - KERNEL=3.16.54 DPDK=1 OPTS="--enable-shared"
> -  - KERNEL=4.14.47
> -  - KERNEL=4.9.105
> -  - KERNEL=4.4.135
> -  - KERNEL=4.1.52
> -  - KERNEL=3.16.56
> +  - KERNEL=4.15.18
> +  - KERNEL=4.14.63
> +  - KERNEL=4.9.120
> +  - KERNEL=4.4.148
> +  - KERNEL=3.16.57
>    - TESTSUITE=1 LIBS=-ljemalloc
>
>  matrix:
> diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.
> rst
> index 50ca5f6..54c4b54 100644
> --- a/Documentation/faq/releases.rst
> +++ b/Documentation/faq/releases.rst
> @@ -67,7 +67,7 @@ Q: What Linux kernel versions does each Open vSwitch
> release w
>      2.7.x        3.10 to 4.9
>      2.8.x        3.10 to 4.12
>      2.9.x        3.10 to 4.13
> -    2.10.x       3.10 to 4.14
> +    2.10.x       3.10 to 4.15
>      ============ ==============
>
>      Open vSwitch userspace should also work with the Linux kernel module
> built
>
> Thanks,
>
> - Greg
>
diff mbox series

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index 6e7ea4c..9fffe9c 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -151,10 +151,10 @@  AC_DEFUN([OVS_CHECK_LINUX], [
     AC_MSG_RESULT([$kversion])
 
     if test "$version" -ge 4; then
-       if test "$version" = 4 && test "$patchlevel" -le 14; then
+       if test "$version" = 4 && test "$patchlevel" -le 15; then
           : # Linux 4.x
        else
-          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.14.x is not supported (please refer to the FAQ for advice)])
+          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.15.x is not supported (please refer to the FAQ for advice)])
        fi
     elif test "$version" = 3 && test "$patchlevel" -ge 10; then
        : # Linux 3.x
@@ -883,6 +883,8 @@  AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h],
                   [void.*ndo_get_stats64],
                   [OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable],
+                  [OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])])
 
   if cmp -s datapath/linux/kcompat.h.new \
             datapath/linux/kcompat.h >/dev/null 2>&1; then
diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
index 8f5a921..b38a7be 100644
--- a/datapath/linux/compat/vxlan.c
+++ b/datapath/linux/compat/vxlan.c
@@ -1275,9 +1275,15 @@  netdev_tx_t rpl_vxlan_xmit(struct sk_buff *skb)
 EXPORT_SYMBOL_GPL(rpl_vxlan_xmit);
 
 /* Walk the forwarding table and purge stale entries */
+#ifdef HAVE_INIT_TIMER_DEFERRABLE
 static void vxlan_cleanup(unsigned long arg)
 {
 	struct vxlan_dev *vxlan = (struct vxlan_dev *) arg;
+#else
+static void vxlan_cleanup(struct timer_list *t)
+{
+       struct vxlan_dev *vxlan = from_timer(vxlan, t, age_timer);
+#endif
 	unsigned long next_timer = jiffies + FDB_AGE_INTERVAL;
 	unsigned int h;
 
@@ -1638,9 +1644,13 @@  static void vxlan_setup(struct net_device *dev)
 	INIT_LIST_HEAD(&vxlan->next);
 	spin_lock_init(&vxlan->hash_lock);
 
+#ifdef HAVE_INIT_TIMER_DEFERRABLE
 	init_timer_deferrable(&vxlan->age_timer);
 	vxlan->age_timer.function = vxlan_cleanup;
 	vxlan->age_timer.data = (unsigned long) vxlan;
+#else
+	timer_setup(&vxlan->age_timer, vxlan_cleanup, TIMER_DEFERRABLE);
+#endif
 
 	vxlan->cfg.dst_port = htons(vxlan_port);