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+pDg7YEAYGRFu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bgU3a36FkEg/mJdYDRP6Kjx43vTaNHXZ0KTvf1Ls5MB4dLtIGA/XDpBFBc1jxcUUR2dcehNVLsQZDWmZ3lStH0Zs10gZQQ0Kc+iGyF4h3CllJbr1ZUNxV1FsARzpfIm1boCYTFduTTqyU6PcQk98fbHP5JT5UbwEzS8RM9u9ZOenfw7rp/RQAw8wt2zBkYuenIrtPfBHdrdIl/AyUJumDb3MnaXNEEJlSjLxtNt0tCLggXpLU+kWydq/KystmeSvVYNH1+Ij57/3iiCJIXDj7UX2tSi41TH0N13x2yjKfAA7XthtiXCVE1uvJvC2eP8P2zhR7irf0H2y9uhGJhWq2JqNQLGvaOiBBM2oyH52xz3LMwFB3NqJPGksuzH/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=""