From patchwork Sat May 19 00:49:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 916678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZGDZMMnq"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40nmfJ68H9z9s47 for ; Sat, 19 May 2018 10:49:59 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A49D9BC2; Sat, 19 May 2018 00:49:56 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 32547BC4 for ; Sat, 19 May 2018 00:49:56 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CB055473 for ; Sat, 19 May 2018 00:49:53 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id o76-v6so4495361pfi.5 for ; Fri, 18 May 2018 17:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qgfRWYFHkCueYOkUQKg0UldWRDu7mxgAL+1yoChmyLQ=; b=ZGDZMMnqjz61NX9BNV7oIYNOUcHPaMf//4MtsT1Y65tgAvmAXCSEGXmdsFU9KMpnbM eOf5k+Xjh5m/OfNMbB1bNnmcgpj6WHXbRoQVVjSQQvO1ZLwcWz7yBMFkhFrU0IsRZnP4 9bt7c2DAHcwqZbQe4Wo/cMKcyziL84HIY+KAfShIaFZ7q/bPFD0O6cklVc3c2c53b9it 5s1nn/dAuXtxK61aVyERyacQfaE3UfPBHMH++BeLLsJG+cCBL19PKuj1roHtPQx47RrS lvdjj43GNsDCGwOTLDHLX7fIZxDgtuyI6fN0+X58g4ZfjXaR+/X//aa6CRRZTx9ytQme i0qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qgfRWYFHkCueYOkUQKg0UldWRDu7mxgAL+1yoChmyLQ=; b=KqdJLG/NM8iMDX1VAyVCmlqJHyvncSw9NT9paT1GxfKFbZV+puFErT98zfDaot+T/1 NpD79cJkrH7PQsEh/G8v4D3YUYQomz6zvStk/FycZ4VFxxGb2sCdZVmCC3Xjg1lldQD2 5fy8JW6DkdJPAPlMOsjdPZcZnFFw9nsxNA6nTS4hYpcbPx8EcDMGUF17l8W/2SRlIM1x In8rqD28z/m8E58Oc7IGjLNNNXZgPhz0Vp1+6QFC1fPUgqBPn2OMMOdb3Rbkdg06kv4g f1HDr0A3oI9p++nOclKkfHw9LJETlmSCXo05aQimt8AnOD1+VeOqUnRNJ+pVZNSVVfj/ Jeeg== X-Gm-Message-State: ALKqPwfYX9fSvxD8sp3zCvh9uJMsYg/fdRRiJOgojd7vFhKT9Pb5CIJi jalU5vpdclFR8W/jHP9XkJdpQg== X-Google-Smtp-Source: AB8JxZoQudjbNhOgEDYrWKpH0LvhZkUJX6AUOJXyL3CG7BWw8LIyqbF2HRJ0sJ1ZGhMCPe1vYTMdgw== X-Received: by 2002:a65:4043:: with SMTP id h3-v6mr8071851pgp.333.1526690992758; Fri, 18 May 2018 17:49:52 -0700 (PDT) Received: from gizo.domain (97-115-125-157.ptld.qwest.net. [97.115.125.157]) by smtp.gmail.com with ESMTPSA id 131-v6sm13536685pfa.128.2018.05.18.17.49.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 17:49:51 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Fri, 18 May 2018 17:49:08 -0700 Message-Id: <1526690988-29912-1-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH V3 00/40] Add ERSPAN support X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This series of patches is the backport of the Linux kernel upstream ERSPAN feature support. The first patch does some cleanup of unsupported kernel code. The remaining patches in the series begin the backport of the ERSPAN code. As part of the ERSPAN backport it was necessary to fixup the current out of tree GRE, IPv4 and IPv6 tunneling support by pulling in code from the upstream Linux kernel. There was a great deal of infrastructure missing so much of this patch series is actually devoted to making sure the proper GRE, IPV4 and IPV6 tunneling code is pulled in from the upstream kernel. Currently the series is only guaranteed to build on kernels <= 4.9. A future patch will enable builds on kernels greater than 4.9. At Linux kernel release 4.15 the upstream kernel code can be used with the OVS userspace code. Basic functional testing - including link connectivity, pings, and some some basic iperf) - has been done but given the scope of changes it is impossible for me to unit test more thoroughly on all distro and kernel combinations that might be affected. Distros I have tested on: RHEL 7.2 RHEL 7.3 RHEL 7.4 Ubuntu 14.04.5 Ubuntu 16.04.3 Ubuntu 16.04.4 On that note: https://en.wikipedia.org/wiki/Release_early,_release_often For those who may be interested the entire series may be pulled from the erspan-combo-24-rev2 branch on my public github repository. https://github.com/gvrose8192/ovs-experimental/tree/erspan-combo-24-rev2 In V2 of this patch series I have incorporated suggestions and comments from Ben. In V3 of this patch series we have fixed up the 'make check' and 'make check-kmod' errors. No errors are encountered that aren't also occasionally seen without this patch series applied. Greg Rose (12): compat: Remove unsupported kernel compat code compat: Move function to header compat: Add #define for gre_handle_offloads compat: Fixups for some compile warnings and errors compat: Add ipv6 GRE and IPV6 Tunneling datapath: Add dellink op to ip6gre and ip6erspan tap ops datapath: Use correct tunnel receive for ip6gre ip6gre: Add ip6gre vport type lib/dpif-netlink: Fix miscompare of gre ports erspan: Add flow-based erspan options rhel: Enable ERSPAN features for RHEL 7.x gre: Resolve gre receive issues Haishuang Yan (1): ip_gre: fix wrong return value of erspan_rcv William Tu (23): gre: introduce native tunnel support for ERSPAN gre: fix goto statement typo gre: refactor the gre_fb_xmit compat/gre: add collect_md mode ip_gre: check packet length and mtu correctly in erspan tx ip_gre: Refactor the erpsan tunnel code. compat/erspan: refactor existing erspan code ip_gre: erspan: reload pointer after pskb_may_pull datapath: erspan: introduce erspan v2 for ip_gre compat: erspan: use bitfield instead of mask and offset datapath: add erspan version I and II support netdev-native-tnl: refactor the tunnel push header. userspace: add gre sequence number support. userspace: add erspan tunnel support. erspan: add kernel datapath support openvswitch: fix vport packet length check. erspan: auto detect truncated packets. ip6gre: add erspan v2 to tunnel lookup ip6erspan: improve error handling for erspan version number. ip6erspan: make sure enough headroom at xmit. erspan: auto detect truncated ipv6 packets. erspan: set bso when truncated bit is set. erspan: fix invalid erspan version. Xin Long (4): ip_gre: get key from session_id correctly in erspan_rcv ip_gre: set tunnel hlen properly in erspan_tunnel_init ip_gre: erspan device should keep dst ip_gre: remove the incorrect mtu limit for ipgre tap acinclude.m4 | 64 +- datapath/flow_netlink.c | 52 +- datapath/linux/Modules.mk | 5 +- datapath/linux/compat/gre.c | 246 +- datapath/linux/compat/include/linux/compiler.h | 4 + datapath/linux/compat/include/linux/etherdevice.h | 30 - datapath/linux/compat/include/linux/if_ether.h | 8 + datapath/linux/compat/include/linux/if_vlan.h | 11 - datapath/linux/compat/include/linux/kconfig.h | 8 - datapath/linux/compat/include/linux/kernel.h | 38 - .../linux/compat/include/linux/netdev_features.h | 19 - datapath/linux/compat/include/linux/netdevice.h | 12 +- datapath/linux/compat/include/linux/openvswitch.h | 4 + datapath/linux/compat/include/linux/skbuff.h | 47 +- datapath/linux/compat/include/linux/workqueue.h | 4 - datapath/linux/compat/include/net/checksum.h | 6 - datapath/linux/compat/include/net/dst.h | 28 +- datapath/linux/compat/include/net/dst_metadata.h | 23 +- datapath/linux/compat/include/net/erspan.h | 314 +++ datapath/linux/compat/include/net/genetlink.h | 11 - datapath/linux/compat/include/net/gre.h | 124 +- datapath/linux/compat/include/net/ip6_route.h | 23 - datapath/linux/compat/include/net/ip6_tunnel.h | 206 +- datapath/linux/compat/include/net/ip_tunnels.h | 236 +- datapath/linux/compat/include/net/ipv6.h | 44 +- .../include/net/netfilter/nf_conntrack_zones.h | 2 - datapath/linux/compat/include/net/netlink.h | 15 - datapath/linux/compat/include/net/route.h | 105 - datapath/linux/compat/ip6_gre.c | 2596 ++++++++++++++++++++ datapath/linux/compat/ip6_tunnel.c | 2199 +++++++++++++++++ datapath/linux/compat/ip_gre.c | 1237 +++++++++- datapath/linux/compat/ip_tunnel.c | 501 +++- datapath/linux/compat/ip_tunnels_core.c | 41 + datapath/linux/compat/lisp.c | 2 - datapath/linux/compat/stt.c | 6 - datapath/linux/compat/udp_tunnel.c | 2 - datapath/linux/compat/utils.c | 22 - datapath/vport.c | 33 +- include/openvswitch/flow.h | 4 +- include/openvswitch/match.h | 12 + include/openvswitch/meta-flow.h | 56 + include/openvswitch/packets.h | 6 +- lib/dpif-netlink-rtnl.c | 18 +- lib/dpif-netlink.c | 19 +- lib/flow.c | 32 +- lib/flow.h | 2 +- lib/match.c | 69 +- lib/meta-flow.c | 77 + lib/meta-flow.xml | 89 + lib/netdev-native-tnl.c | 223 +- lib/netdev-native-tnl.h | 18 +- lib/netdev-provider.h | 3 +- lib/netdev-vport.c | 119 +- lib/netdev.c | 2 +- lib/netdev.h | 12 + lib/nx-match.c | 13 +- lib/odp-util.c | 243 +- lib/odp-util.h | 2 +- lib/ofp-match.c | 2 +- lib/packets.h | 126 + lib/tnl-ports.c | 3 +- ofproto/ofproto-dpif-rid.h | 2 +- ofproto/ofproto-dpif-xlate.c | 5 +- ofproto/tunnel.c | 16 + tests/odp.at | 29 +- tests/ofproto.at | 6 +- tests/system-common-macros.at | 5 + tests/system-traffic.at | 147 ++ tests/tunnel-push-pop-ipv6.at | 129 +- tests/tunnel-push-pop.at | 206 +- tests/tunnel.at | 155 ++ vswitchd/vswitch.xml | 41 + 72 files changed, 9509 insertions(+), 710 deletions(-) create mode 100644 datapath/linux/compat/include/net/erspan.h create mode 100644 datapath/linux/compat/ip6_gre.c create mode 100644 datapath/linux/compat/ip6_tunnel.c