From patchwork Wed Jun 6 16:02:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10450613 X-Patchwork-Delegate: idosch@idosch.org 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 15D1C6054D for ; Wed, 6 Jun 2018 16:02:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 063B429960 for ; Wed, 6 Jun 2018 16:02:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04E5A2997A; Wed, 6 Jun 2018 16:02:34 +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 43A6B299C0 for ; Wed, 6 Jun 2018 16:02:25 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 411D2l5PtVzF31N for ; Thu, 7 Jun 2018 02:02:23 +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="aTFg3Fhd"; 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.5.63; helo=eur03-ve1-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="aTFg3Fhd"; dkim-atps=neutral Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50063.outbound.protection.outlook.com [40.107.5.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 411D2f2Dz8zF31S for ; Thu, 7 Jun 2018 02:02:17 +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:X-MS-Exchange-SenderADCheck; bh=4ZdD5N3hwdlGlO3iq3XP3gA975GvCtiFdJyFCAF1u0I=; b=aTFg3FhdfpiYHxUm0oiS/j+Ej+V0u8zTtrKf08o+gXT32QiHCU2242kK39g6O7zrecQAlqtX4hzD7R4ZhExBZ/JcN54+qrZ+z5JR0VE70hHyX+Q0u4Bpd4yoQOJqDKHoxO2m5N/ch4bFwDgHOCELagtKKuMYZNSumPRjMkf3uqg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) 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_GCM_SHA384) id 15.20.841.14; Wed, 6 Jun 2018 16:02:12 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw 1/2] selftests: forwarding: Test mirror-to-gre w/ UL 802.1d In-Reply-To: References: Message-Id: <7a309535b45293297f2c4663e45900e75032e095.1528300674.git.petrm@mellanox.com> Date: Wed, 06 Jun 2018 18:02:07 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: LNXP265CA0016.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::28) 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)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:11XoxjMxv++z/pJeHwOHCMIIIyNGnMWvd9ckuxgeXOLLEL9FUG4Nx+APC7C+C4QtK7ztvZW5Jacdi6QReRc3zA7PzLMkk4eHe6EJzfnLBEP/cv2h2y84RToOShWUWVrPInX8y6XEC2VByfVCTK3gZoaFU3eozMH5CxbwY6RUsbkPpJlDoEMgnLO2+l4GWCy9xhqsQScQSfobZ5Ixb3sxggPvEPb5KzQHfG9w21O9pRJ3zz/hOA9Oas8qYh7RHKH3; 25:aBfJlmwvq+FPuJ8phOCW4vZzEnoZV/IuZmfuXaj4gAi2Pw7Zuw6q+kf65LlQVxuiOWW9TirA+15cR5ltWUxaaZOX+2K5+8g7xLzUthBz4Amqr+cqwHnANZUHAt0YQFF90jrMkdWUtnEK04eMlJDjsLKnC0AGB3sDRhB6duW7zVEdTj53ZJwoY3P3Ne0tUa4K+esJITNannWZG0W5t8YUhgwNQVN5v8hHWBJ8qcEgq7X2UsHb4UHK98utAgNqH9ZFLEdUPSeeEm94SgqYXbnVcCCeXXYs55d8WugWYJx3f01LH3pUZoTuznkugJKhHpFdWTC2C8sZpophQaNDfBQYog==; 31:2RwLFs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/T73VXj5fEYqPyw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 06952FC175 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(366004)(346002)(376002)(199004)(189003)(25786009)(16586007)(3846002)(6116002)(58126008)(37006003)(68736007)(2351001)(5660300001)(2616005)(956004)(478600001)(446003)(11346002)(476003)(486006)(2906002)(305945005)(6486002)(105586002)(53936002)(7736002)(106356001)(316002)(36756003)(81166006)(81156014)(8936002)(8676002)(66066001)(47776003)(386003)(48376002)(6666003)(186003)(6496006)(86362001)(51416003)(97736004)(26005)(118296001)(76176011)(6636002)(50466002)(52116002)(6862004)(16526019); 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:RaKcfIaHXmigAdZE4DhPoLw7/QBUfwXaKRa6ZBzob?= =?us-ascii?Q?nKI2Zxd0HCz4N4tRIrIkHNQg57Hc9IhFAT6aKNDfBBIW6c3C/6ZBuXxSz/s8?= =?us-ascii?Q?4o/pUK3kE1/5xH0dcDI98eh+w05AL4iU4T24bRCu3mc2U6zZ+Wy+O8I/0JmP?= =?us-ascii?Q?unxeoQLV6z9TPp16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OBZQQDgg0C6MYWfgtXV2s2pKdX+7mHMcMRKT9CO0R6JUtltobRtI=; 24:siJlQjFRE7X7V+aIhCUczi0kgd9HYEvRkjYr/HozDV4qZSmRvbWonVr7NQqLOKeEUuTmpO2x78DF8zvgAOaTS7ZA0T06bDQYpI5S6jBPEl4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:IazP2D3f5+OHHAgjTc7/VZ7NGN0rBimYaRMGRqi/WUA0Zsla5BNfknb2pyDUYYBAH8lk0dI3HXszjeM6N5cqYVfjhiyvC5AWnEwutzs5ZQ3LAAYSAMWbWBxIjepwhmejxgo0lPdHfrc4efV4gE7JKwL1C5Dn4xZociFm81jTF/3JZnBu6vp6TkrSeir+eAaxxbfJHdvb2F/RwrWfZP5QxFHBVFhnzZkCUwUnoUr1P+M5Z8BKcvNY0cagblGL0mgU X-MS-Office365-Filtering-Correlation-Id: 008a374b-8391-4dcd-88f9-08d5cbc6ddd1 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2018 16:02:12.5301 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 008a374b-8391-4dcd-88f9-08d5cbc6ddd1 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: , Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP Test for "tc action mirred egress mirror" that mirrors to gretap when the underlay route points at a VLAN-unaware bridge (802.1d). Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_bridge_1d.sh | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh new file mode 100755 index 0000000..15d95e1 --- /dev/null +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh @@ -0,0 +1,99 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +# This test uses standard topology for testing gretap. See +# mirror_gre_topo_lib.sh for more details. +# +# Test for "tc action mirred egress mirror" when the underlay route points at a +# bridge device without vlan filtering (802.1d). + +ALL_TESTS=" + test_gretap + test_ip6gretap +" + +NUM_NETIFS=6 +source lib.sh +source mirror_lib.sh +source mirror_gre_lib.sh +source mirror_gre_topo_lib.sh + +setup_prepare() +{ + h1=${NETIFS[p1]} + swp1=${NETIFS[p2]} + + swp2=${NETIFS[p3]} + h2=${NETIFS[p4]} + + swp3=${NETIFS[p5]} + h3=${NETIFS[p6]} + + vrf_prepare + mirror_gre_topo_create + + ip link add name br2 type bridge vlan_filtering 0 + ip link set dev br2 up + + ip link set dev $swp3 master br2 + ip route add 192.0.2.130/32 dev br2 + ip -6 route add 2001:db8:2::2/128 dev br2 + + ip address add dev br2 192.0.2.129/32 + ip address add dev br2 2001:db8:2::1/128 + + ip address add dev $h3 192.0.2.130/28 + ip address add dev $h3 2001:db8:2::2/64 +} + +cleanup() +{ + pre_cleanup + + ip address del dev $h3 2001:db8:2::2/64 + ip address del dev $h3 192.0.2.130/28 + ip link del dev br2 + + mirror_gre_topo_destroy + vrf_cleanup +} + +test_gretap() +{ + full_test_span_gre_dir gt4 ingress 8 0 "mirror to gretap" + full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap" +} + +test_ip6gretap() +{ + full_test_span_gre_dir gt6 ingress 8 0 "mirror to ip6gretap" + full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap" +} + +test_all() +{ + slow_path_trap_install $swp1 ingress + slow_path_trap_install $swp1 egress + + tests_run + + 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