From patchwork Mon Jul 30 14:40:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10549183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AD2B13BB for ; Mon, 30 Jul 2018 14:40:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A63329FFD for ; Mon, 30 Jul 2018 14:40:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67DBD29F98; Mon, 30 Jul 2018 14:40:13 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, LOTS_OF_MONEY,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A813B29FEC for ; Mon, 30 Jul 2018 14:40:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731971AbeG3QPa (ORCPT ); Mon, 30 Jul 2018 12:15:30 -0400 Received: from mail-eopbgr20041.outbound.protection.outlook.com ([40.107.2.41]:2752 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731799AbeG3QP3 (ORCPT ); Mon, 30 Jul 2018 12:15:29 -0400 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=PTRTafE5N7N+j5/y0d4P3oSeyUaYLdNIJmH4TOA7B3o=; b=EVifA0mBqcDX5R7rhShoE0UeL9HsJnrG6lo9nGjAycrjbMct50+13J6X7zPR8gi0NR63kOk6dh2qBT04ET+/nnj2MaKEldCmzcMUOd6r7GOmouQ4tInxWTvHun2pkitDD5IYLJyKZxrt5zYC9W95G1kvGaEzNSI0Q5PXkjggKMo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by DB7PR05MB4186.eurprd05.prod.outlook.com (2603:10a6:5:18::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Mon, 30 Jul 2018 14:40:06 +0000 From: Petr Machata To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: davem@davemloft.net, shuah@kernel.org Subject: [PATCH net-next 4/5] selftests: forwarding: Test mirror-to-gretap w/ UL team In-Reply-To: References: Message-Id: <5f59e969cf175b57e1d399f3489d0e46811d6d65.1532961216.git.petrm@mellanox.com> Date: Mon, 30 Jul 2018 16:40:02 +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: AM5PR0602CA0007.eurprd06.prod.outlook.com (2603:10a6:203:a3::17) To DB7PR05MB4186.eurprd05.prod.outlook.com (2603:10a6:5:18::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb26fc95-c3c0-4456-720f-08d5f62a5823 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB7PR05MB4186; X-Microsoft-Exchange-Diagnostics: 1;DB7PR05MB4186;3:t6QhyMGC9ddjNHRYIfcWAULRrxt55Dvyec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xofWo63Gtyd56zgK7w9t6/tJva6NVob8bGIjRc12655bu7V96o/3hMjI015mTBUTolHAFH6zLcEQbDmQhS7P1UVuYmnqOs0KCUB2ctcIZFxgEtXNasY4yF6oypk3gTG4jCcT0T+iUyq3Ziwhi8matrE3QhQBC4jvuP4k9PB3fNEH4QaxZFYcgiuucoMQHzMvxVwW77Sd0Cm2n4QIdV3+/P3l05WYKi0ue6Am2Ix9jAI8LGXYSsl5qGq6IxPkbsqLlZ1WNPwewFEN2epgW3mlNBHfBpS3+A4cGLTskdizVUD0j466n76;4:hyT1OjVJX9H9QYyKunKge1hZGeT/JV0qkdYDRwURBzXpNi0clASJEHZymwtoj+x9TOEOEJc1R9lZe0V980te55ke0qFXjyVsfCNK6Ap2jItemORcKS2c6bSAZ12cBXfQBFYY8G7W0Jf4cq/hBEpW4gQ6a/v81p7hNU/Axo1GxN20l5BFbFRJw5a5pwq3gqCWaDBOk+vVRS/LnuvIRka5J16XizFJgA64DMxrRcvTME3uuhyDyHM/B1EReK3Xqs8inRj/PFjUSriC8rwNYtAAUA== 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)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DB7PR05MB4186;BCL:0;PCL:0;RULEID:;SRVR:DB7PR05MB4186; X-Forefront-PRVS: 0749DC2CE6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(136003)(366004)(346002)(39860400002)(376002)(199004)(189003)(478600001)(50466002)(48376002)(305945005)(7736002)(8676002)(105586002)(47776003)(66066001)(25786009)(8936002)(106356001)(81156014)(81166006)(476003)(3846002)(2616005)(486006)(4326008)(956004)(97736004)(118296001)(6486002)(36756003)(53936002)(68736007)(2906002)(5660300001)(16526019)(14444005)(446003)(11346002)(6116002)(86362001)(58126008)(26005)(316002)(76176011)(186003)(6496006)(6666003)(51416003)(16586007)(52116002)(386003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR05MB4186;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: 1;DB7PR05MB4186;23:7cyhNazoar6wnGWk0zk4oYvCBmZxruNNE0nGeQrJKcFTkPo2i1u0jpsMQh0QOB0HxwLuHNiRnleQYeFBwhg6QeKsORxeZkhbd2Ie3qcInbt+4mn29IUe3KynmdznGmh+jEZ5bz4GvCZeBNcch3X/apJ4+Y7WZOrUzyjRufxIxp9oPslKi2xphmjbYFc06dPHV2Hko+vMMPUvM+BvBisRKF5oXb39/WtFwdea+4hIZp5i4vtd0VZQ6SXMkOHEHGE65ccVNvkub/vVDWfUWaEkbOH/swS5qpcVQeLa1hrtC6ijcGEHfEJVhd7f1JnNQWD59fXerQ75ajrP2BMpQewYsZte4Trh5Sga0beJxKUYII0eJwu5YcjD+CLzyz9KWq3KU/vGycGMH8d7kUkzv44mOmHinltSnW29SN5W6vgNq9IWv4TyXQ2m0qlecBcbOUsEySL5djdasfRXxW1rVsnxaS7oUmGP5HWeewIJFpwJ5Vs1Lj9YTokPrU/VbbHV8JF2GRwyhT8LVL0bybZROZf8Yi0z0wGqHX4ma6LCWIueETv1QMk6f8mWmzIFLFu39/JrL6vyPOSX43fE19jX7ot58/fruaaUGe4V6OPEVgmbmmSXDgZ5Ug/pg5u7V2ft5gGLLxnnWlaUzuzeOPpN7KsUA1B3vOn4c51cyMevmo/BtlwOl72lyCROQ+9euN41jofwxneN8fS78KaFXatVuCrpMWrMdtUAUxZbfG5mp5ztZiWa9c2zBt01iOOf62zJQr5fp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i9OGTxhSw1MBAPrypUUx9DuEmsMO2qUq/vAbYQ+mblNLsZNJXtgTKIqVfMnLwk5DXYa+ZJtoXc+m3+Oc07gOycgwPS9AiN4SXS7gf+xrw2d8oV+Rw0znY9vZWMSze7fZb8NhHGkuK0YWQFMcSfsUvlsffDaRtraqI45XVFJi4kgxTcx0bNbAoY4tOSvP52NztHEP6U0T4B69y7lQIJg==;5:9NDWRDrZPB0zjAWXYcgcN4m+aCIGp6R3c5J97p6nmugaFbPUaTFxw9QqTiZrGDKvWHzJpL9l1cXYRUbjlHgZQOTneVF9b0WaRtvShoUI0Zl6AYTx09/hrJgwxcWFIP82seIQNYI3jxl7MUVJKbBA1rqvqQ94jpgPmk3lVZ3rrlI=;7:AUalVveMY0XtnjNYAvvVpQL/Jt4f/66LWYeQhnsRQ0F6JFPPwLc5aV4XzNMCMn4badA+TcaBlHTyrdTzlq6o97ZxmMEXQqHBlTIhlTNII+ApB0VuknrckGzBRVwWv8Lom2Pvtp7funY9/UfP8KMAmuSymOUByMKwXxvVmtmASYt/G/hx9EK6B23zGPo5Lwi1zOVL8+UMgyWZT2bsaRD/2wywSLZap1lfsI+1VQyPc10+d2WyI6NyeqFRd322Neic SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 14:40:06.7048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb26fc95-c3c0-4456-720f-08d5f62a5823 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4186 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.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), and the traffic egresses the bridge through a team device. Test upping and downing individual team device slaves and verify the traffic flows as expected. Signed-off-by: Petr Machata --- .../net/forwarding/mirror_gre_bridge_1q_lag.sh | 283 +++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh new file mode 100755 index 000000000000..61844caf671e --- /dev/null +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh @@ -0,0 +1,283 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +# Test for "tc action mirred egress mirror" when the underlay route points at a +# bridge device with vlan filtering (802.1q), and the egress device is a team +# device. +# +# +----------------------+ +----------------------+ +# | H1 | | H2 | +# | + $h1.333 | | $h1.555 + | +# | | 192.0.2.1/28 | | 192.0.2.18/28 | | +# +-----|----------------+ +----------------|-----+ +# | $h1 | +# +--------------------------------+------------------------------+ +# | +# +--------------------------------------|------------------------------------+ +# | SW o---> mirror | +# | | | +# | +--------------------------------+------------------------------+ | +# | | $swp1 | | +# | + $swp1.333 $swp1.555 + | +# | 192.0.2.2/28 192.0.2.17/28 | +# | | +# | +-----------------------------------------------------------------------+ | +# | | BR1 (802.1q) | | +# | | + lag (team) 192.0.2.129/28 | | +# | | / \ 2001:db8:2::1/64 | | +# | +---/---\---------------------------------------------------------------+ | +# | / \ ^ | +# | | \ + gt4 (gretap) | | +# | | \ loc=192.0.2.129 | | +# | | \ rem=192.0.2.130 -+ | +# | | \ ttl=100 | +# | | \ tos=inherit | +# | | \ | +# | | \_________________________________ | +# | | \ | +# | + $swp3 + $swp4 | +# +---|------------------------------------------------|----------------------+ +# | | +# +---|----------------------+ +---|----------------------+ +# | + $h3 H3 | | + $h4 H4 | +# | 192.0.2.130/28 | | 192.0.2.130/28 | +# | 2001:db8:2::2/64 | | 2001:db8:2::2/64 | +# +--------------------------+ +--------------------------+ + +ALL_TESTS=" + test_mirror_gretap_first + test_mirror_gretap_second +" + +NUM_NETIFS=6 +source lib.sh +source mirror_lib.sh +source mirror_gre_lib.sh + +require_command $ARPING + +vlan_host_create() +{ + local if_name=$1; shift + local vid=$1; shift + local vrf_name=$1; shift + local ips=("${@}") + + vrf_create $vrf_name + ip link set dev $vrf_name up + vlan_create $if_name $vid $vrf_name "${ips[@]}" +} + +vlan_host_destroy() +{ + local if_name=$1; shift + local vid=$1; shift + local vrf_name=$1; shift + + vlan_destroy $if_name $vid + ip link set dev $vrf_name down + vrf_destroy $vrf_name +} + +h1_create() +{ + vlan_host_create $h1 333 vrf-h1 192.0.2.1/28 + ip -4 route add 192.0.2.16/28 vrf vrf-h1 nexthop via 192.0.2.2 +} + +h1_destroy() +{ + ip -4 route del 192.0.2.16/28 vrf vrf-h1 + vlan_host_destroy $h1 333 vrf-h1 +} + +h2_create() +{ + vlan_host_create $h1 555 vrf-h2 192.0.2.18/28 + ip -4 route add 192.0.2.0/28 vrf vrf-h2 nexthop via 192.0.2.17 +} + +h2_destroy() +{ + ip -4 route del 192.0.2.0/28 vrf vrf-h2 + vlan_host_destroy $h1 555 vrf-h2 +} + +h3_create() +{ + simple_if_init $h3 192.0.2.130/28 + tc qdisc add dev $h3 clsact +} + +h3_destroy() +{ + tc qdisc del dev $h3 clsact + simple_if_fini $h3 192.0.2.130/28 +} + +h4_create() +{ + simple_if_init $h4 192.0.2.130/28 + tc qdisc add dev $h4 clsact +} + +h4_destroy() +{ + tc qdisc del dev $h4 clsact + simple_if_fini $h4 192.0.2.130/28 +} + +switch_create() +{ + ip link set dev $swp1 up + tc qdisc add dev $swp1 clsact + vlan_create $swp1 333 "" 192.0.2.2/28 + vlan_create $swp1 555 "" 192.0.2.17/28 + + tunnel_create gt4 gretap 192.0.2.129 192.0.2.130 \ + ttl 100 tos inherit + + ip link set dev $swp3 up + ip link set dev $swp4 up + + ip link add name br1 type bridge vlan_filtering 1 + ip link set dev br1 up + __addr_add_del br1 add 192.0.2.129/32 + ip -4 route add 192.0.2.130/32 dev br1 + + team_create lag loadbalance $swp3 $swp4 + ip link set dev lag master br1 +} + +switch_destroy() +{ + ip link set dev lag nomaster + team_destroy lag + + ip -4 route del 192.0.2.130/32 dev br1 + __addr_add_del br1 del 192.0.2.129/32 + ip link set dev br1 down + ip link del dev br1 + + ip link set dev $swp4 down + ip link set dev $swp3 down + + tunnel_destroy gt4 + + vlan_destroy $swp1 555 + vlan_destroy $swp1 333 + tc qdisc del dev $swp1 clsact + ip link set dev $swp1 down +} + +setup_prepare() +{ + h1=${NETIFS[p1]} + swp1=${NETIFS[p2]} + + swp3=${NETIFS[p3]} + h3=${NETIFS[p4]} + + swp4=${NETIFS[p5]} + h4=${NETIFS[p6]} + + vrf_prepare + + ip link set dev $h1 up + h1_create + h2_create + h3_create + h4_create + switch_create + + trap_install $h3 ingress + trap_install $h4 ingress +} + +cleanup() +{ + pre_cleanup + + trap_uninstall $h4 ingress + trap_uninstall $h3 ingress + + switch_destroy + h4_destroy + h3_destroy + h2_destroy + h1_destroy + ip link set dev $h1 down + + vrf_cleanup +} + +test_lag_slave() +{ + local host_dev=$1; shift + local up_dev=$1; shift + local down_dev=$1; shift + local what=$1; shift + + RET=0 + + mirror_install $swp1 ingress gt4 \ + "proto 802.1q flower vlan_id 333 $tcflags" + + # Test connectivity through $up_dev when $down_dev is set down. + ip link set dev $down_dev down + setup_wait_dev $up_dev + setup_wait_dev $host_dev + $ARPING -I br1 192.0.2.130 -qfc 1 + sleep 2 + mirror_test vrf-h1 192.0.2.1 192.0.2.18 $host_dev 1 10 + + # Test lack of connectivity when both slaves are down. + ip link set dev $up_dev down + sleep 2 + mirror_test vrf-h1 192.0.2.1 192.0.2.18 $h3 1 0 + mirror_test vrf-h1 192.0.2.1 192.0.2.18 $h4 1 0 + + ip link set dev $up_dev up + ip link set dev $down_dev up + mirror_uninstall $swp1 ingress + + log_test "$what ($tcflags)" +} + +test_mirror_gretap_first() +{ + test_lag_slave $h3 $swp3 $swp4 "mirror to gretap: LAG first slave" +} + +test_mirror_gretap_second() +{ + test_lag_slave $h4 $swp4 $swp3 "mirror to gretap: LAG second slave" +} + +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