From patchwork Thu Apr 26 23:19:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10367009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E1886032C for ; Thu, 26 Apr 2018 23:21:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8483829252 for ; Thu, 26 Apr 2018 23:21:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 770022929E; Thu, 26 Apr 2018 23:21:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7E15129252 for ; Thu, 26 Apr 2018 23:21:08 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40XCjt4xDVzF25l for ; Fri, 27 Apr 2018 09:21:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="YRcNxWdC"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=40.107.3.80; helo=eur03-am5-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="YRcNxWdC"; dkim-atps=neutral Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40XCjp0n9bzF25Z for ; Fri, 27 Apr 2018 09:21:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cZ9JumZkyQiIwdwUhOQ4cwN8RAlCK15lorf1+9c1tM4=; b=YRcNxWdCC5eSu/VtYBeG2Sm7TWZffSr+g3V7KJvUIqAsI75Oysxp3nofMPIj448K0E4JSP8X9uNfDBzqWojpmiGm1gjTCLQ9z5Y0DCvB7U25JRBn6ysqTkeOUP5T1587OJ/DQZ50Is1ClNZJTZdDKJF4n/6pJRtiowdLfQ+oOUw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.176.83.59) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.15; Thu, 26 Apr 2018 23:20:56 +0000 From: Petr Machata To: netdev@vger.kernel.org Subject: [PATCH net-next 4/7] selftests: forwarding: Test mirror to gretap w/ bound dev In-Reply-To: References: Message-Id: <913f453a9d8181f3dfb7b2062eb32b7056210058.1524784510.git.petrm@mellanox.com> Date: Fri, 27 Apr 2018 01:19:55 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [89.176.83.59] X-ClientProxiedBy: PR0P264CA0038.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1::26) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:O6SmeHGsMnBTKscx8ltIg2ElOOK+A6X1Re4pMigmexWRqUUJWVtbJHhkHLvO3EmqNJjACD0zyDBi2Dc/TqPWtxLmnaKQmHa1xHCFyiUV9nTXXuI6q/lvzdzoUfDDuSM2zhOVxtcbsMoe/qLtjeC0CcKzuOirjDhG6i1+CfmdMhkiZN/HNCOI6w2LOfdJ4lrdNY2lGlNP0fcHuVnVgwB7oCl2lvMQPtkS/eZCnDLlr5adnS7ZEHADmSOndiczx+7J; 25:JIGbsw1tcRD9aYiRdTTQlg0YZK22qtEvKcCm+7gYMsAncL2qCNGfrVu90GgX2RZOe11wyJSwhFLtHzue8dgpvsxFcymLTTbUYx80ogO2GcYLGys0YfY8wZvvgFA83QlhtSN3lVTwEACfZxN6dnifCCf8T3YY/mxKL65rDZD3Pa9gvEu/iZ3IjfhaSfJhmTOMQjD9X8zpa3LYAN4UVsnZ8iMCDP0dUKY5odLtr9cN/gT3r1H2aHcMxuy2C5BmwHgA9yi7P8c4vG1zonHeDf3fZxUhuUHJhIOVi/4HVFTrVYDXp627eWq5n5ZWrdwXIH3eWx3KByx2tOVmGy+R3hiYXQ==; 31:X1BxpMT6izlkSebW6bkviXPncVnIMAkjjfg9a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-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231232)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(39380400002)(346002)(396003)(376002)(199004)(189003)(386003)(478600001)(6496006)(25786009)(4326008)(6116002)(2906002)(16526019)(2361001)(11346002)(7736002)(3846002)(956004)(446003)(2351001)(316002)(47776003)(16586007)(76176011)(36756003)(51416003)(52116002)(81156014)(8936002)(68736007)(81166006)(58126008)(8676002)(118296001)(26005)(97736004)(305945005)(6916009)(106356001)(2616005)(6486002)(476003)(53936002)(66066001)(5660300001)(105586002)(50466002)(486006)(86362001)(48376002)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4191; 23:IblTRAY9wQdtd9u+kv/o2YBzOdrioiRmEOmPp+zjp?= =?us-ascii?Q?0A//SJtbZo6Nfr+nR8H5Xj6ki7Wh1EcBTlCsBSPgalXAELRd+mz9JiFSmpMU?= =?us-ascii?Q?xTId5toBtjW4wFjFcQ8Seh7HNJ7U0stjx7i3LBaKtLsmD7oRdGWl7rUc1PE7?= =?us-ascii?Q?LvKnUuXtBGa+7RfhjeFTnKVB97AyPdR2/w/WI1LvY59c3tqdexp4c0eE4qYy?= =?us-ascii?Q?Xi/j8u0jtzO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BTOAVMjVpPpCSlNvHPhRfxAp+3Up3JZ/fzzi3UYDYZpzz+UO80C5F1cQTMsM1q+eGpw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:9vSGUdNnHBTmJ1BtRrPj9PQsyQRQQp7npiDiGCoU/W/+fg6Vnzx06VpVGfAlXGCXVih5Tr/l8KupnnVkwgKWxOYKJwfl525/I6uuJLr0VDROotSfds42FU50r0qB5HFLEzCETpv/V4wCqySGQ//Bkcv5+JkAnyokz4DbDXo90356oXhUDMlA2Wxq1HwiKLnEc7kPJKgJ3NQ4LevILw2EL2laogyZFtVPGtglhtPBZMjc+oyNLfhziT9o08aAnYTT X-MS-Office365-Filtering-Correlation-Id: 0b7dcb8b-fe5a-4237-e844-08d5abcc5d19 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 23:20:56.3012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b7dcb8b-fe5a-4237-e844-08d5abcc5d19 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mlxsw@lists.ozlabs.org, davem@davemloft.net Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org Sender: "Linux-mlxsw" X-Virus-Scanned: ClamAV using ClamSMTP Test mirroring to a gretap and an ip6gretap netdevice with a bound device, where the tunnel device and the bound device are in different VRFs (an overlay / underlay configuration). Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko --- .../selftests/net/forwarding/mirror_gre_bound.sh | 213 +++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/mirror_gre_bound.sh diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh new file mode 100755 index 0000000..3708ac0 --- /dev/null +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh @@ -0,0 +1,213 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +# +---------------------+ +---------------------+ +# | H1 | | H2 | +# | + $h1 | | $h2 + | +# | | 192.0.2.1/28 | | 192.0.2.2/28 | | +# +-----|---------------+ +---------------|-----+ +# | | +# +-----|-------------------------------------------------------------|-----+ +# | SW o--> mirror | | +# | +---|-------------------------------------------------------------|---+ | +# | | + $swp1 BR $swp2 + | | +# | +---------------------------------------------------------------------+ | +# | | +# | +---------------------------------------------------------------------+ | +# | | OL + gt6 (ip6gretap) + gt4 (gretap) | | +# | | : loc=2001:db8:2::1 : loc=192.0.2.129 | | +# | | : rem=2001:db8:2::2 : rem=192.0.2.130 | | +# | | : ttl=100 : ttl=100 | | +# | | : tos=inherit : tos=inherit | | +# | +-------------------------:--|-------------------:--|-----------------+ | +# | : | : | | +# | +-------------------------:--|-------------------:--|-----------------+ | +# | | UL : |,---------------------' | | +# | | + $swp3 : || : | | +# | | | 192.0.2.129/28 : vv : | | +# | | | 2001:db8:2::1/64 : + ul (dummy) : | | +# | +---|---------------------:----------------------:--------------------+ | +# +-----|---------------------:----------------------:----------------------+ +# | : : +# +-----|---------------------:----------------------:----------------------+ +# | H3 + $h3 + h3-gt6 (ip6gretap) + h3-gt4 (gretap) | +# | 192.0.2.130/28 loc=2001:db8:2::2 loc=192.0.2.130 | +# | 2001:db8:2::2/64 rem=2001:db8:2::1 rem=192.0.2.129 | +# | ttl=100 ttl=100 | +# | tos=inherit tos=inherit | +# | | +# +-------------------------------------------------------------------------+ +# +# This tests mirroring to gretap and ip6gretap configured in an overlay / +# underlay manner, i.e. with a bound dummy device that marks underlay VRF where +# the encapsulated packed should be routed. + +NUM_NETIFS=6 +source lib.sh +source mirror_lib.sh +source mirror_gre_lib.sh + +h1_create() +{ + simple_if_init $h1 192.0.2.1/28 +} + +h1_destroy() +{ + simple_if_fini $h1 192.0.2.1/28 +} + +h2_create() +{ + simple_if_init $h2 192.0.2.2/28 +} + +h2_destroy() +{ + simple_if_fini $h2 192.0.2.2/28 +} + +h3_create() +{ + simple_if_init $h3 192.0.2.130/28 2001:db8:2::2/64 + + tunnel_create h3-gt4 gretap 192.0.2.130 192.0.2.129 + ip link set h3-gt4 vrf v$h3 + matchall_sink_create h3-gt4 + + tunnel_create h3-gt6 ip6gretap 2001:db8:2::2 2001:db8:2::1 + ip link set h3-gt6 vrf v$h3 + matchall_sink_create h3-gt6 +} + +h3_destroy() +{ + tunnel_destroy h3-gt6 + tunnel_destroy h3-gt4 + + simple_if_fini $h3 192.0.2.130/28 2001:db8:2::2/64 +} + +switch_create() +{ + # Bridge between H1 and H2. + + ip link add name br1 type bridge vlan_filtering 1 + ip link set dev br1 up + + ip link set dev $swp1 master br1 + ip link set dev $swp1 up + + ip link set dev $swp2 master br1 + ip link set dev $swp2 up + + tc qdisc add dev $swp1 clsact + + # Underlay. + + simple_if_init $swp3 192.0.2.129/28 2001:db8:2::1/64 + + ip link add name ul type dummy + ip link set dev ul master v$swp3 + ip link set dev ul up + + # Overlay. + + vrf_create vrf-ol + ip link set dev vrf-ol up + + tunnel_create gt4 gretap 192.0.2.129 192.0.2.130 \ + ttl 100 tos inherit dev ul + ip link set dev gt4 master vrf-ol + ip link set dev gt4 up + + tunnel_create gt6 ip6gretap 2001:db8:2::1 2001:db8:2::2 \ + ttl 100 tos inherit dev ul allow-localremote + ip link set dev gt6 master vrf-ol + ip link set dev gt6 up +} + +switch_destroy() +{ + vrf_destroy vrf-ol + + tunnel_destroy gt6 + tunnel_destroy gt4 + + simple_if_fini $swp3 192.0.2.129/28 2001:db8:2::1/64 + + ip link del dev ul + + tc qdisc del dev $swp1 clsact + + ip link set dev $swp1 down + ip link set dev $swp2 down + ip link del dev br1 +} + +setup_prepare() +{ + h1=${NETIFS[p1]} + swp1=${NETIFS[p2]} + + swp2=${NETIFS[p3]} + h2=${NETIFS[p4]} + + swp3=${NETIFS[p5]} + h3=${NETIFS[p6]} + + vrf_prepare + + h1_create + h2_create + h3_create + + switch_create +} + +cleanup() +{ + pre_cleanup + + switch_destroy + + h3_destroy + h2_destroy + h1_destroy + + vrf_cleanup +} + +test_all() +{ + RET=0 + + slow_path_trap_install $swp1 ingress + slow_path_trap_install $swp1 egress + + full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap w/ UL" + full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap w/ UL" + + full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap w/ UL" + full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap w/ UL" + + slow_path_trap_uninstall $swp1 egress + slow_path_trap_uninstall $swp1 ingress +} + +trap cleanup EXIT + +setup_prepare +setup_wait + +tcflags="skip_hw" +test_all + +if ! tc_offload_check; then + echo "WARN: Could not test offloaded functionality" +else + tcflags="skip_sw" + test_all +fi + +exit $EXIT_STATUS