summaryrefslogtreecommitdiff
path: root/acinclude.m4
Commit message (Collapse)AuthorAgeFilesLines
* acinclude: Omit unnecessary defineEli Britstein2019-02-181-2/+1
| | | | | | | | | | | Commit fc3b425fa02f ("acinclude: Include libmnl when needed") added unnecessary include of DPDK_MNL. Omit it. Fixes: fc3b425fa02f ("acinclude: Include libmnl when needed") Signed-off-by: Eli Britstein <elibr@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* acinclude: Include libverbs and libmlx4 when neededEli Britstein2019-02-181-0/+14
| | | | | | | | | | | | | DPDK 18.11 uses libverbs and libmlx4 when MLX4 PMD is enabled. This commit makes OVS to link to libverbs and libmlx4 when MLX4 PMD is enabled on DPDK. Signed-off-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Asaf Penso <asafp@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* acinclude: Include libverbs and libmlx5 when neededEli Britstein2019-02-181-0/+22
| | | | | | | | | | | | | | DPDK 18.11 uses libverbs and libmlx5 when MLX5 PMD is enabled. This commit makes OVS to link to libverbs and libmlx5 when MLX5 PMD is enabled on DPDK. Signed-off-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Shahaf Shuler <shahafs@mellanox.com> Reviewed-by: Asaf Penso <asafp@mellanox.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* acinclude: Also use LIBS from dpkg pkg-configChristian Ehrhardt2019-02-131-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | DPDK 18.11 builds using the more modern meson build system no more provide the -ldpdk linker script. Instead it is expected to use pkgconfig for linker options as well. This change will set DPDK_LIB from pkg-config (if pkg-config was available) and since that already carries the whole-archive flags around the PMDs skips the further wrapping in more whole-archive if that is already part of DPDK_LIB. To work reliable in all environments this needs pkg-config 0.29.1. We want to be able to use PKG_CHECK_MODULES_STATIC which is not yet available in 0.24. Therefore update pkg.m4 to pkg-config 0.29.1. This should be backport-safe as these macro files are all versioned. autoconf is smart enough to check the version if you have it locally, and if the system's is higher, it will use that one instead. Acked-by: Luca Boccassi <bluca@debian.org> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* acinclude: Check for rte_config.h before checking dependencies.Ilya Maximets2019-02-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current ./configure script shows misleading errors in case of wrong DPDK path: # ./configure --with-dpdk=/wrong/path ... checking whether dpdk datapath is enabled... yes checking for library containing get_mempolicy... -lnuma checking for library containing pcap_dump... -lpcap checking for library containing mnl_attr_put... no configure: error: unable to find libmnl, install the dependency package This happens because we're not checking for headers before checking for dependencies. All the compile attempts fails and script thinks that we need more dependencies. With this change script will check for 'rte_config.h' availability and produce sane error message: # ./configure --with-dpdk=/wrong/path ... checking for rte_config.h... no configure: error: unable to find rte_config.h in /wrong/path 'AC_INCLUDES_DEFAULT' passed explicitly to avoid preprocessor test. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* acinclude: Use NUMA_AWARE_HUGEPAGES too for libnuma check.Ilya Maximets2019-02-121-1/+1
| | | | | | | | | | | This fixes build with NUMA_AWARE_HUGEPAGES enabled and VHOST_NUMA disabled. This should not be a usual case. But it's possible to configure DPDK this way. Fixes: 5e925ccc2a6f ("netdev-dpdk: DPDK v17.11 upgrade") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* acinclude: Drop DPDK_EXTRA_LIB variable.Ilya Maximets2019-02-071-5/+1
| | | | | | | | | | | | | | | | | AC_SEARCH_LIBS enables the libraries itself: checking for library containing get_mempolicy... -lnuma checking for library containing pcap_dump... -lpcap So, they are available in LIBS. No need to add them twice. Also, DPDK_EXTRA_LIB doesn't even work, because each check overwrites the variable instead of appending the new library. It was first time misused while making libnuma optional and copy-pasted to several places after that. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* datapath: Add support for kernel 4.18.xYifeng Sun2019-02-041-2/+2
| | | | | | | | | | | | | | No code changing is necessary to support 4.18.x. Only one kernel test failed and it is in the process of being fixed. Updated .travis.yml to include 4.18.x and also use latest 4.17 version. Updated test files to test 4.18 kernel. Tested-by: Greg Rose <gvrose8192@gmail.com> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* compat: Fixup ipv6 fragmentation on 4.9.135+ kernelsGreg Rose2019-01-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | Upstream commit 648700f76b03 ("inet: frags: use rhashtables...") changed how ipv6 fragmentation is implemented. This patch was backported to the upstream stable 4.9.x kernel starting at 4.9.135. This patch creates the compatibility layer changes required to both compile and also operate correctly with ipv6 fragmentation on these kernels. Check if the inet_frags 'rnd' field is present to key on whether the upstream patch is present. Also update Travis to the latest 4.9 kernel release so that this patch is compile tested. Passes Travis: https://travis-ci.org/gvrose8192/ovs-experimental/builds/478033409 Cc: William Tu <u9012063@gmail.com> Cc: Yi-Hung Wei <yihung.wei@gmail.com> Cc: Yifeng Sun <pkusunyifeng@gmail.com> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* nf_conntrack_proto: Fix HAVE_NET_NS_GET macro for nf_conntrackYifeng Sun2018-12-271-2/+2
| | | | | | | | | | In previous code, macro HAVE_NET_NS_SET is used in code but never generated by config. This patch fixes it. Fixes: 179fccce34db ("compat: Backport nf_ct_netns_{get, put}()") Acked-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath: compat: Fix static key backportYi-Hung Wei2018-12-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original static key backport is based on the upstream net-next commit 11276d5306b8 ("locking/static_keys: Add a new static_key interface"). However, in Canonical's Trusty kernel, it introduced partial static support which have different definition of some of the macros that breaks the compatibility code. For example, in net-next git tree commit 11276d5306b8 ("locking/static_keys: Add a new static_key interface"). + #define DEFINE_STATIC_KEY_TRUE(name) \ + struct static_key_true name = STATIC_KEY_TRUE_INIT On the other hand, in Canonical's Trusty git tree commit 13f5d5d1cccb6 ("x86/KVM/VMX: Add module argument for L1TF mitigation") + #define DEFINE_STATIC_KEY_TRUE(name) \ + struct static_key name = STATIC_KEY_INIT_TRUE This commit resolves the ovs kernel module compatibility issue on Trusty kernel. VMware-BZ: #2251101 Fixes: 6660a9597a49 ("datapath: compat: Introduce static key support") Tested-by: Greg Rose <gvrose8192@gmail.com> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* acinclude: Include libmnl when neededTimothy Redaelli2018-12-171-0/+13
| | | | | | | | | | DPDK 18.11 uses libmnl when MLX5 PMD is enabled. This commit makes OVS to link to libmnl when MLX5 PMD is enabled on DPDK. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
* compat: Fixup ip_tunnel_info_opts_setGreg Rose2018-12-151-0/+3
| | | | | | | | A new flags parameter has been added in 4.19 so add compat fixup. Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* netdev-linux: Don't include <net/if_packet.h>.Ben Pfaff2018-10-031-11/+0
| | | | | | | | | | | This header only defines sockaddr_pkt, which this source file doesn't use. This was the only user of net/if_packet.h, so also remove the configure-time test for it (which netdev-linux wasn't using anyway). Reported-by: Andre McCurdy <armccurdy@gmail.com> Reported-at: https://github.com/openvswitch/ovs/pull/253 Signed-off-by: Ben Pfaff <blp@ovn.org>
* acinclude.m4: Really check whether GCC support -Wno-null-pointer-arithmetic.Ben Pfaff2018-09-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | I've noticed recently an annoying quantity of error messages like the following in builds in various places: gcc: error: unrecognized command line option ‘-Wunknown-warning-option’ This didn't really make sense because OVS checks whether the compiler supports warning options before it uses them. Looking closer, the GCC manual has a note that explains the issue: When an unrecognized warning option is requested (e.g., '-Wunknown-warning'), GCC emits a diagnostic stating that the option is not recognized. However, if the '-Wno-' form is used, the behavior is slightly different: no diagnostic is produced for '-Wno-unknown-warning' unless other diagnostics are being produced. This allows the use of new '-Wno-' options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present. Thus, we can properly check only for the *positive* version of a warning option, so this commit makes the OVS tests do that. Fixes: a7021b08b0d5 ("configure: Disable -Wnull-pointer-arithmetic Clang warning.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* datapath: Fix builds on older kernels.Darrell Ball2018-08-301-0/+5
| | | | | | | | | | | | | | On older kernels, for example 3.19, the function rt6_get_cookie() is not available and used with ipv6 config enabled; it was introduced in 4.2. Put back the replacement function if it does not exist. Add a 3.19 version to travis. CC: Yifeng Sun <pkusunyifeng@gmail.com> Fixes: bf61b8b1c1db ("datapath: Add support for kernel 4.16.x & 4.17.x.") Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Yifeng Sun <pkusunyifeng@gmail.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* datapath: Add support for kernel 4.16.x & 4.17.xYifeng Sun2018-08-241-4/+2
| | | | | | | | | | | | | | 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>
* datapath: compat: Introduce static key supportYi-Hung Wei2018-08-171-0/+3
| | | | | | | | | | | | | | | | | Static keys allow the inclusion of seldom used features in performance-sensitive fast-path kernel code, via a GCC feature and a code patching technique. For more information: * https://www.kernel.org/doc/Documentation/static-keys.txt Since upstream ovs kernel module now uses some static key API that was introduced in v4.3 kernel, we shall backport them to the compat module for older kernel supprots. This backport is based on upstream net-next commit 11276d5306b8 ("locking/static_keys: Add a new static_key interface"). Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* datapath: compat: Backports nf_conncountYi-Hung Wei2018-08-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch backports the nf_conncount backend that counts the number of connections matching an arbitrary key. The following patch will use the feature to support connection tracking zone limit in ovs kernel datapath. This backport is based on an upstream net-next upstream commits. 5c789e131cbb ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search") 34848d5c896e ("netfilter: nf_conncount: Split insert and traversal") 2ba39118c10a ("netfilter: nf_conncount: Move locking into count_tree()") 976afca1ceba ("netfilter: nf_conncount: Early exit in nf_conncount_lookup() and cleanup") cb2b36f5a97d ("netfilter: nf_conncount: Switch to plain list") 2a406e8ac7c3 ("netfilter: nf_conncount: Early exit for garbage collection") b36e4523d4d5 ("netfilter: nf_conncount: fix garbage collection confirm race") 21ba8847f857 ("netfilter: nf_conncount: Fix garbage collection with zones") 5e5cbc7b23ea ("netfilter: nf_conncount: expose connection list interface") 35d8deb80c30 ("netfilter: conncount: Support count only use case") 6aec208786c2 ("netfilter: Refactor nf_conncount") d384e65f1e75 ("netfilter: return booleans instead of integers") 625c556118f3 ("netfilter: connlimit: split xt_connlimit into front and backend") The upstream nf_conncount has a couple of export functions while this patch only export the ones that ovs kernel module needs. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* compat: Backport nf_ct_netns_{get, put}()Yi-Hung Wei2018-08-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This patch backports nf_ct_netns_get/put() in order to support a feature in the follow up patch. nf_ct_netns_{get,put} were first introduced in upstream net-next commit ecb2421b5ddf ("netfilter: add and use nf_ct_netns_get/put") in kernel v4.10, and then updated in commmit 7e35ec0e8044 ("netfilter: conntrack: move nf_ct_netns_{get,put}() to core") in kernel v4.15. We need to invoke nf_ct_netns_get/put() when the underlying nf_conntrack_l3proto supports net_ns_{get,put}(). Therefore, there are 3 cases that we need to consider. 1) Before nf_ct_{get,put}() is introduced. We just mock nf_ct_nets_{get,put}() and do nothing. 2) After 1) and before v4.15 Backports based on commit 7e35ec0e8044 . 3) Staring from v4.15 Use the upstream version. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* porting: Add fixes to support kernel 4.15.xYifeng Sun2018-08-161-2/+4
| | | | | | | | | | | | | | | | 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: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Co-authored-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Tested-by: Gregory Rose <gvrose8192@gmail.com> Reviewed-by: Gregory Rose <gvrose8192@gmail.com>
* compat: Substitute more dependable defineGreg Rose2018-08-131-0/+3
| | | | | | | | | | | The compat layer ip_tunnel_get_stats64 function was checking for the Linux kernel version to determine if the return was void or a pointer. This is not very reliable and caused compile warnings on SLES 12 SP3. In acinclude.m4 create a more reliable method of determining when to use a void return vs. a pointer return. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* datapath: support upstream ndo_udp_tunnel_add in net_device_opswenxu2018-08-071-0/+1
| | | | | | | | | | | It makes datapath can support both ndo_add_udp_tunnel_port and ndo_add_vxlan/geneve_port. The newer kernels don't support vxlan/geneve specific NDO's anymore Signed-off-by: wenxu <wenxu@ucloud.cn> Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Tested-by: Greg Rose <gvrose8192@gmail.com>
* lib/tc: Support matching on ip tunnel tos and ttlOr Gerlitz2018-08-011-5/+5
| | | | | | | | | Support matching on tos and ttl of ip tunnels for the TC data-path. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* lib/tc: Support setting tos and ttl for TC IP tunnelsOr Gerlitz2018-08-011-3/+3
| | | | | | | | Allow to set the tos and ttl for TC tunnels. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* datapath: NAT support for shifted portmap rangesYi-Hung Wei2018-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch backports the following upstream commit from net-next, and defines HAVE_NF_NAT_RANGE2 to determine whether to use 'struct nf_nat_range2'. Upstream commit: commit 2eb0f624b709e78ec8e2f4c3412947703db99301 Author: Thierry Du Tre <thierry@dtsystems.be> Date: Wed Apr 4 15:38:22 2018 +0200 netfilter: add NAT support for shifted portmap ranges This is a patch proposal to support shifted ranges in portmaps. (i.e. tcp/udp incoming port 5000-5100 on WAN redirected to LAN 192.168.1.5:2000-2100) Currently DNAT only works for single port or identical port ranges. (i.e. ports 5000-5100 on WAN interface redirected to a LAN host while original destination port is not altered) When different port ranges are configured, either 'random' mode should be used, or else all incoming connections are mapped onto the first port in the redirect range. (in described example WAN:5000-5100 will all be mapped to 192.168.1.5:2000) This patch introduces a new mode indicated by flag NF_NAT_RANGE_PROTO_OFFSET which uses a base port value to calculate an offset with the destination port present in the incoming stream. That offset is then applied as index within the redirect port range (index modulo rangewidth to handle range overflow). In described example the base port would be 5000. An incoming stream with destination port 5004 would result in an offset value 4 which means that the NAT'ed stream will be using destination port 2004. Other possibilities include deterministic mapping of larger or multiple ranges to a smaller range : WAN:5000-5999 -> LAN:5000-5099 (maps WAN port 5*xx to port 51xx) This patch does not change any current behavior. It just adds new NAT proto range functionality which must be selected via the specific flag when intended to use. A patch for iptables (libipt_DNAT.c + libip6t_DNAT.c) will also be proposed which makes this functionality immediately available. Signed-off-by: Thierry Du Tre <thierry@dtsystems.be> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* datapath: Introduce net_rwsem and remove rtnl_lock()Yi-Hung Wei2018-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch backports the following two upstream commits and add a new symbol HAVE_NET_RWSEM in acinclude.m4 to determine whether to use new introduced rw_semaphore, net_rwsem. Upstream commit: commit f0b07bb151b098d291fd1fd71ef7a2df56fb124a Author: Kirill Tkhai <ktkhai@virtuozzo.com> Date: Thu Mar 29 19:20:32 2018 +0300 net: Introduce net_rwsem to protect net_namespace_list rtnl_lock() is used everywhere, and contention is very high. When someone wants to iterate over alive net namespaces, he/she has no a possibility to do that without exclusive lock. But the exclusive rtnl_lock() in such places is overkill, and it just increases the contention. Yes, there is already for_each_net_rcu() in kernel, but it requires rcu_read_lock(), and this can't be sleepable. Also, sometimes it may be need really prevent net_namespace_list growth, so for_each_net_rcu() is not fit there. This patch introduces new rw_semaphore, which will be used instead of rtnl_mutex to protect net_namespace_list. It is sleepable and allows not-exclusive iterations over net namespaces list. It allows to stop using rtnl_lock() in several places (what is made in next patches) and makes less the time, we keep rtnl_mutex. Here we just add new lock, while the explanation of we can remove rtnl_lock() there are in next patches. Fine grained locks generally are better, then one big lock, so let's do that with net_namespace_list, while the situation allows that. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net> Upstream commit: commit ec9c780925c57588637e1dbd8650d294107311c0 Author: Kirill Tkhai <ktkhai@virtuozzo.com> Date: Thu Mar 29 19:21:09 2018 +0300 ovs: Remove rtnl_lock() from ovs_exit_net() Here we iterate for_each_net() and removes vport from alive net to the exiting net. ovs_net::dps are protected by ovs_mutex(), and the others, who change it (ovs_dp_cmd_new(), __dp_destroy()) also take it. The same with datapath::ports list. So, we remove rtnl_lock() here. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Justin Pettit <jpettit@ovn.org>
* Add support to offload QinQ double VLAN headers matchJianbo Liu2018-07-251-3/+3
| | | | | | | | | | Currently the inner VLAN header is ignored when using the TC data-path. As TC flower supports QinQ, now we can offload the rules to match on both outer and inner VLAN headers. Signed-off-by: Jianbo Liu <jianbol@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* compat: Add skb_checksum_simple_complete()Greg Rose2018-06-041-0/+5
| | | | | | | | | | A recent patch to gre.c added a call to skb_checksum_simple_complete() which is not present in kernels before 3.16. Fix up the compatability layer to allow compile on older kernels that do not have it. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* compat: Fixups for newer kernelsGreg Rose2018-05-311-11/+4
| | | | | | | | | | | | | | | | | | | | | | A recent patch series added support for ERSPAN but left some problems remaining for kernel releases from 4.10 to 4.14. This patch addresses those problems. Of note is that the old cisco gre compat layer code is gone for good. Also, several compat defines in acinclude.m4 were looking for keys in .c source files - this does not work on distros without source code. A more reliable key was already defined so we use that instead. We have pared support for the Linux kernel releases in .travis.yml to reflect that 4.15 is no longer in the LTS list. With this patch the Out of Tree OVS datapath kernel modules can build on kernels up to 4.14.47. Support for kernels up to 4.16.x will be added later. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* rhel: Enable ERSPAN features for RHEL 7.xGreg Rose2018-05-211-1/+14
| | | | | | | | Enable ERSPAN on RHEL 7.x Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
* gre: introduce native tunnel support for ERSPANWilliam Tu2018-05-211-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit 84e54fe0a5eaed696dee4019c396f8396f5a908b Author: William Tu <u9012063@gmail.com> Date: Tue Aug 22 09:40:28 2017 -0700 gre: introduce native tunnel support for ERSPAN The patch adds ERSPAN type II tunnel support. The implementation is based on the draft at [1]. One of the purposes is for Linux box to be able to receive ERSPAN monitoring traffic sent from the Cisco switch, by creating a ERSPAN tunnel device. In addition, the patch also adds ERSPAN TX, so Linux virtual switch can redirect monitored traffic to the ERSPAN tunnel device. The traffic will be encapsulated into ERSPAN and sent out. The implementation reuses tunnel key as ERSPAN session ID, and field 'erspan' as ERSPAN Index fields: ./ip link add dev ers11 type erspan seq key 100 erspan 123 \ local 172.16.1.200 remote 172.16.1.100 To use the above device as ERSPAN receiver, configure Nexus 5000 switch as below: monitor session 100 type erspan-source erspan-id 123 vrf default destination ip 172.16.1.200 source interface Ethernet1/11 both source interface Ethernet1/12 both no shut monitor erspan origin ip-address 172.16.1.100 global [1] https://tools.ietf.org/html/draft-foschiano-erspan-01 [2] iproute2 patch: http://marc.info/?l=linux-netdev&m=150306086924951&w=2 [3] test script: http://marc.info/?l=linux-netdev&m=150231021807304&w=2 Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Meenakshi Vohra <mvohra@vmware.com> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net> This commit also backports heavily from upstream gre, ip_gre and ip_tunnel modules to support the necessary erspan ip gre infrastructure as well as implementing a variety of compatability layer changes for same support. Cc: William Tu <u9012063@gmail.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
* datapath: compat: Fix build on RHEL 7.5Yi-Hung Wei2018-05-141-0/+2
| | | | | | | | | | | | | | | | | | 1) OVS datapath compat modules breaks on RHEL 7.5, because it moves ndo_change_mtu function pointer from 'struct net_device_ops' to 'struct net_device_ops_extended'. 2) RHEL 7.5 introduces the MTU range checking as mentioned in 6c0bf091 ("datapath: use core MTU range checking in core net infra"). However, the max_mtu field is defined in 'struct net_device_extended' but not in 'struct net_device' as upstream kernel. This patch defines a new symbol HAVE_RHEL7_MAX_MTU that determines the previous 2 conditions, and fixes the backport issue. Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Acked-by: Lucas Alvares Gomes <lucasagomes@gmail.com> Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
* compat: Fix upstream 4.4.119 kernelGreg Rose2018-05-081-0/+2
| | | | | | | | | | | | | | | The Linux 4.4.119 kernel (and perhaps others) from kernel.org backports some dst_cache code that breaks the openvswitch kernel due to a duplicated name "dst_cache_destroy". For most cases the "USE_UPSTREAM_TUNNEL" covers this but in this case the dst_cache feature needs to be separated out. Add the necessary compatibility detection layer in acinclude.m4 and then fixup the source files so that if the built-in kernel includes dst_cache support then exclude our own compatibility code. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* netdev-tc-offloads: Add support for IP fragmentationRoi Dayan2018-03-211-3/+3
| | | | | | | | | Add support for frag no, first and later. Signed-off-by: Roi Dayan <roid@mellanox.com> Reviewed-by: Shahar Klein <shahark@mellanox.com> Reviewed-by: Paul Blakey <paulb@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* compat: Fix RHEL 7 compileGreg Rose2018-02-271-0/+4
| | | | | | | | | | | frag_percpu_counter_batch is a variable, not a define, so checking if it is defined is an error and causes warning messages during compile on RHEL 7 (or other 3.10 based) builds. Use a compat #define from acinclude.m4 instead. Fixes: 64d8cb7295 ("compat:inet_frag.h: Check for frag_percpu_counter_batch") Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* acinclude: Enable building for Linux kernel 4.15Greg Rose2018-02-161-2/+2
| | | | | Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* acinclude.m4: Enable Linux 4.14Greg Rose2018-02-121-2/+2
| | | | | Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* datapath: Add meter infrastructureAndy Zhou2018-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit 96fbc13d7e770b542d2d1fcf700d0baadc6e8063 Author: Andy Zhou <azhou@ovn.org> Date: Fri Nov 10 12:09:42 2017 -0800 openvswitch: Add meter infrastructure OVS kernel datapath so far does not support Openflow meter action. This is the first stab at adding kernel datapath meter support. This implementation supports only drop band type. Signed-off-by: Andy Zhou <azhou@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> Added a compat layer fixup for nla_parse. Added another compat fixup for ktime_get_ns. Cc: Andy Zhou <azhou@ovn.org> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* datapath: reliable interface indentification in port dumpsJiri Benc2018-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit 9354d452034273a50a4fd703bea31e5d6b1fc20b Author: Jiri Benc <jbenc@redhat.com> Date: Thu Nov 2 17:04:37 2017 -0200 openvswitch: reliable interface indentification in port dumps This patch allows reliable identification of netdevice interfaces connected to openvswitch bridges. In particular, user space queries the netdev interfaces belonging to the ports for statistics, up/down state, etc. Datapath dump needs to provide enough information for the user space to be able to do that. Currently, only interface names are returned. This is not sufficient, as openvswitch allows its ports to be in different name spaces and the interface name is valid only in its name space. What is needed and generally used in other netlink APIs, is the pair ifindex+netnsid. The solution is addition of the ifindex+netnsid pair (or only ifindex if in the same name space) to vport get/dump operation. On request side, ideally the ifindex+netnsid pair could be used to get/set/del the corresponding vport. This is not implemented by this patch and can be added later if needed. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Added compat fixup for peernet2id. Cc: Jiri Benc <jbenc@redhat.com> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* datapath: use ktime_get_ts64() instead of ktime_get_ts()Arnd Bergmann2018-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit 311af51dcb5629f04976a8e451673f77e3301041 Author: Arnd Bergmann <arnd@arndb.de> Date: Mon Nov 27 12:41:38 2017 +0100 openvswitch: use ktime_get_ts64() instead of ktime_get_ts() timespec is deprecated because of the y2038 overflow, so let's convert this one to ktime_get_ts64(). The code is already safe even on 32-bit architectures, since it uses monotonic times. On 64-bit architectures, nothing changes, while on 32-bit architectures this avoids one type conversion. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net> Additional compatability check for ktime_get_ts64() exists or not. If not, then just continue using ktime_get_ts(). I added a new compatability header file "timekeeping.h". Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* compat: Fix compiler headersGreg Rose2018-02-121-0/+3
| | | | | | | | | | Since Linux kernel upstream commit d15155824c50 ("linux/compiler.h: Split into compiler.h and compiler_types.h") this error check for the gcc compiler header is no longer valid. Remove so that openvswitch builds for linux kernels 4.14.8 and since. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* datapath: Fix netdev_master_upper_dev_link for 4.14Greg Rose2018-02-121-0/+3
| | | | | | | | | An extended netlink ack has been added for 4.14 - add compat layer changes so that it compiles for all kernels up to and including 4.14. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* datapath: enable NSH supportYi Yang2018-02-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Upstream commit: commit b2d0f5d5dc53532e6f07bc546a476a55ebdfe0f3 Author: Yi Yang <yi.y.yang@intel.com> Date: Tue Nov 7 21:07:02 2017 +0800 openvswitch: enable NSH support OVS master and 2.8 branch has merged NSH userspace patch series, this patch is to enable NSH support in kernel data path in order that OVS can support NSH in compat mode by porting this. Signed-off-by: Yi Yang <yi.y.yang@intel.com> Acked-by: Jiri Benc <jbenc@redhat.com> Acked-by: Eric Garver <e@erig.me> Acked-by: Pravin Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Yi Yang <yi.y.yang@intel.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Greg Rose <gvrose8192@gmail.com>
* acinclude: check for IP_CT_UNTRACKEDEric Garver2018-01-221-0/+2
| | | | | | | | IP_CT_UNTRACKED is fairly new, but used by the kernel datapath ct_clear action. Signed-off-by: Eric Garver <e@erig.me> Acked-by: Pravin B Shelar <pshelar@ovn.org>
* configure: New --enable-sparse option to enable sparse checking by default.Ben Pfaff2018-01-121-1/+7
| | | | | | | | | | | | Until now, "make" called sparse to do checking only if C=1 was passed on the command line. It was easy for developers to forget to specify that. This commit adds another option: specifying --enable-sparse on the configure command line enables sparse checking by default. (It can still be disabled with C=0.) Requested-by: Justin Pettit <jpettit@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* configure: Make --enable-Werror turn sparse warnings into errors.Ben Pfaff2018-01-111-2/+10
| | | | | | | | | | | Until now, when "sparse" reported a warning, it didn't fail the build for that file, even when the project was configured with --enable-Werror, which made it easy to miss warnings. This commit fixes the problem. Reported-by: "Stokes, Ian" <ian.stokes@intel.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ian Stokes <ian.stokes@intel.com> Tested-by: Ian Stokes <ian.stokes@intel.com>
* compat: Add act_pedit compatibility for old kernelsPaul Blakey2017-11-161-0/+7
| | | | | | | | Added compatibility for action pedit. Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
* acinclude: Fix SKB_GSO_UDP check.William Tu2017-11-011-1/+1
| | | | | | | | | | | The HAVE_SKB_GSO_UDP checks whether skbuff.h defines SKB_GSO_UDP. However, it falsely returns yes because grep matches SKB_GSO_UDP_TUNNEL. Thus, add space character '[:space:]' before and after it. Fixes: ad283644f0e4 ("acinclude: Check for SKB_GSO_UDP") Signed-off-by: William Tu <u9012063@gmail.com> Cc: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* acinclude: Add support for Linux 4.13Greg Rose2017-09-221-2/+2
| | | | | | | Add configuration support for the just released 4.13 Linux kernel. Signed-off-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: Andy Zhou <azhou@ovn.org>