From patchwork Thu Jun 28 16:56:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10494573 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 9908E603EE for ; Thu, 28 Jun 2018 16:56:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22FA62A53B for ; Thu, 28 Jun 2018 16:56:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16DC02A590; Thu, 28 Jun 2018 16:56:46 +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, 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 DAE712A593 for ; Thu, 28 Jun 2018 16:56:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967393AbeF1Q4o (ORCPT ); Thu, 28 Jun 2018 12:56:44 -0400 Received: from mail-eopbgr80055.outbound.protection.outlook.com ([40.107.8.55]:12160 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965914AbeF1Q4m (ORCPT ); Thu, 28 Jun 2018 12:56:42 -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=ODhCg0MusmM4jhQAB1ViwLIiDrRPYNbh0UsAHpEQnzE=; b=PfSS9k2QFUsA5uNHA+StvToc4lwcecnXUHtsjRb1j1W5fH2l99C2/Wwq5zMdGySUaEYEeS3Hrc3Vz5A60fl3iN9BBx8TBwj1WlZ8Ef3VPTdCfGFCUehjBsjF1LTYL8/nezZrMZiW/v8+/jzyB6DInLQEWxb1RnHDlLChriav6j0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM0PR05MB4179.eurprd05.prod.outlook.com (2603:10a6:208:57::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.20; Thu, 28 Jun 2018 16:56:38 +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 3/4] selftests: forwarding: Tweak tc filters for mirror-to-gretap tests In-Reply-To: References: Message-Id: <2b0d63421c21703e02ee9aa8097dd8b86b875c53.1530204784.git.petrm@mellanox.com> Date: Thu, 28 Jun 2018 18:56:33 +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: VI1PR0202CA0015.eurprd02.prod.outlook.com (2603:10a6:803:14::28) To AM0PR05MB4179.eurprd05.prod.outlook.com (2603:10a6:208:57::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 698145d3-22f7-472e-71af-08d5dd181db6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM0PR05MB4179; X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4179; 3:D0dqyLmHvUgmsviDQp+iVE8bkmtVTuSVeq+I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3or7D0kaVkb1A/i/F41KHWmH6cesDuA9XnfXbk1gIkipV5AlQ60gtg8E3y+IfrwKBFi8ynSPZxI8lw4T3790A4qn3uvz8Lz1iI5cyQy2/CVedq3sP6bIcPacyPJNOt5Ds2HGM8iDpJIacY+8S2XKpKCv5ltMpecwt1UZxDQNbjfmXA0ba3zBzDVAG4VxdCh47/To+/zkAZGuXVQEGfhYPoazYgrQ1GsMKhhR3mtFeHait/enAE0VwDb+3QGJdT9GB/rV/IPNiDXu3if0D3syB36L6CW4r2qZtF5kQ5fk9pTUxtyxsPcH3BEaD5FWKiVe6; 4:ib7b8ZDqYON+DzHkK7P+Wuyv4tc6DwdFjtJUHxi96puyKp6dWu1JqexPSXH9WjA7+QNiqWGkgm6QstGuJ+ej39bKEx0bwK50hlmXvRqrfLCirZwN/BLSdqzebwap40ChgQfMUbsMgS1zOaM28f+255nuzaHcXIW71f3GpGjJjX1h0R4q15JVVzJWDXr7vPr96YiY4E8trUd326i0HVUXSoMh7Y+DmNuSZhFHTVXS5uBLo1dOpNWs24m5OddyM6GDb1553C3FZWN/srJNLTqRFA== 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)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM0PR05MB4179; BCL:0; PCL:0; RULEID:; SRVR:AM0PR05MB4179; X-Forefront-PRVS: 0717E25089 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(39860400002)(136003)(199004)(189003)(6486002)(486006)(476003)(956004)(11346002)(446003)(2616005)(36756003)(305945005)(7736002)(5660300001)(3846002)(8676002)(106356001)(81166006)(81156014)(86362001)(47776003)(186003)(16526019)(386003)(66066001)(26005)(105586002)(316002)(478600001)(16586007)(25786009)(58126008)(4326008)(6666003)(68736007)(6116002)(8936002)(97736004)(53936002)(2906002)(51416003)(76176011)(52116002)(6496006)(50466002)(118296001)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4179; 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; AM0PR05MB4179; 23:H3m8as6cPgAoGPvOQpBwFalKGk7sHFytoOH87KsEJ?= =?us-ascii?Q?kf3FwoYnkVeu+CDEd+UPOq2Bzgb5PXm0IfPheg4mLm8eMy+Be5E1L5jbIGot?= =?us-ascii?Q?N4M0ayMliux2GWIe7PWWqt6x+xb6eR7BxtO1cYKRyd4Szi1jQPMAOXE/3S5o?= =?us-ascii?Q?YjLV54x9JBsifxmjija2tkvHI1m2OeKyNXKqqOUviCILLv21bXKOyRF1HsZg?= =?us-ascii?Q?iBBmdZG0dM0CHh9iBEv/CnIOLrffDQoo6NjR9TBxowfn+9HzhIanHVd/liL8?= =?us-ascii?Q?b+Nn4g/lEnIp9UVgnEV3Qu0jaDy8DAJonG2lOdQQ/o7RYPsOpnmMmcjU00l1?= =?us-ascii?Q?QAkbphilh/LnsMeiuXrg/T9ffVTNmy0r3OH8L/cSSilGQRayjXNTOIgIGiwf?= =?us-ascii?Q?iTQJ7UtYLwE7+T9UQ2dIhtDseiin85caETLqI0ICsU7nsKqpy4skT2mjd/YV?= =?us-ascii?Q?aFcehncOFTaOdVMOgSaDPrg8Hgq53FtT4uksR8DD+Yd4UrjBHQusqTP1hbyy?= =?us-ascii?Q?kDGOLJD3MsxW7q6SJ5LTjv5EOi9SydDP/l3Tn8kwZTY7RSGNNF9xuu/HOCrd?= =?us-ascii?Q?ZzzNP6Ns05ytQsGa6xmFL1KJI87xAljWr9wVHG+kdJQVOuc4xTK13XDx4+el?= =?us-ascii?Q?njAk7oMtZXH+rVmFxQoJ0mQ2kSieRvKpZoXyVN9x6aUIIFAsGtYjO4VpHFdN?= =?us-ascii?Q?RGb5Z8b74938WvgcOanippuvb43LxLJ3z9J0kY+v1PtPfVTmbwUei4NWlBrm?= =?us-ascii?Q?YX0oOhmT16pge9RjoxJ1dbOHhW3+S+2qbuNee0uLUKq+Yvv0lma/9D5rrE4i?= =?us-ascii?Q?+jbHgXxYiAVhA2EZqc6Og5XqgPnhNosdySOxbsrrQ9JFrEQxfQno7BdqfGKd?= =?us-ascii?Q?HVE4wVLKlPbYUYNuicPRa7nmjDj9P6qWCTU1diDwbM8jqL/OJ5wthIlbcUg4?= =?us-ascii?Q?f5wporEYM5kUlHxL1NdjMlidnNJJkVcQojfxhlil5lHOLy07PgzuBTiXRypQ?= =?us-ascii?Q?OP782N5cr+Rn3QS2E3twQhY0GsilMLUpz5wUjdjTHaGxqFBLK2OEsn4/vC/N?= =?us-ascii?Q?xu1vRRmWWF/dlo7rWjKVz9JzcRCe9+1t+ibpguHmhWKipDcdq169B9YycEjU?= =?us-ascii?Q?1JCzKXzMm7Atum4rI8wqu2q3LGfxSkc?= X-Microsoft-Antispam-Message-Info: 6nt7f8eJ4rPfnsZF8ivMCNE+oo886O/cJBT73+j/ad5GcoHva8oAC8b+FO0E43Q53b1NmZtw0ThnqbtcvV1cxgJEZhNIvwMT3nmSskB59UfV6IaeXzTyTneumQ3Yil4AUM6ckheFkTwIYYvPS1ObepoUcuSFcERg2p8Liw3wEYPo2Ut4AXo4Aeg5453aEqUWF2XAKTkd8zamCpl/lYKdLNeZRgIk5mgDpXj9qHV+K9BGURSUwWt7UfkIzRG/3pW2RMrPQS+wl/YVD61gCtoesG8ucrI6HEZz4Op5rjba9/fuPr9Bh1a3r381wAbHV91KUp586syNKQ7P3Wid29XvYhVZK+doCAKMgLtnR3eFrws= X-Microsoft-Exchange-Diagnostics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FpapoA0uBFQKgWR05o/L+ELNnge/arE/QHf X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2018 16:56:38.7910 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 698145d3-22f7-472e-71af-08d5dd181db6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4179 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 When running mirror_gre_bridge_1d_vlan tests on veth, several issues cause spurious failures: - vlan_ethtype should be ip, not ipv6 even in mirror-to-ip6gretap case, because the overlay packet is still IPv4. - Similarly ip_proto matches the innermost IP protocol, so can't be used to filter out GRE packet. Drop the corresponding condition. - Because the above fixes the filters to match in slow path as well, they need to be made skip_hw so as not to double-count packets. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh | 6 ++++-- tools/testing/selftests/net/forwarding/mirror_gre_lib.sh | 2 +- tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh index 3bb4c2ba7b14..197e769c2ed1 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh @@ -74,12 +74,14 @@ test_vlan_match() test_gretap() { - test_vlan_match gt4 'vlan_id 555 vlan_ethtype ip' "mirror to gretap" + test_vlan_match gt4 'skip_hw vlan_id 555 vlan_ethtype ip' \ + "mirror to gretap" } test_ip6gretap() { - test_vlan_match gt6 'vlan_id 555 vlan_ethtype ipv6' "mirror to ip6gretap" + test_vlan_match gt6 'skip_hw vlan_id 555 vlan_ethtype ip' \ + "mirror to ip6gretap" } test_gretap_stp() diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index 619b469365be..1c18e332cd4f 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -62,7 +62,7 @@ full_test_span_gre_dir_vlan_ips() "$backward_type" "$ip1" "$ip2" tc filter add dev $h3 ingress pref 77 prot 802.1q \ - flower $vlan_match ip_proto 0x2f \ + flower $vlan_match \ action pass mirror_test v$h1 $ip1 $ip2 $h3 77 10 tc filter del dev $h3 ingress pref 77 diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh index 1ac5038ae256..d3e75bb6a2d8 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh @@ -88,12 +88,14 @@ test_vlan_match() test_gretap() { - test_vlan_match gt4 'vlan_id 555 vlan_ethtype ip' "mirror to gretap" + test_vlan_match gt4 'skip_hw vlan_id 555 vlan_ethtype ip' \ + "mirror to gretap" } test_ip6gretap() { - test_vlan_match gt6 'vlan_id 555 vlan_ethtype ipv6' "mirror to ip6gretap" + test_vlan_match gt6 'skip_hw vlan_id 555 vlan_ethtype ip' \ + "mirror to ip6gretap" } test_span_gre_forbidden_cpu()