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 92710440D6 for ; Sun, 26 May 2024 15:23:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62216402B2; Sun, 26 May 2024 15:23:38 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2041.outbound.protection.outlook.com [40.107.102.41]) by mails.dpdk.org (Postfix) with ESMTP id 130BC40279; Sun, 26 May 2024 15:23:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUJOYAsqo6i/GO8O/cP9BYLfh+OE1stOoEviYgyg5lFOJHflVSpSW7ArL2/sfruj951af4lC/7+IxNmo6QpBWspMPVLox7M9UCNyWuvUAeRlEcisnCWtZH5OMJaEImudQiVYINJS7Expq6xk/OCwOnwWBJ3tIaQvZhuP0V0FyYraxZJeFfSH3snEaH0GG6XcPGMdoeuxxDoNoHx94ogqD9FCAHAr/MS2Om5gJyZRhtWGyuCmgJbjGW09BlTolIea8ZIfljvgClIGeDWX4Q0Uq1FPdg+LvcTmbW13h1VpgqB1hcJkQ8AujdoYvvjW0JIok4xdHAvQcPEp7KvHp5pmfg== 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=xFb7gmQbc7gjNTlGQGsL4X914eKIA0V33t01C0JVHHk=; b=QucRJ81M9U07BTxpNVtZQDJKxvu+8f7FgCk9F43aGXg2uRnJfTNCXdanihpPfABUAOHM6UnkREps7K8+obdQSERaYXQASgA5+tzmahNxqjZnh0sa2mgYmNaSoNv5BWUDtiFAIpN+84HkMWU0HHby0L6SQ6f5G8U7bJgMkCDvEh+oOzHC/gYJzBco7HEFZR3Ka/fRT/3K9VOOCJi8hNu9UM5Eaa+jDSQx/Y/VQGX3q0sTmtttKVwleY9UfYEcn2M7RAwmJby9ztXN09Vc4Ck9784pibdkE4aPObrj7aJRkgveAU1UpElmrZZMQX2iXLJt8nWGmUTtZ3AlAHsZ15CdsQ== 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=xFb7gmQbc7gjNTlGQGsL4X914eKIA0V33t01C0JVHHk=; b=ihJy71YsOIH1qgcrlcq5/5oxQLlMEFT7lgY72JkFw41lql46ztKzxkHkSCXZmiU8fzlnPTBJ8CCC8UnusXlkXpu84xRjpCJSLLoVQIsqyWfIedb4u5+S3eM64x3HFA3qnoqWJLW1gaM5pORKz8tuUzwTG0lfkc0klkp2jzNmDdZ2fBP9q8vfH4NQpnpbl44yQzaLSFWZ7EnO3+lepTlhzgd8Lsq8GNDRD0jGQZPuHBX8R9FT2u8bGIjTI5waXmCLefUpK/H7Yo84e/vtUWiIEbmzUlAzG9Pg0PfPl9dN7LNGrrjQsEwpOQTl/9g/jzNsON8m7shJD5Q2NI/M0IiMaQ== Received: from SJ0PR03CA0037.namprd03.prod.outlook.com (2603:10b6:a03:33e::12) by CY5PR12MB6276.namprd12.prod.outlook.com (2603:10b6:930:f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.27; Sun, 26 May 2024 13:23:34 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:33e:cafe::61) by SJ0PR03CA0037.outlook.office365.com (2603:10b6:a03:33e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28 via Frontend Transport; Sun, 26 May 2024 13:23:33 +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 SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Sun, 26 May 2024 13:23:33 +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.1544.4; Sun, 26 May 2024 06:23:29 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.1544.4; Sun, 26 May 2024 06:23:29 -0700 Received: from nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 26 May 2024 06:23:27 -0700 From: Maayan Kashani To: CC: , , , , Dariusz Sosnowski , "Viacheslav Ovsiienko" , Ori Kam , Matan Azrad Subject: [PATCH] net/mlx5: fix indirect action template error handling Date: Sun, 26 May 2024 16:22:44 +0300 Message-ID: <20240526132252.67839-1-mkashani@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|CY5PR12MB6276:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b66e278-7897-4cad-81e7-08dc7d870ac4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?zgl1zp2WRAOlPyQcAmoAgfPOBKDv2QF3zfiExC8PO6pk/G2ZcA16eWgzfCz3?= =?us-ascii?Q?2KPRQ6DA4F1wpzlxhKM2Hx1rT7VJsuGm4rDg0zGaibNYVq9WF3e95wZGfAx2?= =?us-ascii?Q?xk0O2Oe7AzNSRbeNPXjQqAYw6F09xi5adP3fqxGviBJCZE0xS0ehRyEDwqc8?= =?us-ascii?Q?E33ztsym9S0yvrof70rRe+m94NNpxCU0eXROgvc5nbQpRlvsyqg40epeidwj?= =?us-ascii?Q?o8KpezX1vfc8FctClbeEkoV23sjA4304TFOFPxMm4axY/SsZ76Gl1iSCi6Cu?= =?us-ascii?Q?pRUba82AGrz7kbJGDpF3260ZaSe59IQbsRGP0ujLlwxiaDjXthPlBuqoQTlV?= =?us-ascii?Q?aTLn+ba/1O9mBhYpwzkGeRBo9gbB3vSoamMK1BmpUox2QMHGcu5/0ECzDp0e?= =?us-ascii?Q?gRCNmjTRpBx0ijdVMcFvWmtOn+O5giOdYflR8AgkDRP66j9YJvzueUseH3D+?= =?us-ascii?Q?l5yvjF0OUih9QrHnenqwzSgwoW85cNulWUWcOx40qLyHtLgUpHCBUPBC11+7?= =?us-ascii?Q?3MdPoQ5V7tC47pFg8FV9u8SXD7MMxZxlEQAGad2uzL3Fo3dWP9TZuts66lL0?= =?us-ascii?Q?MTIewiv2v5d0Tu7d8q9NuCcuvn//rIU5cRL408/ccUvWiPzy6uD4zP5BFa3U?= =?us-ascii?Q?Ap/dvweMD9VbIE9mSt7vA7oJFKx4MIOv4bbyuykPqqwWywroASv89IONw+71?= =?us-ascii?Q?z+icWyePlYmtlj+QVymmTurI/tKCi42ckj4hjJ3GjIMj/GPxiVRTKcxOzv28?= =?us-ascii?Q?kJATpEDXA21qthHossQuhnszqi7wf0fW4fnZlpR5P+FN9orUlp3MmLeSBva2?= =?us-ascii?Q?gWi+z3wVklU5twJyCLRrD9LTBf/yi+TGBVgdhSzDTfImjEpX0QVIWQDE746E?= =?us-ascii?Q?ISGR/SXTVY2TGNPkjxcsDUILUMdcmshf2prFo9O+xxMfdrvLB3MgmQQsi3+Z?= =?us-ascii?Q?xoe7WEXFpYKKJZdCWYi7yflWXcSxNiuMSbrhPoMVQD557w4JXGMg4OgHtZ5N?= =?us-ascii?Q?mGvk9BoZIQkI/KRjRYyBGz/0nJUW7URTauM4ik3vStMOgh8wzPw3izfHRlT8?= =?us-ascii?Q?3zsmFIJTXLSySBjIjQ2gxQIdGddGsi6+lspukhcD7GaAEQPKA78OOwObuBwf?= =?us-ascii?Q?RS9NX27CK/v0W1FkcrnxAHYVBQZgHvu1QCXwi64wR13VpcVhmr48tzGePNzg?= =?us-ascii?Q?ytEj1jTBUMujiaVzZIJtNqya7cCgRs5i+HDR/QnuNY2s+1v3c243F5f7U+AM?= =?us-ascii?Q?k3FOlgS1vjt5NjGr00IgnWkez7xTirdue2AW7NJ9r7IW78VYk9neK2TA+xTt?= =?us-ascii?Q?Joi8WITQqzapaycb320V0+1hQBvUak5aK29FDtwIrJWw10PsRfHiTkbtCEpz?= =?us-ascii?Q?JZBxynU=3D?= 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)(36860700004)(376005)(1800799015)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2024 13:23:33.3225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b66e278-7897-4cad-81e7-08dc7d870ac4 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: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6276 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org For indirect action type, on error case the function jumped to err but returned zero cause rte_errno was not initialized before the jump. It caused no error in table creation. In case reaching an error, if rte_errno is not initialized, it will be set to EINVAL. Now table creation should fail if the translate of the action fails. Added driver log warnings so it can be easy to track failure on shared actions translate. Fixes: 7ab3962d2d2b ("net/mlx5: add indirect HW steering action") Cc: stable@dpdk.org Signed-off-by: Maayan Kashani Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_hw.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 80efcf44fa..d0a1ec85ec 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -1106,15 +1106,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, if (!shared_rss || __flow_hw_act_data_shared_rss_append (priv, acts, (enum rte_flow_action_type)MLX5_RTE_FLOW_ACTION_TYPE_RSS, - action_src, action_dst, idx, shared_rss)) + action_src, action_dst, idx, shared_rss)) { + DRV_LOG(WARNING, "Indirect RSS action index %d translate failed", act_idx); return -1; + } break; case MLX5_INDIRECT_ACTION_TYPE_COUNT: if (__flow_hw_act_data_shared_cnt_append(priv, acts, (enum rte_flow_action_type) MLX5_RTE_FLOW_ACTION_TYPE_COUNT, - action_src, action_dst, act_idx)) + action_src, action_dst, act_idx)) { + DRV_LOG(WARNING, "Indirect count action translate failed"); return -1; + } break; case MLX5_INDIRECT_ACTION_TYPE_AGE: /* Not supported, prevent by validate function. */ @@ -1122,15 +1126,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev, break; case MLX5_INDIRECT_ACTION_TYPE_CT: if (flow_hw_ct_compile(dev, MLX5_HW_INV_QUEUE, - idx, &acts->rule_acts[action_dst])) + idx, &acts->rule_acts[action_dst])) { + DRV_LOG(WARNING, "Indirect CT action translate failed"); return -1; + } break; case MLX5_INDIRECT_ACTION_TYPE_METER_MARK: if (__flow_hw_act_data_shared_mtr_append(priv, acts, (enum rte_flow_action_type) MLX5_RTE_FLOW_ACTION_TYPE_METER_MARK, - action_src, action_dst, idx)) + action_src, action_dst, idx)) { + DRV_LOG(WARNING, "Indirect meter mark action translate failed"); return -1; + } break; case MLX5_INDIRECT_ACTION_TYPE_QUOTA: flow_hw_construct_quota(priv, &acts->rule_acts[action_dst], idx); @@ -2641,6 +2649,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev, } return 0; err: + /*If rte_errno was not initialized and reached error state. */ + if (!rte_errno) + rte_errno = EINVAL; err = rte_errno; __flow_hw_action_template_destroy(dev, acts); return rte_flow_error_set(error, err, -- 2.34.1