From patchwork Wed Mar 2 16:14:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12766257 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B99D1C433F5 for ; Wed, 2 Mar 2022 16:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241417AbiCBQQJ (ORCPT ); Wed, 2 Mar 2022 11:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241385AbiCBQQH (ORCPT ); Wed, 2 Mar 2022 11:16:07 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2088.outbound.protection.outlook.com [40.107.93.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C88BBCD316 for ; Wed, 2 Mar 2022 08:15:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PvgFFyKhMl4xv2eRl81WmcTHKtVdfe5YfQ5Uu6qRECRGLJKZxNvxMq4tKEY+9AmbYXGx/+5Z1mf23Ljgfic+rqOs6ak/MACzinrgnvCkKAMU9oAVQmjqAwL+CVf/wBhn4sU0FsT6iNq0bpuFdZZ7Jo9QdcCwtOeuS+cXeEm3THqLjZH0GtRLIWzxPe3c9YvJUGDKok2UupIUi/o2PZZlkdBEM5yNsJFx7kgNl6Y8u6EHYOnBNg8Gdupfu9RpaFrP9fMDBiqR0XT1+rQwI195/iwNWyvEU1DeFVv/LDZyAUlYTGXytHlKJviyNCPriz+OUYj2Le+0umFhp898XbcZqg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nDyx7Y5HtudQMcTTfA6BQvAtYkFx8FdMRmbiXCh9evw=; b=FToITTXg8takupE9Y9ge4ytFtDZ6LICVp8LNTWQfOTfrPCIIIXlIVqfxc+InHu/AFCklHdieGlJTzZva8Okl7EwvesE/HatC5gsUnAHYCU0OgePFXiUeevJpHiEvv+EgoIKvxxDJ+P3FuNn1f+/z8TUzo7nOJeV53hKyX+5STtnzmerqJv3o/KffUpn0ZRLhQ6h12e3hneCLrNQ1xzXnY2Z6DCgGKg3X/oTBCVO5KmRJA0DDiwTglQ0vwZ199qmOL4ijnKyjtkpr19hQOzUJJGHGBUAzikfBpwWQsdSk6JTVXlYw0LlvgOnjFMD2hpZYRkK8P249yw3FT3MQacnS4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nDyx7Y5HtudQMcTTfA6BQvAtYkFx8FdMRmbiXCh9evw=; b=OiIAe9ZWL3/aQjHk25ua0YtxOqarDrsoO+zFPN+3fDTHU1TcAwmNLQjWna1RXPj1eXRuRDcFiXUXzm243BQ9gqzux4DE1n+8z8f+CvsP6fdleQONq7u2PdS+nqY9QBVpq2ptKP6d5msWeGf4vdDefhQoVsLhB7rnIG+Z8p4j9ftvtilELeHQLj8OTcJ9enD2T0e368S7VcoSJGd3vLWes/pKsFLz93bol+7cjLvEDi+t1WEhuaffmLjAX3zQyn+9gcrny4YKYcpiF2sbVzp3tlMsICdn+LLAHgSQ5a1cFVFkzXpQuY2+GxiUnkduY7O38ajdPKBYOnEAwp+CdnF8PQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by DM4PR12MB5136.namprd12.prod.outlook.com (2603:10b6:5:393::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 2 Mar 2022 16:15:23 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%6]) with mapi id 15.20.5038.014; Wed, 2 Mar 2022 16:15:23 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, amcohen@nvidia.com, danieller@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net 1/2] selftests: mlxsw: tc_police_scale: Make test more robust Date: Wed, 2 Mar 2022 18:14:46 +0200 Message-Id: <20220302161447.217447-2-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220302161447.217447-1-idosch@nvidia.com> References: <20220302161447.217447-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR06CA0203.eurprd06.prod.outlook.com (2603:10a6:802:2c::24) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 243b4fb9-38d1-4e1d-7c03-08d9fc67da94 X-MS-TrafficTypeDiagnostic: DM4PR12MB5136:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ai+ajiHlZsXoJ7cEmZ8BuFtTQBuAMRDEWrB7wgVAbgrPvhTsC3eUm6eZJSq3TwG8LsxYJMS7/1tFNr6ehSlBr8cmvTQezcG4wFKrZgYOh0BHEWnVYqaT4GbMjz/M7MyL8ssaXTdk0iBoqFK6gFlJZZEVDET59AMQ7Fa/5gbq6Os/79a/dsuvA7MtzKyb5cE8s+S2KhN7y4ZZ5jBE0dI1h+/iB59Bw6BKrBd5qQ3MwJzCIC+I6/3G61wSM1BorVTFntDvFSeU6wbeTDDJkfwxmhOp05s8BeeSMRPcoNopamY39k93t+7xXqEjSaWSCcbf/fKjILAIHpyt90XvZIVOPyxCat6JKmJKD2osfDwSKc3XApxG9LYse+nF1OU/OGevsUvYpNe5QqdKUgmi7SPipA337X/FyifYea34gvrInSLW91aIeZyopZyt5mtaOGKc31CTY97M7HNGHDzBWm83cJw8qq9Fi+vQVHv/xdV+C/6Hiu8kuUFrJ39c6smOOnNzlVk02xNkS94rRPEp4S9fATZ2olc7fasku5qn1Jw1pxeSn+bM98tsDeOyHla3UCb1nP3JDhzlOJ9K2E4pcnR8d9WqHtUj8b+222OqLIcx7lxNDs8/Np+YA9IDuuaYum5Vak2Id6SnPXdlyAmk42SQUg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(107886003)(6506007)(38100700002)(36756003)(6916009)(186003)(2906002)(6512007)(5660300002)(26005)(6666004)(8936002)(1076003)(2616005)(316002)(508600001)(6486002)(4326008)(86362001)(8676002)(66946007)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZbOdxwwf4wGCvfV72rU6Q8viS14tutyWL5uvopwWmgpv+zl5gX+J/9NeP47oWP8L92i92RZkgPdQ5RomSHhtJHFS5bfUbEzw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B5U1IV+pwCmXCLHrk67p8ywvzGovqq9w+Y/yKnDnR61o8hk49YKbLIWfEUrKWx90QfgxAiFI6XkyqiRJrE/0x+guUJ+iTiuZ7He+aAEm3Cz/jOxqC6qmGi/BwZDekjkS9sHwL57stfADFIHIY9jN88Uw0ACC+glbJZF/58mrnFYG19Pc9vz082SqXkMXm1P2G16IcUnjE5fjZcuuQ4/pb0DeenXC/mnXAvIkDKbJ8vGm30iFTZYwyUxAiXKtFzNHG0xgUwBmkoroYw5s9Le/h13kWAsNCi6vjggQaa0WoUyY0TSKR8xwtxraXx0G/WIDr57W9cFwPzKpvEa0UGFsaH1neKSGN4FnGL49mJ5+YfXwOHwtJ6nQN3v+xEx115wk4HteIQluR/wa4PodWua6UibjoZ88SikIXhki6ugDgne3pGBcbTRt/Rog+mlKoFeh3GMRw+c= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 243b4fb9-38d1-4e1d-7c03-08d9fc67da94 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 16:15:22.9895 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yJeI6BkJIlSEnkHCB3BuIH6mCx/HUsAFV33TenWDkgzTIp4TPYOvb2N5D7AcuKwxRY5QLQcCTxAKoavM6XaN3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5136 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Amit Cohen The test adds tc filters and checks how many of them were offloaded by grepping for 'in_hw'. iproute2 commit f4cd4f127047 ("tc: add skip_hw and skip_sw to control action offload") added offload indication to tc actions, producing the following output: $ tc filter show dev swp2 ingress ... filter protocol ipv6 pref 1000 flower chain 0 handle 0x7c0 eth_type ipv6 dst_ip 2001:db8:1::7bf skip_sw in_hw in_hw_count 1 action order 1: police 0x7c0 rate 10Mbit burst 100Kb mtu 2Kb action drop overhead 0b ref 1 bind 1 not_in_hw used_hw_stats immediate The current grep expression matches on both 'in_hw' and 'not_in_hw', resulting in incorrect results. Fix that by using JSON output instead. Fixes: 5061e773264b ("selftests: mlxsw: Add scale test for tc-police") Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel --- tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh index 3e3e06ea5703..86e787895f78 100644 --- a/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/tc_police_scale.sh @@ -60,7 +60,8 @@ __tc_police_test() tc_police_rules_create $count $should_fail - offload_count=$(tc filter show dev $swp1 ingress | grep in_hw | wc -l) + offload_count=$(tc -j filter show dev $swp1 ingress | + jq "[.[] | select(.options.in_hw == true)] | length") ((offload_count == count)) check_err_fail $should_fail $? "tc police offload count" } From patchwork Wed Mar 2 16:14:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12766258 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1267DC433F5 for ; Wed, 2 Mar 2022 16:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234849AbiCBQQS (ORCPT ); Wed, 2 Mar 2022 11:16:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241428AbiCBQQO (ORCPT ); Wed, 2 Mar 2022 11:16:14 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2056.outbound.protection.outlook.com [40.107.92.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 831B1CD331 for ; Wed, 2 Mar 2022 08:15:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UG7Xq+As3QSNA90SNfiNauK6FQGmoGioK61lrKZ6QhwLLjvlD/SQlp2m0YUY+WFrCSQodcWQ4pT+dexz5OGrTphfp4Nw193whVZ/tNlqyqZELhMkzYaRld0TJyPVfgE+VPlP8p8mn9WqgOteEUP8cota8/n5UpfmFCgjaYbBM5Abe4s46MR4nMTQeARVkiSaf51R2hBkzrO11pnWjOVO1D4CfO74duLS46nC8sYPPpC/H2jsAoYn6ddWFu3DsdZN1mtMAiisSLKsh4RZj50gorv07E7tSW5tXgbK1PNu3TiluFSA0MlaeaHcrOZP+SDhsnpFOBdX6KeWXBfg3JOmHw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fkaQZwCNGlz+FfxSIA7yUgR9WxIHtZDfqPCavE2rNBM=; b=OKO8jGGMKfU7Sdmz+4wmv8Da81BxQ8btGbulLAy1Pwe/tXUw8mtQxiTVPIJbTbNzmV3x4gVAiL6rOje/KooJo8jNeujrcPd56t6S/JCOa/6B587iih8KSV4xSFpK+1m5ERUcAO1rQN/GHeNh0XHEGlkSVyP14BfioPS/MI4+wVptUpRSi3GT2/hGnjURRBmfyiYHUV4resqEcsb8rl6mszeR0VEySA4Dn2UPdfkHXm9fYmL04AxQd+Pgiaeogpjka/zuYen5H7VhtyV2soZQcd6Hm1Frvzt0H7EtisEPwWqFWvRIdPPS8lmX91qNNgx5cl72n2w2ZGJLT9RLcORLQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fkaQZwCNGlz+FfxSIA7yUgR9WxIHtZDfqPCavE2rNBM=; b=HbfcLWGZ+2LklfYYtmsMINQFhy1truUbb/mJ2bZp+bUV9vbhvzXasVfawSGFwpiyz9o2UYLnXBMQNk8x1zY8EBztBN6ZZsOpaIqxjGLMiisbJwrpFpMV/dgvR4F5WRRRWxd9LN+Ztq42f0fRbDyvr6CEa/lBhyttfZNCNIYSqlFDomAteHYCKR3w3D9nvvLhTR0Y5Vz4+jp35SjV/0e5rKLf6hH0T1OECH/ZJqn9BRqu4kXLPOGuyFCAEgzclm1v9sW9kmaUtExoP0rRl/LJPIY6AZUAiT0Jgb8iI2t/CeT69B1QxBKPR+59EMgGZG1z4fneRbORYheoNUUTWEbV2Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by DM4PR12MB5136.namprd12.prod.outlook.com (2603:10b6:5:393::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 2 Mar 2022 16:15:29 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%6]) with mapi id 15.20.5038.014; Wed, 2 Mar 2022 16:15:29 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, amcohen@nvidia.com, danieller@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net 2/2] selftests: mlxsw: resource_scale: Fix return value Date: Wed, 2 Mar 2022 18:14:47 +0200 Message-Id: <20220302161447.217447-3-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220302161447.217447-1-idosch@nvidia.com> References: <20220302161447.217447-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR06CA0137.eurprd06.prod.outlook.com (2603:10a6:803:a0::30) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41d0056c-679e-4a8d-82e3-08d9fc67de6a X-MS-TrafficTypeDiagnostic: DM4PR12MB5136:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qlhTdUwAghYU9e9ay0Xjug/ojTICXbRqIeO+qR6c3lrPbxyPyhHiY8fyS8MTnlKKc3ROmy+jNLE6oi/fnHa+vdg174eD3nRLXV3m3ASlHmBUoeW/OagpkdOudnLzUk9xkyjm4fEWZx1b6w3YDPhIv4DREgJMhTnPNgWhIU3cGux2rS5+QNm7Th1eF5ClUu2pUj5YuIWJWuFXRMwDMD53JgAx2cOLBsCgftbFtMyPUrRuG/Km1mYLBK0dFX+XJmRTjChXtr8lYBxniDhPFE6Lu7/dW+Rd/J1WapL15VIoLseTRoRGCn4fuxex+GSjHlMj/CvL8AnLvHNiqx9RUX/8iHPfUIlb7Ksvpgg57EdjInSKT0e+XSgUvJ0eATib1Vs6gEzaGrg2A0vZjsGsrbDXAa/Mpi4277vVEY1uqWc0BQYmVHFJEO8ryb93O6I+QmC+qVsg2+SB+dpAJT+IIYpE0P1Ir6pnahkGzaePJisii0Bg5xMvft5RNvOmi6FaTn0eOM9SZyo4efRM6Ot20msfzuMUKk+j3JDRtBRh+n8luNar3Q3KXj6OhLY1iLToGedamv/6cOzFDjQ4o9eBpy69pob3bLHeUZRLNDsAcmVFHJSdFLq18c+DuBMzlc38OYypyDDebbcjTLxL2BQ/U8R89A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(107886003)(6506007)(38100700002)(36756003)(6916009)(186003)(2906002)(6512007)(5660300002)(26005)(6666004)(8936002)(1076003)(2616005)(316002)(508600001)(6486002)(4326008)(86362001)(8676002)(66946007)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hi0uD488Wh6ELtbbXCwET84lJUyL4y0YKxIV4DvJm89o6VcmHtInpImbpLFDYMWJooPEGdsyC/yXuanlzDjxPornhYa3bwXnS861Hn+pDg7YEAYGRFu0tz/4U2ZMWdpor86zYku2Ud5UjbCMR0HVIHAYNEkHaopOZ2ZANur48p09r4/ZVF++sSDIgn4pWRt1bOCSFs4K/MPHYq4tbDFeBOEfu/605ZKlo98A2JMy064tJqkW7RpZ91MWQ1C5Db5Vcq/z37xrxHLSJmWtf8QU5PUsZp8pPXlwnXMtGEwCD++60oRvxJSBwUhQHP385YdylEdZDe8Ei0rdFlpdOyO8i9FJkn4+MmstkjhweCLUhy92WfN9JA3LNbRr6o1bOUHQxO5hC6U1pvMtKmc8oe4xazv4xzz2b0DK29vHtdwfbm1v5neLwn7aWRcVlGvPFkqCEpGwlcQCpd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Wq2JqNQLGvaOiBBM2oyH52xz3LMwFB3NqJPGksuzH/dvqQLH0cDii+DKtsnXZIp8A7vqinDJYhXPBQmpIME7VCTXzcdaPk6nHmFMlarF8S6kJlGZ6SqeU= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41d0056c-679e-4a8d-82e3-08d9fc67de6a X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 16:15:29.4238 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aY9Nm2B4fA1+OHTcqHRJ1JsD+FI46kesk88yWHy7teXZVIbPjHAeiT470PilcqLPHGBCLZoRkpCnTLmLlgZVQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5136 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Amit Cohen The test runs several test cases and is supposed to return an error in case at least one of them failed. Currently, the check of the return value of each test case is in the wrong place, which can result in the wrong return value. For example: # TESTS='tc_police' ./resource_scale.sh TEST: 'tc_police' [default] 968 [FAIL] tc police offload count failed Error: mlxsw_spectrum: Failed to allocate policer index. We have an error talking to the kernel Command failed /tmp/tmp.i7Oc5HwmXY:969 TEST: 'tc_police' [default] overflow 969 [ OK ] ... TEST: 'tc_police' [ipv4_max] overflow 969 [ OK ] $ echo $? 0 Fix this by moving the check to be done after each test case. Fixes: 059b18e21c63 ("selftests: mlxsw: Return correct error code in resource scale test") Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel --- .../selftests/drivers/net/mlxsw/spectrum/resource_scale.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh index bcb110e830ce..dea33dc93790 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh @@ -50,8 +50,8 @@ for current_test in ${TESTS:-$ALL_TESTS}; do else log_test "'$current_test' [$profile] overflow $target" fi + RET_FIN=$(( RET_FIN || RET )) done - RET_FIN=$(( RET_FIN || RET )) done done current_test=""