From patchwork Tue Jun 26 00:07:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10487579 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 595FC602D8 for ; Tue, 26 Jun 2018 00:08:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 495CF28619 for ; Tue, 26 Jun 2018 00:08:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D70E2870B; Tue, 26 Jun 2018 00:08:12 +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 C8B4628619 for ; Tue, 26 Jun 2018 00:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935083AbeFZAIF (ORCPT ); Mon, 25 Jun 2018 20:08:05 -0400 Received: from mail-ve1eur01on0076.outbound.protection.outlook.com ([104.47.1.76]:19044 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934290AbeFZAID (ORCPT ); Mon, 25 Jun 2018 20:08:03 -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=C/ndn44thA3z14XzcZ0IVPIJLOfAfVVGvKXISlpZUkk=; b=TxVR0RwpVP7IOeNj+4PUMdJxHQXgcu3r+id5v/NuiwKxfc0YdoFkE1r/zHHTWeEHxTD6p7M3TCZxJ2zKP5HaD5Djmo+su3MZH/FXAi0NBJ+NEkeBdp/6VTHKiKaefrpN0CK9uevqFqx/KYm8XMYPYiedlgowec/fQw+rQWPf6p0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.176.83.59) by AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.23; Tue, 26 Jun 2018 00:07: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 3/6] selftests: forwarding: tc_rule_stats_get: Parameterize direction In-Reply-To: References: Message-Id: <53efc91c8ae4eebef123adc9c597b3cc3ecffb99.1529971148.git.petrm@mellanox.com> Date: Tue, 26 Jun 2018 02:07:45 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [89.176.83.59] X-ClientProxiedBy: CWLP265CA0194.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:4e::14) To AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5cf4e27d-b83d-4ab1-5bfa-08d5daf8e060 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:AM6PR05MB4183; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 3:CqxRK1uIFDMuQ1emgpSwUme6/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SDY5ah36XxIAQX31acmvXwHh0Y3zfJD/EPpktS+eIYByOEab2qDYDGkLvvcDqIiMn4MeYxAYHYraGK69TrzFaObsuvMAnAjQZy9YpDfDjYqtOtpbOa4PkQGC2bP8e5Vfp8Y5H6b99Gh2GZkAGW6MgmJyNbBQPGxTItpYGk9em2MaaL0VACdRRcx1RCU5+PvO7k6Q1e/0bixzkFdVS9qerpVDwTH91t7DKI5K2EjKOwkvKjSD5R4eXBHQonBJk5X+4gGp6Nvrf5dDr5CkI3egwuwkvytcrKfoNqP2MyM3orz1EsVcpzjdOMHZ3ZIZib1Mi204fWg+2ZJ9; 4:wqph0jcyuR8heaffVai96HbuADjHSSULBxAARh50ZAQ/I6bkYAdiBXtBW2RMqZI1PUHFXOqumi4n9prjnSFkjUsgU21zcARMuCOOxxuVKfjYe5pze3VcJY0Gc32XI4xyLXPMafcsxPG2usvlFFfHNkER6fjELclLaZ7G/ID7HnNoxgUPBNjUd1VdpXmedWXHV5mOyTCLu3f1C1MZkVAei0rjDhxCh06ZuZRoMA2xr/yPLluNEOv9WN75s5kjO1zve21NteKQf+eOIasWTB45uA== 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)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:AM6PR05MB4183; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4183; X-Forefront-PRVS: 071518EF63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(39860400002)(376002)(346002)(189003)(199004)(478600001)(118296001)(6486002)(8936002)(50466002)(68736007)(53936002)(2906002)(305945005)(6666003)(7736002)(16586007)(2616005)(316002)(956004)(66066001)(8676002)(476003)(58126008)(81166006)(6496006)(6116002)(52116002)(16526019)(48376002)(3846002)(26005)(86362001)(186003)(81156014)(47776003)(4326008)(25786009)(76176011)(51416003)(105586002)(11346002)(486006)(36756003)(386003)(446003)(106356001)(97736004)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4183; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4183; 23:QA744i2O/ZGJ5TNM6959Htm/VzgiyTJyT+BrCe2j0?= =?us-ascii?Q?adFNAe2t/++yJLfZqCuU4XXFNWOZBkqsTlvHRQpkgRQp25NHDXajN07lADso?= =?us-ascii?Q?FVDekEZDGuioyx4+jrVlYWpDeA07oH0MsphA8C96T9wUlON/zZSD6bj3/zBI?= =?us-ascii?Q?01cqgtMOm7uu4Sur4CXhdFNiyP2UiMpe7EX2kRZSIClcQGQfA++6JTm1Rk2s?= =?us-ascii?Q?YqLgTYs3tqT7Ab1ffvuF4pmgK2Wtt5VZIEB99s7gd+WdLlmDTKiu87ab5rul?= =?us-ascii?Q?P4brn3/m7fkuQQoBKhEd7SOO9OSzXb3ulo5lG3eNZ6EKdz5Pg9ogS+SHs68w?= =?us-ascii?Q?0KhGRAjLIUGI64HrzK0NC+AaL9YCse0akzulJV/oRzt56fliSM34VGvXgWer?= =?us-ascii?Q?OgEm+EI4LaVL6gYE268fnM2+rn97sIoye2zb2od3nfsh4Iz1pFk7ocJv+udi?= =?us-ascii?Q?mUl2qi++HXInII93tLHi0kvN2KJQD/5ADgw5Dol17wly+3h3eVqvxa8uYJED?= =?us-ascii?Q?CLf7CNnLRtjC3egnPtDXW8a8oGr2uyigLQDaSpvLdL0Eb34NRsygC7Cb9OCn?= =?us-ascii?Q?0sczybq8p9UPVMx9MUpIFAHtWks/C9hjoyCR936VLEiAgXMSrbdRyP/YC9d/?= =?us-ascii?Q?Jy0K6/BaBXbCBP1+BpcRXqeGsZef5SR0/RZzes00V+f3WvE++sEOgAAekk5f?= =?us-ascii?Q?E89IBcccBRkrFnzCb7KZstsT27a8pwpjps0wu4M2bkp0xv7YH/Z1SdYcfghC?= =?us-ascii?Q?aepfX8HdP29HqyP4tsnVEAs3brhE492roaDN8/pTHXS/ZZ0iBVVDQ09zk0A0?= =?us-ascii?Q?/2a1fO5nX9ZJuXV4CIv1uHauwYQSZTIdPpOzAXD2jPF/GlOIvXlT/2zd5bLz?= =?us-ascii?Q?UCrizvJvQKwdWQOs4e5wqcgToHRGBKdrmTK+GqLNR3Sh9SdQFT5BWbbtk3cU?= =?us-ascii?Q?FTrSsT9A0SR99mywUwEqllOBMudWqu4axBDiWrogtUN5kP94SlpxCU5YHp1j?= =?us-ascii?Q?EhUAF9tfQz7bYGTy8n2mqbF9Ita1jqfKRvH06bQWsTnO7GUWvNvShx5uBjqI?= =?us-ascii?Q?Zn84ONKWZvTdHBUdpZgZtcDZwE5k7P+65HeucVOvUa4Rg6zn3QEptv9kPvJ4?= =?us-ascii?Q?zc8VORnpcTPPpm0GWSf3DicP1MgC1V2?= X-Microsoft-Antispam-Message-Info: zEyrSH8YFTax/qkTX5a64N80si94pSWfuavxnW68gFyIFV/PQ+vx3ZnCDFYU0zy+lEkzPZxhdRJT8lpv9lBaswvoq0iMUeFfQBMSZkYMkOinsim0opsEsJSS4hmZXCvS1QRlCqhtzzCknFQO+/Nl+nrqrGyhCFqePx3NchEKQhk/xicngLzBUMUPYUUDfO65SfUiKYHxx9AINU70TZ+bIgPA21MVPbuJDDCLvLHzJ2zj7hsoV7awsuHqSI6lPTnch3JUH74AGlcxaAt+2UGvORXBYhj+rrc5IbEEOv64mjh6B+7k5zdi5M8zKlYH8yuoduNogs76czN1lXn2LOM7GEZo0LpbYn43qq90yo+wAE8= X-Microsoft-Exchange-Diagnostics: 1; AM6PR05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ZK1F3L6APjXamfYbpla17aMgBcZch2DZZ X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2018 00:07:59.0824 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5cf4e27d-b83d-4ab1-5bfa-08d5daf8e060 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4183 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 GRE multipath tests need stats on an egress counter. Change tc_rule_stats_get() to take direction as an optional argument, with default of ingress. Take the opportunity to change line continuation character from | to \. Move the | to the next line, which indent. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/lib.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 911d753c4ff0..f94ea4bafa13 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -383,9 +383,10 @@ tc_rule_stats_get() { local dev=$1; shift local pref=$1; shift + local dir=$1; shift - tc -j -s filter show dev $dev ingress pref $pref | - jq '.[1].options.actions[].stats.packets' + tc -j -s filter show dev $dev ${dir:-ingress} pref $pref \ + | jq '.[1].options.actions[].stats.packets' } mac_get()