From patchwork Thu May 17 21:14:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 915772 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="kUIS14Xz"; 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 40n3xX14mjz9s2S for ; Fri, 18 May 2018 07:15:42 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E60D5DC1; Thu, 17 May 2018 21:15:40 +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 56808D7A for ; Thu, 17 May 2018 21:15:39 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 991066CF for ; Thu, 17 May 2018 21:15:37 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id ay10-v6so3278101plb.1 for ; Thu, 17 May 2018 14:15:37 -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=+YGTvawBWDI4aMGqXkS3znWNVa2kiGcnuGzBd+hnQKc=; b=kUIS14XzayNZOd2iC08t5YnZ56DN7OXgqpRKyVi0SoSG587aAykmJcn+ospeaTl5Ca tJdTJbpkydSzZU5HdDcNiK81B4uvfMVsooIhsRr014B3Ek92GqPldsSGru78o1UFF2Ol dunezFkLy1bcrCS302yzhC/fiOjPhFmRChVopRzAcpC9b5qlU5WhpZs8Yjz/OIJc3ZhX rghzFaTMVO5T4vxRfxS3cRwxZbjLjB2TivnKPXkdRQ55k1vrdlacN41gau/aauGcBcTO nK1YGraovIHY0M5JogjGmIg5wqXMcPpGZqVqa7sKRFcDNrzzygkXuFGsddS24PZcp8+3 4pfA== 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=+YGTvawBWDI4aMGqXkS3znWNVa2kiGcnuGzBd+hnQKc=; b=HBE4c/Bl57CEAAlhOG6WU7n0bQELShRVZoH3l3wo+g9I42ZcsFdX6GHgQe82p+v91W nuAjWY7Um0GokJJDnznFCruAE629SPykiMciXY5dZkPVgdSVmqSu7H9/BSr4BS3xs+Yp G9xtkSLcmNQfq2ekIzP7EUIz9D0mxwD6zrd61qPliJnS3qZU37QDNNzygw1DvSBSnuMN c0pSc7NxwUgYg+F+tzOBkDWKNEQNtYHPkrqNp5TjovljMWt/7GZyltjlUqkPRtcZS07k 0Goqb4E3gF2PEW7EOnlFjGrkgzAdQNIk35Ru6p0a1JJvVmwh4DR5dIRtRU5tpRCJokr0 P9kw== X-Gm-Message-State: ALKqPweO5PH5uNzof/YbRgLbUF4savT+gqFHlToQq8Bd/PH6YydOVuwD efUye0sZNmLOkmbetDnFFI5l0w== X-Google-Smtp-Source: AB8JxZqjjtqfv7cwdc3Zrn78pRY+B9Zx8VsiRBbPJEqPNi1zCqa+zisSWK1sfp4HGt3YatCZ1GWvbw== X-Received: by 2002:a17:902:694b:: with SMTP id k11-v6mr6753968plt.334.1526591736756; Thu, 17 May 2018 14:15:36 -0700 (PDT) Received: from gizo.domain (97-115-125-157.ptld.qwest.net. [97.115.125.157]) by smtp.gmail.com with ESMTPSA id r68-v6sm12410581pfi.174.2018.05.17.14.15.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 14:15:36 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 17 May 2018 14:14:52 -0700 Message-Id: <1526591733-4450-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 00/41] 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 branch on my public github repository. https://github.com/gvrose8192/ovs-experimental/tree/erspan-combo-24 Greg Rose (11): 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 ip6gre: Add ip6gre vport type lib/dpif-netlink: Fix miscompare of gre ports datapath: Add dellink op to ip6gre and ip6erspan tap ops datapath: Use correct tunnel receive for ip6gre 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 (25): 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. erspan: Add flow-based erspan options 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. tunnel: add support for erspan and ip6erspan type. 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 | 86 + 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 | 245 +- 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 | 25 +- tests/ofproto.at | 6 +- tests/system-common-macros.at | 5 + tests/system-traffic.at | 147 ++ tests/tunnel-push-pop-ipv6.at | 118 + tests/tunnel-push-pop.at | 178 +- tests/tunnel.at | 155 ++ vswitchd/vswitch.xml | 41 + 72 files changed, 9466 insertions(+), 709 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