From patchwork Wed Jun 6 16:02:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10450617 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 B540460234 for ; Wed, 6 Jun 2018 16:02:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A41AE29960 for ; Wed, 6 Jun 2018 16:02:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23EAE2992E; Wed, 6 Jun 2018 16:02:35 +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 ABFE729A02 for ; Wed, 6 Jun 2018 16:02:31 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 411D2t1Wx1zF31S for ; Thu, 7 Jun 2018 02:02:30 +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="nXh5BiCg"; 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=104.47.2.88; helo=eur01-db5-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="nXh5BiCg"; dkim-atps=neutral Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0088.outbound.protection.outlook.com [104.47.2.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 411D2p1hnzzF31N for ; Thu, 7 Jun 2018 02:02:26 +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=i4X4nyBVStpSBDh4LWlxfi0JisAgCAaPMUmfUpeu5lc=; b=nXh5BiCgG3gIPqwIIDt8glaJ0yeVD3KT+Tq5b4MI6TiszhxNywcb4/oBcwVdtSmoi0GTN/jAzJXAumOHzrVjvTQ3EWHpArjTKe4V3qnYjEvBW4OQUrhVoycxUkAor2BB/roI4LsapyoloPsWMIlSwSgYW3T6FGkRstcMy2WThkw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM6PR05MB4182.eurprd05.prod.outlook.com (2603:10a6:209:40::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.14; Wed, 6 Jun 2018 16:02:19 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw 2/2] selftests: forwarding: Test mirror-to-gre w/ UL 802.1q In-Reply-To: References: Message-Id: <99c125e0a91f7fa38b3aafb0f34d52a7579fa7a1.1528300674.git.petrm@mellanox.com> Date: Wed, 06 Jun 2018 18:02:14 +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: LNXP265CA0087.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::27) To AM6PR05MB4182.eurprd05.prod.outlook.com (2603:10a6:209:40::27) 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:AM6PR05MB4182; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4182; 3:txhH5s332/maXW/7sE4Ls2tQvq7MNxzIAmgOTxXSX8fOAxiH636X7rVISer9KBcpYloPOHW/9Z+5MHL6DiUV9mGNFuBovVXZrg8a6HnABUdGUuwTQbCIEDWKkBGaN0K32JXCOuU3qf0IbRj8Emrd7vOms+13ra94qSGD29dL3t1mZi6i2uXHWeTmiwEd6rSwlYXOSUrFVjvbuw9vMl+7sRUPHTcTVp7syHQFG2mLbtYNCjuC11NUEpPv4PVs1B9o; 25:MbSnV3YcQfxvMZQn6YnxZXAeMql9fRyGwzyCUq23t6GZ+lI5bBKuR6bdZTLaz2Racjb4jMHXu5FRE97gK3xyjpGfVCkKCz82eafPQnQCn4PTTrI/EG6uqFx7Iy2nRcDw2Pbha1PQ0XGkCCmvjoL8pjBAWk2YAgBD/HWlR4CJWzM1/cQlDQFAO0PMsGnFWgYSQQZq3aXF7c4Pf4XMj97QpQOzVnFxzc213QZmEanBEzIs6e27Hi3kKh2PKTAosOkWtbzom2y/hauQIiyfwaCYY+6tKq/HqAlXw3T5UxQB0WYDXCq3hugSH9KuAOR4I8T8bYNrnznp6+pFFuQ68SkNwA==; 31:/H7kTzWO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01A0L5s+oG+kr2JQ== 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)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM6PR05MB4182; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4182; X-Forefront-PRVS: 06952FC175 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(50466002)(48376002)(86362001)(97736004)(105586002)(106356001)(47776003)(66066001)(2351001)(6486002)(478600001)(6862004)(53936002)(16586007)(25786009)(37006003)(58126008)(36756003)(316002)(16526019)(186003)(26005)(76176011)(52116002)(446003)(11346002)(6496006)(386003)(476003)(956004)(2616005)(486006)(118296001)(8676002)(81156014)(81166006)(8936002)(6116002)(3846002)(68736007)(5660300001)(6636002)(7736002)(305945005)(6666003)(2906002)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4182; 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; AM6PR05MB4182; 23:b0ByD53eex5O8XjwHmoCcN+rbyWf+H4JzPTxp5hWK?= =?us-ascii?Q?BJBpJ+RUmgL8+E2eAX91t6bPl2WX1p5jEiFevLJUp3VqUl1to/+Eb2br4tbI?= =?us-ascii?Q?pMTXOAw0g2pGtOTGdaNHuAFr38KjjGKHRpELq6v/+ToKRUUFWau/7DmRIKVw?= =?us-ascii?Q?f3I32P8LfgcghB4CdsTqi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YdZOADHrwr2PldrP6KHV9TqZRSY+Msd8OCEsFqbiDMFxY=; 24:6idnKcD1KtmAtUMs/lGurC5Yq1yj7nGwXZVKQi56vBMTBnObDUbOWz9eZhJERkU2o/tH8/sYpwGFcLtQCZzQ8KYw/vpwyj0ooXRrphicDOM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4182; 7:W5EnYxLo3PvMcKeZtogWERzeat1x+cCfd3yJzZ4kfra0DhCJFHGUbzclt62jkdRxHaFhx66YW5ia/kahUVeLgqwn/ZjHX3OnWkDKqxvPzueRmfKqL6lNOVkk11ODeC3UfQVQJeJEuIodQSwdgz7TeU2wdA/tKLHpqfy28RWsKRxloMDsI2SCFSbzh2DvbesJYIGdYeljw4JpmyRdd4OVrUBbJSgXi+Y7uPZI1KciX7Yu9XNt+Qmco10TViFpa9Xh X-MS-Office365-Filtering-Correlation-Id: e5d5df70-6593-43bf-4439-08d5cbc6e1c1 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2018 16:02:19.1483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5d5df70-6593-43bf-4439-08d5cbc6e1c1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4182 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-aware bridge (802.1q). Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_bridge_1q.sh | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh new file mode 100755 index 0000000..55f1fab --- /dev/null +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh @@ -0,0 +1,96 @@ +#!/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 with vlan filtering (802.1q). + +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 set dev $swp3 master br1 + bridge vlan add dev br1 vid 555 pvid untagged self + ip address add dev br1 192.0.2.129/32 + ip address add dev br1 2001:db8:2::1/128 + + ip -4 route add 192.0.2.130/32 dev br1 + ip -6 route add 2001:db8:2::2/128 dev br1 + + vlan_create $h3 555 v$h3 192.0.2.130/28 2001:db8:2::2/64 + bridge vlan add dev $swp3 vid 555 +} + +cleanup() +{ + pre_cleanup + + ip link set dev $swp3 nomaster + vlan_destroy $h3 555 + + 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" +} + +tests() +{ + 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" +tests + +if ! tc_offload_check; then + echo "WARN: Could not test offloaded functionality" +else + tcflags="skip_sw" + tests +fi + +exit $EXIT_STATUS