From patchwork Wed Jun 9 15:15:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Mazur X-Patchwork-Id: 12310435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86BBDC48BCD for ; Wed, 9 Jun 2021 15:16:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72834611CC for ; Wed, 9 Jun 2021 15:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238460AbhFIPSa (ORCPT ); Wed, 9 Jun 2021 11:18:30 -0400 Received: from mail-am6eur05on2097.outbound.protection.outlook.com ([40.107.22.97]:56865 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233624AbhFIPS3 (ORCPT ); Wed, 9 Jun 2021 11:18:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OqIUcTgc3mcQjB/QfsGt9BsZHA3cJbYkrx4kSamtycD+bHlHdSf2m1PMDlGfc+hQlLM/Gy6UHMYu1U7S08dgn+6kDHnacvvagUDt8Gsrerq3/ZFZ6jLv0JDTNFYbe3Slu4Lie2NAi0x14KthV9z/m0MLaLPa+g5DKdi/2RUS/e1e/5vrSF2MSSTfXW1idTgjsjQKZhwK1qpsowKgzb3FY5EHe0dbPUIO6fwnPQE93lzkxFvCrAUNMKPLtE6OxPPrudpt/DeTg/XM4zpP8OHt39mwrAdk2hAEj2uEwCMoaxnbz5y4sOAbfurgHj7dZEXa8SPvWRSkoynFPlpGUNNVUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VmbGEzBxatlasqDW5owM4tDfPSTDw4I7Yow5rSO0m1s=; b=WtEE16JRWG94+XMvaqIqUsrkP12BQwywKtQFG05MhDocVuUUtG4nDLXpbU8GRRWgSlREC4VITGueeTEX6i1Ipbq9y/nz3SZVC1pmhGl4IdmCQcO+n2jPW5SLe520Bz7Pz5eFhjPvkBj2owsFolhxsFSbR7y3dvIWrxuwHAcKT4t4J3y76jatEKK3/JiomLJX++AUTBgO3mpypg6dJJWYIm9JV8pZq5E4ov9r7CxzaDUuli0PET14HFkaY0DGV2QxrbCLUhIhr/UchAxXD2/xRQeV18y7bq0aH0a7WQAAUXywzPvGov5S0rzFxtdqkinHC0m4DKvZdlBUOySN+m11cQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VmbGEzBxatlasqDW5owM4tDfPSTDw4I7Yow5rSO0m1s=; b=oUnzZTi42qL+XPg/3N7gtlmAxcgKf3Us7XGvqTVlNQCRC6lFPks6sF/t+/4T5wq3LLj3YVG1bPUoghYsxqjeM4dS5v7DEVffvkSTipabHZGreAFLYL5dkTeYAYwE7v09+GSBB5jAPbCA9brGnxeZYbtjfJqgB1HFB/GY9UJSv+Y= Authentication-Results: plvision.eu; dkim=none (message not signed) header.d=none;plvision.eu; dmarc=none action=none header.from=plvision.eu; Received: from AM0P190MB0738.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:19b::9) by AM9P190MB1427.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:3ea::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Wed, 9 Jun 2021 15:16:29 +0000 Received: from AM0P190MB0738.EURP190.PROD.OUTLOOK.COM ([fe80::d018:6384:155:a2fe]) by AM0P190MB0738.EURP190.PROD.OUTLOOK.COM ([fe80::d018:6384:155:a2fe%9]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 15:16:29 +0000 From: Oleksandr Mazur To: oleksandr.mazur@plvision.eu, jiri@nvidia.com, davem@davemloft.net, kuba@kernel.org, Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH net-next 04/11] testing: selftests: net: forwarding: add devlink-required functionality to test (hard) dropped stats field Date: Wed, 9 Jun 2021 18:15:54 +0300 Message-Id: <20210609151602.29004-5-oleksandr.mazur@plvision.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210609151602.29004-1-oleksandr.mazur@plvision.eu> References: <20210609151602.29004-1-oleksandr.mazur@plvision.eu> X-Originating-IP: [217.20.186.93] X-ClientProxiedBy: AM0PR06CA0092.eurprd06.prod.outlook.com (2603:10a6:208:fa::33) To AM0P190MB0738.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:19b::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from omazur.x.ow.s (217.20.186.93) by AM0PR06CA0092.eurprd06.prod.outlook.com (2603:10a6:208:fa::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 15:16:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92106e35-3649-4ddb-3dbe-08d92b598e59 X-MS-TrafficTypeDiagnostic: AM9P190MB1427: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vxX9xZGtS0xCafhFp7n0ECOJdYMsqphsJLUrpUgkAAsW6O/Xf585FWi0MKLuLi1K9x/73chQC+5dtF/JL3K/dHJxIbUl+H0y5UB/deogWOQmCVMk+riOtNyqt4cm3d9ZQFKDRsIFLhSz5jjjJnJI7LeEFjVxCfn+f4qIAILZ16CHsIF185+nrf8uWACjotM51Qnavb+Jr2l0h66VD2xneItgBAkYC1f6k6b1wNEmn9sE8r2avgmcsPyz93BwnRPohxnMISASoQZhpscmNlYosnFvUtJMm9Q9pNf1d9T5jSlggFPpLjl37Za0I2Y4TM17lPj8CXyQwQlBZadC2z9IFZfSWugHVyYnOB/ZQ7pGZzCglVJt6fDszjeFWy96CuXEnQjE3JR4vJxGDtAkoroarUv1yScF2KLh6xKtSvGmiNefiBQkY7fdd0Wzb1KKNaBAfrUmlhvZWQxkMjBU/zCMmoniUy2djunkzsnrylpBBHQn50JxA0b0OmTOs8dbEBR6WwK8pS/pP7tX+vBYx/B33Skp2yBjJhCsqyY2GQj1ACxRzDXbvsppHbnbnnH5DCCA+5a9uKwwkUn/YG4Q8HG8chiLwsIdq9U2+JittwUyaK0iocpvK0JhKVWfLSEZ2zLhovdK9DOdAW7OAkX3RoDEFRdsqidTRbzPV5RVN8CK2yo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0P190MB0738.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(346002)(376002)(396003)(136003)(39830400003)(366004)(83380400001)(956004)(52116002)(2906002)(1076003)(186003)(66556008)(66946007)(16526019)(6506007)(2616005)(6486002)(6666004)(26005)(66476007)(38350700002)(8676002)(36756003)(86362001)(4326008)(6916009)(5660300002)(478600001)(44832011)(6512007)(38100700002)(316002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: zHpvveKkWxNzgz/zD1pXMKFumLdWRilktgdnqTFCiXZeFT8LCl/yjWXjTWGXEimhiL7w0BSCS7GX/3wuF/7vCJGqbkwNbSCkID5NngveTvwpJnNli3gWt+P1kSGVpxoRC1taL8Dbh9upwczlbJqhOzr55oMTtBOnUHTwQIPbyxeJD5UpeKWoBjB3wkOvlKuLsLvU12jcX6PszswW/QxfFCg2r6IbJvLW6oleg5cVjTZ8+pI//Q/R7Y/upbTFlrq9ZgfxIbr2Gzp43YrJOZ9MP3X1GsatFbzEA5T/d+Sc4yCUs8ExZt5UBCe5uwB+rU6snk7VXebgX6mC8w56EZI1SBnqbgmX5bvRgMAfoCX0y9RPdKIthypKX7bQP5b2CE2UGvjzOE6oDzdBGwxUlB4+ruqeGMU1kqvds1uQDUL3aBl1V09LsujJWP09SM6Pwrus9OejWo8158nKCowTqtjt61E0TeulCfw7+nishcyGZsh9Qre9GQh0NGGPUqH5ls+pjVjWuoouGYcwUsMnRBH1sktmDNT7BU/tY2qqsinaDSh06UDU9+Z0YVj10pXLut04nYGx8EC/QZk4/VJ0OMcHsLyeG39jWyM/RhRJrmM8d5vrUSPlCfcO7PCbQK0VeFDM/UMW8s2j2mQiMlsBdWLMPyX1VwCKGiCLQ57XYRYtW0TAQsB9sdGQT3u+zB8wBvzzg2PA5/bB2WaRy8lt1eFCEqi2YNuXwRhCk+kCNQbnEmxlRp2+zlXRKtoW8f+y6gGm0XsSAA3fnIDhY4FbqcojEhtMRD7nL5Up5HPJC6P2rqAEfKdCfiP/CkpqRAt/QwQAnOE/eBx5o7RnixSfbqG2QQu8XWfyt9IHuLm95lHvY8pwODv0Yb3keS6p9Oqtq810MUMwnb6Ckh5Ozm/2+DmMCvLeAuzVb75QU2SYKQXai7+luSqfvC/aRQ3jRJA34KxSsjNwgFybUKw6TbxjvLfF8N8REOHW0Z5URjgpYi33/FMkCocMBg4jWBjYGj/+nq1Tvq043jQV0A5p/Rz36kVay3g0G8QAHpLwxg/cyd2fBseGJmC9VO5LCqGUcut/DF69WZoFw6omxErLHEfsdxkKMFb3uhYfCdZSfMyJ60yAqNqizlEV3BPGQFDuVhSewuxHi27elVhKvS0eyZQR41kJcYPRDRoNpGxnMDgR7EyF2tYBXjChDvo0e7eLZSI2nWBJkO3/3pWnn/lFpdWgjrJ0ezR3INwWPG2gdG7hznZ+QVk3Y6ySHxsIQu5oYpnhLHdjiEQ1uBN8iIou6UiyNuJVMR6Rn0z2hKWiWVg9g9NAwvyry/1pAO16WYI0bISD85X8 X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: 92106e35-3649-4ddb-3dbe-08d92b598e59 X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0738.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 15:16:29.1008 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nUdJi1c1iIkuHyxzBzSGCW+Z/MBKYo4iMxHB0i7dJv2OXtyrimN/lpbDFK4kS2x8WuiILnfkaLPDPkkSo5uPrBcQMrrQO/nDm9eKfaA4rR4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1427 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add devlink_trap_drop_packets_get function, as well as test that are used to verify devlink (hard) dropped stats functionality works. Signed-off-by: Oleksandr Mazur --- .../selftests/net/forwarding/devlink_lib.sh | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/devlink_lib.sh b/tools/testing/selftests/net/forwarding/devlink_lib.sh index c19e001f138b..22931dcfa182 100644 --- a/tools/testing/selftests/net/forwarding/devlink_lib.sh +++ b/tools/testing/selftests/net/forwarding/devlink_lib.sh @@ -324,6 +324,14 @@ devlink_trap_rx_bytes_get() | jq '.[][][]["stats"]["rx"]["bytes"]' } +devlink_trap_drop_packets_get() +{ + local trap_name=$1; shift + + devlink -js trap show $DEVLINK_DEV trap $trap_name \ + | jq '.[][][]["stats"]["rx"]["dropped"]' +} + devlink_trap_stats_idle_test() { local trap_name=$1; shift @@ -345,6 +353,24 @@ devlink_trap_stats_idle_test() fi } +devlink_trap_drop_stats_idle_test() +{ + local trap_name=$1; shift + local t0_packets t0_bytes + + t0_packets=$(devlink_trap_drop_packets_get $trap_name) + + sleep 1 + + t1_packets=$(devlink_trap_drop_packets_get $trap_name) + + if [[ $t0_packets -eq $t1_packets ]]; then + return 0 + else + return 1 + fi +} + devlink_traps_enable_all() { local trap_name From patchwork Wed Jun 9 15:15:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Mazur X-Patchwork-Id: 12310437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 753E9C48BCF for ; Wed, 9 Jun 2021 15:16:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6145C61246 for ; Wed, 9 Jun 2021 15:16:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239066AbhFIPSk (ORCPT ); Wed, 9 Jun 2021 11:18:40 -0400 Received: from mail-am6eur05on2097.outbound.protection.outlook.com ([40.107.22.97]:56865 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238718AbhFIPSf (ORCPT ); Wed, 9 Jun 2021 11:18:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cSaCK9iEsNiorNa1OeOI0rW4bwooLnBa3wAObN5OKe6uDAYGecwp/mLlGNnQz1S7Rl2nXa9BjzX71TABOtwsyaJxSSXda0oar1nNmNAa7zm2pKrSdk8y9G7dU86hhZqamKAKm0AQh65rdGHL1Jmnz9nZml6xd0Ey8seO2wbOFl7vKFT/vh0rg/6G+NmKUvfkenryLZBBoQiBZkaDeB6R/vhsjtPJLX0YixZeQlPf8cfVXuOgBWmwDhNK5Q3maKKxw1xjA6vFaHdA37C08Ko3b580+YL7/WjIrCYP7MuWY+YYI4AWOp+ZX/ASNLOhu4B7gSwL8ckE89mPEwsJpv4nWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/NL5xHPP8oUVtKKhuyfJpdfKBegW/I2DabixcS4QNAI=; b=nhI75kgStRMAUJf5EAk6t+9n5ddq6J7Pkd4EXm+cq+kXDXMNuIenCTJLzpp8I9wd6bMWvHV9bhcVPqdFKeyMNPtrKmq1Wu32fZG29Lpm3okTLwODIB0uSABQkV5ftXoYnM5tm821G+Fxe1cjEqqQsgTb6ljdR+xanJSdPBvatYhe9G+VZWLAIm3b+MZ3a02FGud+KxWzHOfjmkOuc6tb0jzfYRZtZAQ/3ctOl8ZPo2284n9n4by3dyjZwSxiZau62N3H+uJvpsr/n7GCZss/zAMwebGJGjv6eL0F3V2DRxiBn1suhMD0P6wzplhuYuoqm0iIUsNbSSfSF8ZKQpEKqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/NL5xHPP8oUVtKKhuyfJpdfKBegW/I2DabixcS4QNAI=; b=eM/05q11b8dbSqT7jPwNAsguXaHWCg/HNBoTWbWuu5/ateUDLoAo3HI7xh6UJZ+tjz7GcxqEi5bHViX9L2F2VB3LGwbvYLbCf4elvf/MTJaLIp/CFMXgBb+BdQsV9vyj+ps2isOe3uVwHrQPuQfC4yYtrVxnWiss8jmPcPZaJ5U= Authentication-Results: plvision.eu; dkim=none (message not signed) header.d=none;plvision.eu; dmarc=none action=none header.from=plvision.eu; Received: from AM0P190MB0738.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:19b::9) by AM9P190MB1427.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:3ea::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Wed, 9 Jun 2021 15:16:36 +0000 Received: from AM0P190MB0738.EURP190.PROD.OUTLOOK.COM ([fe80::d018:6384:155:a2fe]) by AM0P190MB0738.EURP190.PROD.OUTLOOK.COM ([fe80::d018:6384:155:a2fe%9]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 15:16:36 +0000 From: Oleksandr Mazur To: oleksandr.mazur@plvision.eu, jiri@nvidia.com, davem@davemloft.net, kuba@kernel.org, Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH net-next 06/11] testing: selftests: drivers: net: netdevsim: devlink: add test case for hard drop statistics Date: Wed, 9 Jun 2021 18:15:56 +0300 Message-Id: <20210609151602.29004-7-oleksandr.mazur@plvision.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210609151602.29004-1-oleksandr.mazur@plvision.eu> References: <20210609151602.29004-1-oleksandr.mazur@plvision.eu> X-Originating-IP: [217.20.186.93] X-ClientProxiedBy: AM0PR06CA0092.eurprd06.prod.outlook.com (2603:10a6:208:fa::33) To AM0P190MB0738.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:19b::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from omazur.x.ow.s (217.20.186.93) by AM0PR06CA0092.eurprd06.prod.outlook.com (2603:10a6:208:fa::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 15:16:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd1a5531-f9ce-4ff9-ea70-08d92b5992c9 X-MS-TrafficTypeDiagnostic: AM9P190MB1427: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:179; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tBqiF1B0M0meJ8XNz4EfhyDkjsQK2yMfiVpzljGQvjKavw5dtV8gE1C5Q4KaAf/9HJ4JpGExwEp2N3Cg4+3gfu3O3ADZ1P9+49Bc1NcYTFnAtg+JNHkTBlEvx9epILuhnqOFJE5tZ07i6L34CUQvuAPYB/RSk9ehBAAMFGbGG3O0uw4gL/hdtQqnW78GCX89x8p3EAlnKtcSQwWzInP4EudhGrUZh/nZ+i+ewNCwvzgS9HLkiDq6ml8f4TgxBo8QgNjb6GwbrMUjcoez0uE/x9JkSyR3ndxUBQbvcfG5eq4rTaWmbC5krEqzK0ot+TwDrO4OzU4mRinU80qjwse9J3YMJm+URpspREbtDuIDnGwKgcD0d8Dvm46Qvbj2qAgB3b+1nw+VEeEKf+GthLDw9FSaEe10BX49VB1pz4a/audYDIvOg9YnNtNtIM78R1ft0Gzpy0bFSuVUvtHSe5g+070M9k+zyTHfTjYv1DDPgUGL8vbpkXdI+rgUHjEvW2UKmdoC0klA3QLZUjnGUi0ZNDS6J6MBhO70ngxP5qe0dYRskz1Sri3QeurIh+VUtdoCNFbs2GzEtgasiWmx7o9KexeIJl4Hv+DcavWGd5rzUaAet+5e64vZZ1MEfL13q/9Z1sUABnoyOEHQl19g08gnA1LeNrxHZQUaR35oqNhWdis= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0P190MB0738.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(346002)(376002)(396003)(136003)(39830400003)(366004)(956004)(52116002)(2906002)(1076003)(186003)(66556008)(66946007)(16526019)(6506007)(2616005)(6486002)(6666004)(26005)(66476007)(38350700002)(8676002)(36756003)(86362001)(4326008)(6916009)(5660300002)(478600001)(44832011)(6512007)(38100700002)(316002)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: OS+V0PbbXliviTonxVWkXn2NYEQVMf3QRklJZa8Fz76mLzbbixtPz+7KWo1u13qhcC9WTkmUV+HXqKo+dYTySnUigdAPL4OC8EBWT2DhhzO3pqt2ESAAFunAZs8d5N+lOgavw6/oQD0wFl97ip2LpMBUwz94qN4htPIKwvsJLAb/W8yblzgdb2wPU8C8bZ8aBZhzShib+Uz/N2B0qG0HM8hziKOp+FRp/Ae9Jy/I7wDyHpQ21uXMYJVjDaxQ84ZnwvSeNnpafOPBC0hLPYSfxfkiEyLmw/HFRy54U+eITxbGl2X5AqbrstX7j8uKtRR5toyhN9iiEnktO0ZFsfAJOD/3OLU6CJtt1eTHbwNVkSI2uvdT9MFZDDz0rzM9Bzse8yhAeXkI2dR+OwCpSwMRO4Sr2abCZIgDw1fjVX6jUEhG0fIfDo5QJ1IsMypZpGsAnU5rggPiHpaiBaSEhfdpLy3YiBBKwb1OkdcQVcT0bOWuEzcqUI6Wl5NiURhmPb9anQZ60Psvw5xEv+5zNqjv9t1wnmY63HMVCMYl8FY1T0rmiWl4jFnG731cOqtpyOOhvmQihf8ojz8cAZQTZQXslpYkSwk/QdsXAoIT90bLsSErh9ET5HeuU0wu+2JhOZ8Upic8InFYr72FlymhbtZhWP2f37wnqVr6EUPCvjtw2JpWO6Lkdmp6oD8cLAOh8zTdw3iE6cbIZTvuHMygtenZCYBBylECAHqvXYWnFtl1V2F4nGPUX9CP1hqu61/sV0/R++lQHU9kEg+VGM5h1u7NfYS0j7CT/S6g4uT/B5+5k74trDLnilIIMkGNGb1AnkxgeXgH2lKde6N/k0LB30KL6L6s51rmNhqppYv0Rvqis8nmtizgYGF1mBkzWWGfYvrgUm3pIIR/tNTWMepdDwecABeKBg86ce8CgrZ4Q9h7YLTDgGdDpBuKqUbRIUlPKmS1f0Tj+GXAE+ZxLNf2FIcH8yuY4XbmK/0UOLFk8Y9pq7DmhhIXni0cXo251kcKJncQG6Ngd9YKtruwUUBAz65WwmT3H8HMztoemUZntgZdMpWRFOs2HEW1gKirECVSCdG2AjK+Ob2oqK+TIhYrXWuBbwqgfE7v713XS/zpYX70B2xbxflefhhnPvF3MJ0H+lM1BW3lLjBG4d0ySr9JIb1rFRSY+uwJPZsRTV64OrVT8tGCmFgiFu8dMoBATWukAgZfz4hkGbMrEoxkKbruJyRGTHhRyTDdXkcGqmiIZynzQBclKE98G4aWvalx8TuN9PqsQDJomQQ/LKKsee56Wnd/DMokpKWV4XF6PURE/pWUSq/3+sjVBN5g3kYG9h8nXmXZ X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-Network-Message-Id: cd1a5531-f9ce-4ff9-ea70-08d92b5992c9 X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0738.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 15:16:36.5421 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SUbu1SQ3rgfOAyClVksaP0r1U985Ldk32Q2OnE9rKjNKq2AUrQcdKaPgas8cW96A0FB8fISAmg+RkR9mfvcwJohBBi5VwooGxjboilvTbJE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1427 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add hard drop counter check testcase, to make sure netdevsim driver properly handles the devlink hard drop counters get/set callbacks. Signed-off-by: Oleksandr Mazur --- .../selftests/drivers/net/netdevsim/devlink_trap.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh b/tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh index da49ad2761b5..ff4f3617e0c5 100755 --- a/tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh +++ b/tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh @@ -163,6 +163,16 @@ trap_stats_test() devlink_trap_action_set $trap_name "drop" devlink_trap_stats_idle_test $trap_name check_err $? "Stats of trap $trap_name not idle when action is drop" + + echo "y"> $DEBUGFS_DIR/fail_trap_drop_counter_get + devlink -s trap show $DEVLINK_DEV trap $trap_name &> /dev/null + check_fail $? "Managed to read trap (hard dropped) statistics when should not" + echo "n"> $DEBUGFS_DIR/fail_trap_drop_counter_get + devlink -s trap show $DEVLINK_DEV trap $trap_name &> /dev/null + check_err $? "Did not manage to read trap (hard dropped) statistics when should" + + devlink_trap_drop_stats_idle_test $trap_name + check_fail $? "Drop stats of trap $trap_name idle when should not" else devlink_trap_stats_idle_test $trap_name check_fail $? "Stats of non-drop trap $trap_name idle when should not"