From bf61b8b1c1db08d90f7d83815344cf780c016878 Mon Sep 17 00:00:00 2001 From: Yifeng Sun Date: Tue, 21 Aug 2018 07:42:08 -0700 Subject: datapath: Add support for kernel 4.16.x & 4.17.x Add support for kernel version up to 4.17.x. On Travis, build passed for all kernel versions. And no new test fails are introduced by this patch. Cleaned up file datapath/linux/compat/include/net/ip6_fib.h which has no effect to kernel module but brings complexity to porting. Signed-off-by: Yifeng Sun Signed-off-by: Ben Pfaff Reviewed-by: Greg Rose Tested-by: Greg Rose --- .travis.yml | 2 ++ Documentation/faq/releases.rst | 2 +- NEWS | 2 ++ acinclude.m4 | 6 ++-- datapath/linux/Modules.mk | 1 - datapath/linux/compat/include/net/dst_metadata.h | 14 ++++++--- datapath/linux/compat/include/net/ip6_fib.h | 40 ------------------------ 7 files changed, 16 insertions(+), 51 deletions(-) delete mode 100644 datapath/linux/compat/include/net/ip6_fib.h diff --git a/.travis.yml b/.travis.yml index 998b33d9e..21447b543 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,8 @@ env: - BUILD_ENV="-m32" OPTS="--disable-ssl" - KERNEL=3.16.54 DPDK=1 - KERNEL=3.16.54 DPDK=1 OPTS="--enable-shared" + - KERNEL=4.17.14 + - KERNEL=4.16.18 - KERNEL=4.15.18 - KERNEL=4.14.63 - KERNEL=4.9.120 diff --git a/Documentation/faq/releases.rst b/Documentation/faq/releases.rst index e64fa22c4..41d41e3fc 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 work with? 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.15 + 2.10.x 3.10 to 4.17 ============ ============== Open vSwitch userspace should also work with the Linux kernel module built diff --git a/NEWS b/NEWS index 8077c9e8a..33b4d8a23 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ Post-v2.10.0 --------------------- + - Linux datapath: + * Support for the kernel versions 4.16.x and 4.17.x. - The environment variable OVS_SYSLOG_METHOD, if set, is now used as the default syslog method. - The environment variable OVS_CTL_TIMEOUT, if set, is now used diff --git a/acinclude.m4 b/acinclude.m4 index a6a0e9ad7..ab141bd70 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 15; then + if test "$version" = 4 && test "$patchlevel" -le 17; then : # Linux 4.x else - 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)]) + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.17.x is not supported (please refer to the FAQ for advice)]) fi elif test "$version" = 3 && test "$patchlevel" -ge 10; then : # Linux 3.x @@ -803,8 +803,6 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE(HAVE_NF_CONNTRACK_HELPER_PUT)]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],[[[[:space:]]]SKB_GSO_UDP[[[:space:]]]], [OVS_DEFINE([HAVE_SKB_GSO_UDP])]) - OVS_GREP_IFELSE([$KSRC/include/net/dst.h],[DST_NOCACHE], - [OVS_DEFINE([HAVE_DST_NOCACHE])]) OVS_FIND_FIELD_IFELSE([$KSRC/include/net/rtnetlink.h], [rtnl_link_ops], [extack], [OVS_DEFINE([HAVE_EXT_ACK_IN_RTNL_LINKOPS])]) diff --git a/datapath/linux/Modules.mk b/datapath/linux/Modules.mk index 2fec6500e..b06ca15a3 100644 --- a/datapath/linux/Modules.mk +++ b/datapath/linux/Modules.mk @@ -82,7 +82,6 @@ openvswitch_headers += \ linux/compat/include/net/inetpeer.h \ linux/compat/include/net/ip.h \ linux/compat/include/net/ip_tunnels.h \ - linux/compat/include/net/ip6_fib.h \ linux/compat/include/net/ip6_route.h \ linux/compat/include/net/ip6_tunnel.h \ linux/compat/include/net/ipv6.h \ diff --git a/datapath/linux/compat/include/net/dst_metadata.h b/datapath/linux/compat/include/net/dst_metadata.h index e53a29ed2..36f3f390d 100644 --- a/datapath/linux/compat/include/net/dst_metadata.h +++ b/datapath/linux/compat/include/net/dst_metadata.h @@ -1,11 +1,6 @@ #ifndef __NET_DST_METADATA_WRAPPER_H #define __NET_DST_METADATA_WRAPPER_H 1 -enum metadata_type { - METADATA_IP_TUNNEL, - METADATA_HW_PORT_MUX, -}; - #ifdef USE_UPSTREAM_TUNNEL #include_next #else @@ -16,6 +11,11 @@ enum metadata_type { #include #include +enum metadata_type { + METADATA_IP_TUNNEL, + METADATA_HW_PORT_MUX, +}; + struct hw_port_info { struct net_device *lower_dev; u32 port_id; @@ -119,7 +119,11 @@ void ovs_ip_tunnel_rcv(struct net_device *dev, struct sk_buff *skb, static inline struct metadata_dst * rpl_metadata_dst_alloc(u8 optslen, enum metadata_type type, gfp_t flags) { +#if defined(HAVE_METADATA_DST_ALLOC_WITH_METADATA_TYPE) && defined(USE_UPSTREAM_TUNNEL) + return metadata_dst_alloc(optslen, type, flags); +#else return metadata_dst_alloc(optslen, flags); +#endif } #define metadata_dst_alloc rpl_metadata_dst_alloc diff --git a/datapath/linux/compat/include/net/ip6_fib.h b/datapath/linux/compat/include/net/ip6_fib.h deleted file mode 100644 index 4d5837595..000000000 --- a/datapath/linux/compat/include/net/ip6_fib.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Linux INET6 implementation - * - * Authors: - * Pedro Roque - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#ifndef _IP6_FIB_WRAPPER_H -#define _IP6_FIB_WRAPPER_H - -#include_next - -#ifndef RTF_PCPU -#define RTF_PCPU 0x40000000 -#endif - -#ifndef RTF_LOCAL -#define RTF_LOCAL 0x80000000 -#endif - -#define rt6_get_cookie rpl_rt6_get_cookie -static inline u32 rt6_get_cookie(const struct rt6_info *rt) -{ - if (rt->rt6i_flags & RTF_PCPU || -#ifdef HAVE_DST_NOCACHE - (unlikely(rt->dst.flags & DST_NOCACHE) && rt->dst.from)) -#else - (unlikely(!list_empty(&rt->rt6i_uncached)) && rt->dst.from)) -#endif - rt = (struct rt6_info *)(rt->dst.from); - - return rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; -} - -#endif -- cgit v1.2.1