From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 306F443251; Tue, 31 Oct 2023 10:43:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B77E40DDE; Tue, 31 Oct 2023 10:43:29 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2064.outbound.protection.outlook.com [40.107.244.64]) by mails.dpdk.org (Postfix) with ESMTP id 0265C406B6 for ; Tue, 31 Oct 2023 10:43:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nV953c7pAC1gJ4kH04oG8Xx9QcYjg+2FGjNN1MDtSKC6g77ov2QDaxjz1kzXy8wEMfSbqmIkFQ40wD1Ds5qPJH17slYg/OSdpYQHUvJ0HK3/Zrgz1NQffzHhNWk63qKATztlIAj2HiLpJG2Mf/pM/E4zWWGKTrZAlDGTL2p3vSPL2WVcz5wU2wiztaPASmk1YYPN94kO3M13IAd/qYKJo9voUBtmfrdk1m4GF7OD38yeUmesaq1x1PGq/0IAMybFcJcD8mnqojXvg5X+Zwn9ZYK8pzBLN3jZesc4PIbBSt4gVxVIHTXNYBuNGBDkk5LNHr18sa1mApjfbqkup60hlQ== 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=VyHl8+d4ntyKnNDC0ypY02qPLJ1SKkSEi5h3DVzfdps=; b=YIGZ/mxKzkfvOGLGFCybnXDm/wuEEyyQw+/qMz0AJZS2doUlko4zTH9dYZkW4P9xj53iXPEjmXAWXcaY3p0EffQvWYqZfGo4Ijzk5CkhhJwUDb7xTboxDE6DmOnUhauPktMTkn2YF+weDM3rZxRcyVuxQYo96LogDXQTsCrjs8DQ4fp0hoan5zmw0ic9M68YDNgS1Uj9weeCOaGd+mANqlJmMijUUjKPK9hFQCSqrXiWAsbKI0idahAPCRm5Ot9iGRRK7T+KszNm4mSsf1dG32Fii52fnDLxLfg78IE/KLJlWrvX42GNLKc4f1DSZC4Nzw530b1ZwSgypPOHKzhlpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=VyHl8+d4ntyKnNDC0ypY02qPLJ1SKkSEi5h3DVzfdps=; b=G8Y8/E5KJ9js80XxCeJVWh9p4ojB0uCzD6xemhszc3eIDoJx8MGhA7SYWpWLvmNioziEVyTEyCdLyopvSGzCCBfPbdsf9Hbi3l1BYUoJN0q5bP1CcS+JQH/iA+OVcNihjBPbOQ2y3aXmFdGxvfI15Gb2R6b4jwEFQhV0EbN7hpZbgkR21y4HUSRwiEvjrYwyOj6IhUtz93kxcIj2fZxJycDNYsPMhgN4JJ87Ua3B/dURrcPfvIGtDn3UyRrCIyy6nuF4ChwRGHF/zcV9B3hi7umULNuIEYHyvrBq7Uaj77Qt92EHxo5Ex3O7ITk+/5illJU3rsyfpx82Gmte2d3Mlg== Received: from SN7PR04CA0156.namprd04.prod.outlook.com (2603:10b6:806:125::11) by CY8PR12MB7339.namprd12.prod.outlook.com (2603:10b6:930:51::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Tue, 31 Oct 2023 09:43:24 +0000 Received: from SA2PEPF000015C7.namprd03.prod.outlook.com (2603:10b6:806:125:cafe::cf) by SN7PR04CA0156.outlook.office365.com (2603:10b6:806:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29 via Frontend Transport; Tue, 31 Oct 2023 09:43:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SA2PEPF000015C7.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Tue, 31 Oct 2023 09:43:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 31 Oct 2023 02:43:04 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 31 Oct 2023 02:43:01 -0700 From: Rongwei Liu To: , , , , , CC: , Alex Vesker Subject: [PATCH v2 2/6] net/mlx5/hws: fix potential wrong errno value Date: Tue, 31 Oct 2023 11:42:40 +0200 Message-ID: <20231031094244.381557-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231031094244.381557-1-rongweil@nvidia.com> References: <20230417092540.2617450-5-rongweil@nvidia.com> <20231031094244.381557-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015C7:EE_|CY8PR12MB7339:EE_ X-MS-Office365-Filtering-Correlation-Id: f9d49bea-e478-49a6-5977-08dbd9f5d39d X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AqhcBvCtmmJucPbTN4/V9oLF3M0jrLW6t6/JujLJ9WASeS4aBo4XZ7YoyMsQiUit/VQiLWGtd+u/CCO/c0Ac4B4xgc42LggSRUawMbj+rClOEddidCJEmWn3SNmSelRmmNwKKnAA7gzioz5Ji+cgDDPbZX0EbnZ9n3NAuG/KKU/WCCtX7qqJdiko3xN75pnkICVQjQS2Y4yv2nas4bx4ZOwmt1WgSMv4/Q57WXo0+zTxOurJfa5iq/MCdJLdyD7s3nqvjE/Y+D2fRuGq3gzSd5qnsDG3VSxs7FAOrTBeFuOZuhfjXIwm9/3wGj+j5SwX23AY219uhOODOb17uCt3MhABMX6sJstTzlmQbvVPOyHJe0TBtpGIxIgdMdt5f6XDPrikQYcgZWXTKZO3X69uYxBijrZzJcBKL2x1/+LAEXnixsF/wXLVCBaln/6sFz/bEd/32iwIJRVzfRTzntsgemDY/fmSUwkpRuF+NMGpttcQIRqrwSYufFwY81+vEINGHJ+YnDXbaptvU06X0LSxr4K+eCCz3ZLrCewTHXc8usDRbx1I0Oq1QpYa1SsQNvDUQ/CyD6XDbgZAE7BWigrkOWkGCyJVMKZUDqkUruK0RrYpB28PkgIeKCEmBPngBSJFjBxjWdfmypKO9jPhVr80jQbQ1vhtjJQtjicpVs4n+kE9sCSZWq3QstqN//a0ifi5ujn5QUJfAg/91eRM2iSl42ZT/+qo6inSdGhOr041MIWFAuCoLE3JCsSMXakiTEl0 X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(396003)(376002)(39860400002)(346002)(136003)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(82310400011)(40470700004)(36840700001)(46966006)(70206006)(2906002)(54906003)(5660300002)(110136005)(316002)(70586007)(478600001)(41300700001)(4326008)(8676002)(8936002)(6666004)(7696005)(55016003)(16526019)(6286002)(40460700003)(2616005)(107886003)(26005)(1076003)(83380400001)(336012)(36860700001)(426003)(47076005)(40480700001)(36756003)(7636003)(82740400003)(356005)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2023 09:43:24.2170 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9d49bea-e478-49a6-5977-08dbd9f5d39d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015C7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7339 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org A valid rte_errno is desired when DR layer api returns error and it can't over-write the value set by under-layer. Fixes: 890db3e2b90 ("net/mlx5/hws: support insert header action") Cc: hamdani@nvidia.com Signed-off-by: Rongwei Liu Reviewed-by: Alex Vesker Acked-by: Ori Kam --- drivers/net/mlx5/hws/mlx5dr_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 59be8ae2c5..76ca57d302 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -2262,6 +2262,7 @@ mlx5dr_action_create_insert_header(struct mlx5dr_context *ctx, if (!num_of_hdrs) { DR_LOG(ERR, "Reformat num_of_hdrs cannot be zero"); + rte_errno = EINVAL; return NULL; } @@ -2309,7 +2310,6 @@ mlx5dr_action_create_insert_header(struct mlx5dr_context *ctx, reformat_hdrs, log_bulk_size); if (ret) { DR_LOG(ERR, "Failed to create HWS reformat action"); - rte_errno = EINVAL; goto free_reformat_hdrs; } -- 2.27.0