2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-02 07:15:17 +00:00

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 <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
This commit is contained in:
Yifeng Sun
2018-08-21 07:42:08 -07:00
committed by Ben Pfaff
parent e4e2009e4c
commit bf61b8b1c1
7 changed files with 16 additions and 51 deletions

View File

@@ -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

View File

@@ -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

2
NEWS
View File

@@ -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

View File

@@ -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])])

View File

@@ -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 \

View File

@@ -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 <net/dst_metadata.h>
#else
@@ -16,6 +11,11 @@ enum metadata_type {
#include <net/ipv6.h>
#include <net/ip_tunnels.h>
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

View File

@@ -1,40 +0,0 @@
/*
* Linux INET6 implementation
*
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
*
* 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 <net/ip6_fib.h>
#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