From patchwork Sun Jul 8 17:58: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: 10513277 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 ABE9660329 for ; Sun, 8 Jul 2018 17:59:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D3CC289BD for ; Sun, 8 Jul 2018 17:59:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90E89289BF; Sun, 8 Jul 2018 17:59:04 +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 15EDB289BD for ; Sun, 8 Jul 2018 17:59:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932692AbeGHR7D (ORCPT ); Sun, 8 Jul 2018 13:59:03 -0400 Received: from mail-eopbgr30079.outbound.protection.outlook.com ([40.107.3.79]:2688 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932688AbeGHR7C (ORCPT ); Sun, 8 Jul 2018 13:59:02 -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=gZyvlM4gYXk2j/2bm/FvF3mI3ZbFFhpk63/2P0fGKrk=; b=AD9E5rrQtozq60manCpf4on2j1RI6B/OdwZXLuxEtFquqe6RI86KCbjvehCgVKBcHUA8/3hA5D+U0bdELVRNaN0p22pk/WoqQ2ycvd3H19QEuybS8FZ6THM8Lft97OilNlxgxFeOyR9nKlTuF5JhegsQFPImuu/tzao64G7rOLU= 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.930.21; Sun, 8 Jul 2018 17:58:59 +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] selftests: forwarding: mirror_lib: Tighten up VLAN capture Message-Id: <0fecbe018ff9a06a5f3686e3c4801b5005925019.1531072211.git.petrm@mellanox.com> Date: Sun, 08 Jul 2018 19:58:55 +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: AM0PR01CA0036.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::49) To DB7PR05MB4186.eurprd05.prod.outlook.com (2603:10a6:5:18::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e15246f1-cb2d-46b3-35d3-08d5e4fc7b95 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600053)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4186; X-Microsoft-Exchange-Diagnostics: 1; DB7PR05MB4186; 3:hvnnjK0rZAqwauUSnvbRLAj4W+CDXqQzjaUPz8zm2U0ldQjfEuUZLD0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HJo4a9jnRvnDKm2PErizCphx8HlXDtnM8Lp4tk8dNAAQFkfn3wUeC6/EgthB8GHRqki/8yqdWBNhso+7jC5U3tlHkI9KGOgeUYPwTVF8G3jAGD5lN9w92oyiJGEeUGI+5y2RPiJslESY99+OPTEv1ff952ovNM+wR9b2wag2VFvBAQF3oU0NaKpnXN7R4TE3mpE83dCth6BOl6j30g1x1hqcnPMl2MEByiOKm1jpzaXeBRDk/U1ksIcLrjYhMGnWAdsETB5moNOtZN4VkzPEelP; 4:t9ONxcjYRj0PYFWJyqAm7AKc2bhjF3YQaKsWg2e3uEmsa4mrf1r5q2MI6UurByJMW0nRsEVijRywurBLxiDFCm2FS9yAooVixP5g3mypxj5+nyyy7rBiZP85v67rmt1rdrKyWDYHpZZMJ6RpFRFARdgim5hWdEmDGhhld/WxAY88ey4hkMulFYnGaZMsQHdEAkR/wFn6UVtgBqySmw5ccccMI1WVETqpvcsBl6kxyHEy9UKoUXm9t2Rl9YM09Nfxz4KgsdxfOOlqPR4Ej9gdCA== 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)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4186; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4186; X-Forefront-PRVS: 0727122FC6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(396003)(366004)(376002)(136003)(199004)(189003)(52314003)(2906002)(86362001)(16586007)(106356001)(105586002)(68736007)(6666003)(6486002)(316002)(58126008)(486006)(118296001)(97736004)(48376002)(186003)(53936002)(8676002)(478600001)(81156014)(956004)(81166006)(476003)(3846002)(8936002)(2616005)(6116002)(305945005)(7736002)(25786009)(47776003)(66066001)(4326008)(16526019)(26005)(386003)(14444005)(50466002)(5660300001)(6496006)(36756003)(52116002)(51416003); 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: =?us-ascii?Q?1; DB7PR05MB4186; 23:U5PCaeaNKkoKJGu5Cxka/pgSpKBN0BzIO29ceGMGB?= =?us-ascii?Q?AXhDfQgeH85GJExBTTFIDKy19ksVHbJ04dRSL/Mobl9GIo8SMGzaqJj5LbKa?= =?us-ascii?Q?l8wQav/FvLtCSVKxJQaPVPwmByn0AyC1h3UP1P9ZwZcqEKWMNuEUw6stFc4C?= =?us-ascii?Q?w9TPpL5q9cxZk5DxhBVG5m5J3B6CiPtujQ3bQM+ls2yPVPmd7ylqHjW0z2Rw?= =?us-ascii?Q?Lzgt9MZLH+tT8KyXQ+IRSKke85nRIVqXKT0/9MHSbQXcdhb/brtasVf6AuNG?= =?us-ascii?Q?299/oGN7lVJOKkMeJElOkzuwjS1cSK/wPRaQ2yKkFZjCbdU6QGcXz7XvBYOC?= =?us-ascii?Q?y5RLOtoTvHyGLUNPa77X3+AoW9jYfPDwZPwT5APpjleKDoAYreleQgBxsu70?= =?us-ascii?Q?nBlVeO54ryXRcRqAFKkjBiPNXNR0iq5T6bvMEHp1L34/9UZJT/tWksHlIfD1?= =?us-ascii?Q?Ikwat63o8ruHpGSLa5HXQ54zG1Mc7FpJLn5PrKzjVKsJ9eBVxsntyycRkjpo?= =?us-ascii?Q?A1s9TPhH8BVEygsTrxY46je7hefK6E8nI7XwNtBz7FiWihnBIwmwCOy379xJ?= =?us-ascii?Q?5wl7N48i0tWRxYs0RRZ2Cf1ZDyTbupp7dnBA59tTsmDu+luT+AYedOeai1yA?= =?us-ascii?Q?5xtkq4HhPbk5uq8KQHCOcOHrMycys+DCvSRAFenQVzYogR9WWox6B6HO3aN+?= =?us-ascii?Q?anOEHw0O/l9yUpx8lH9q8MLIoT8RaM7ru5ZvbZBcDtujJqYRjA49PUMu4izL?= =?us-ascii?Q?EhMWvT1xF9lI61PLfEzGvz4UhdSYXsfSIjplkslmo7MzhKncgarabUakKmlD?= =?us-ascii?Q?HFVMk49MFZ4VconL2Toj8ZKocXELjJJ7Ekro183kmzmsrApMjDFA8Tcsuioc?= =?us-ascii?Q?OD4O+/fBdYUXJ9NaHrUtzM0SN1IOHzZSgc4dbRUj628wy1CJgO4TzIiacU2M?= =?us-ascii?Q?6FbxzczFmlIMrrhYmrALi61DcCr9SrFKJTGt8FpUXjzQLX+vROWSGTGmc+0Q?= =?us-ascii?Q?knDT0rTrj7zSR4hwWnDmX6MTOpMl1Spv9d1PoNIg3Xbqrm6xo1CL7PfpLbvt?= =?us-ascii?Q?qk9c3YvXqr0OMxgPCqpNmk53q0jAfZzlJmeGIXZI5PJrHin7uW7n7MsX5WxI?= =?us-ascii?Q?u4OmHDsvwx3Cg2BufnN7vAnVKlfgIbi?= X-Microsoft-Antispam-Message-Info: +w7YVxZ/7kf9yzZfW7CVDIkIIiSoa59l1yQB8Bi/RR7kZEz6ZHAwir13jfXCOvz3c2jLTf8vavPXuvWEbVL2QguDX2Vrwn+y3MogdfP5uUROS60OXS/V75SjrvBlgr1kVJmqgP78ql1jgTNXlN4YfivwDkaBWqxo8m+BJEPWOeNFrrMQe3cnVr68wVhXBujByg49LrvlbzbbHbbRERjLHieyrKqIxL8HzJUzeRxvOhUWsHCyEunywbVwssjFfypITan9AR0izg0EpLfaDLyY9ScNlMCUrFceDUP7a8WwjB8U7OHkvOUki7sqvjufb5v1bmt2mmEjhrCd2KFGPCJVWxJgNoUXirlFU39cNXE7zxM= X-Microsoft-Exchange-Diagnostics: 1; DB7PR05MB4186; 6:CzS/YZBmpDHf1c2wbDA4VnActK4ViJ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OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2018 17:58:59.5498 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e15246f1-cb2d-46b3-35d3-08d5e4fc7b95 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 The function do_test_span_vlan_dir_ips() is used for testing whether mirrored packets are VLAN-encapsulated. But since it only considers VLAN encapsulation, it may end up matching unmirrored ARP traffic as well. One consequence is a rare failure of mirror_gre_vlan_bridge_1q's test_gretap_untagged_egress. Decreasing ping cadence in mirror_test() makes the problem easily reproducible. Therefore tighten up the match criterion to only count those 802.1q packets where the next header is IP. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/mirror_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index d36dc26c6c51..07991e1025c7 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -105,7 +105,7 @@ do_test_span_vlan_dir_ips() # Install the capture as skip_hw to avoid double-counting of packets. # The traffic is meant for local box anyway, so will be trapped to # kernel. - vlan_capture_install $dev "skip_hw vlan_id $vid" + vlan_capture_install $dev "skip_hw vlan_id $vid vlan_ethtype ip" mirror_test v$h1 $ip1 $ip2 $dev 100 $expect mirror_test v$h2 $ip2 $ip1 $dev 100 $expect vlan_capture_uninstall $dev