get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/129135/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 129135,
    "url": "http://patches.dpdk.org/api/patches/129135/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230630063637.432552-1-bingz@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230630063637.432552-1-bingz@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230630063637.432552-1-bingz@nvidia.com",
    "date": "2023-06-30T06:36:37",
    "name": "[5/7] net/mlx5: fix the error set in control tables create",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "409874bf3b91e0f9c213ca8c420611678d2215b0",
    "submitter": {
        "id": 1976,
        "url": "http://patches.dpdk.org/api/people/1976/?format=api",
        "name": "Bing Zhao",
        "email": "bingz@nvidia.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230630063637.432552-1-bingz@nvidia.com/mbox/",
    "series": [
        {
            "id": 28725,
            "url": "http://patches.dpdk.org/api/series/28725/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28725",
            "date": "2023-06-30T06:28:47",
            "name": null,
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/28725/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/129135/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/129135/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 95C9942D73;\n\tFri, 30 Jun 2023 08:37:12 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6DF4A406B5;\n\tFri, 30 Jun 2023 08:37:12 +0200 (CEST)",
            "from NAM12-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam12on2043.outbound.protection.outlook.com [40.107.244.43])\n by mails.dpdk.org (Postfix) with ESMTP id 55E474021F\n for <dev@dpdk.org>; Fri, 30 Jun 2023 08:37:11 +0200 (CEST)",
            "from MW4PR04CA0349.namprd04.prod.outlook.com (2603:10b6:303:8a::24)\n by MN0PR12MB6056.namprd12.prod.outlook.com (2603:10b6:208:3cc::12)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Fri, 30 Jun\n 2023 06:37:08 +0000",
            "from CO1NAM11FT045.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:8a:cafe::19) by MW4PR04CA0349.outlook.office365.com\n (2603:10b6:303:8a::24) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend\n Transport; Fri, 30 Jun 2023 06:37:08 +0000",
            "from mail.nvidia.com (216.228.117.161) by\n CO1NAM11FT045.mail.protection.outlook.com (10.13.175.181) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.6500.50 via Frontend Transport; Fri, 30 Jun 2023 06:37:08 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com\n (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Thu, 29 Jun 2023\n 23:36:58 -0700",
            "from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com\n (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Thu, 29 Jun\n 2023 23:36:55 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=cqCQ55Ij29oUdYHdRyKvzqeGaFAmSDolj95Vtjx+Fz8kQ5lBHEfX3LfJKczTev0p4d4cO+Fs3t44g3bPCavXX2urbcxh/p+o6WFkC/0N+7JfYhyMyy3ESc3ya4E0adpHKI449ynV3s8B0ve4G9vV4bAQArG4DgqNuMX0tZMEL6Js1Trj2rn19tQ3412XsQwAaAlU8CXDAOCC+ni33gm4T/l/Q49FiE0lt2RBVFSGxB7oRd/v/u8FP3AoMTCsqgESUDh9RZFPMr5tjTx9havtdilFlQw1AIFaORNOO3xNX7Un+5ahQYM2dlP8vYn84btQs70e8hdXinKd3U9lfYlD4g==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n 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;\n bh=WBULf1JIj0d26rysnCr/rsHEgiJl1OQNtpC8JC8gIRQ=;\n b=idYehmEdMJgT57gDaIfHZ+f0eNDg+pKkuixVn9aEqrk32DB35j36XWKkzRpOi1Iaib+u73QLCPqk5dPc7FS+8bPb2vg0cwfKJexm54lby2gjZnephImmlB4kc1rS8eAWxBIZrVGTej75MiJw031zzJ7fTM6GqxnCvydIDQyUBotLmWUCiGuzNAQePUjWD3GfBoL4+PZmvpyN/c9JiDmWLHAAmcEb6TcnXmVRsGRuVy7PhcwOlRPK2wslqk/+N9oQO69C3ZbCwk/t5DTU0yfr7HlZ8w0bhUinV07tLRgyTqOBbAeX62w6wSHC8vRVEldbvdIwy9OMXdUSiWxhWz8vKw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=WBULf1JIj0d26rysnCr/rsHEgiJl1OQNtpC8JC8gIRQ=;\n b=MoNBn0VeUNQ8o265eAbPLnb66XrSYUm4fY/MyZ4AI6py1arrtWyrkMOrEy90b5KF6iozNcssnG2wRAGS4dVzn8mamjpnbf0+Nr0trvgDP3MJ4Co38ptIAi9IP/Gjce4vYzEQbCAVUMpCGgw8prkqKNDLkF+wdQlE4cLz1I412fFrg8ckizhtOAXj/WYkF2jjhVSYovAKhKSpPUJmvVUUV3k0YZ4SrcdFrh6xXIJgR9vwCzLcVLyjJN9cFFaeC6DzWCL+YsYtH37uu9MF8WqjF3lQSCuN/dw5FM7yuYm/4wWISxlBro3fJkNz8c2vaiFp0LtO6KyKd9fJqBWV+j4kYA==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.117.161)\n smtp.mailfrom=nvidia.com;\n dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.117.161 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C",
        "From": "Bing Zhao <bingz@nvidia.com>",
        "To": "<matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,\n <suanmingm@nvidia.com>, <rasland@nvidia.com>",
        "CC": "<dev@dpdk.org>, <dsosnowski@nvidia.com>",
        "Subject": "[PATCH 5/7] net/mlx5: fix the error set in control tables create",
        "Date": "Fri, 30 Jun 2023 09:36:37 +0300",
        "Message-ID": "<20230630063637.432552-1-bingz@nvidia.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "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\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "CO1NAM11FT045:EE_|MN0PR12MB6056:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "9cd531f3-189c-48b2-5ae1-08db79346d92",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n k6rb3yy4z7G3ntlNaKuKef6S0ckRwO7qmNS9FDk3DhyxWQqT6uphgaDDl8P18x1ViiwRFuBugHeVJ6NqjaOBv2O7vZ+XTh+ilT34eOfFYNPpoFeDvcGLuc96AnXxYomAnOYOfyGiWLkJww3T4n32Ex9GYxq03sbuRWZslX2TfYZdH1bc/Bh4VcN3gqDzlhJtz7c2QOBXdUvqJRracyI3gBXtXpwCiYe6cuD4peSc4KaFzE/bF1S50F0ZWs6hSbkNUJEuTtFJUXknupfUZWY42lDbCxBM8KE4oTg0P8nCti7zHrcbBubLEV61L1K8UsxR03oUnNHzgz/RekjSCM/lipCgTWYpe5E3IyMMnOs5xBahXolVdGpf10xa3TbXdhvxrHcTfHzIofTS2XpulF6Xrw2Oh1xjxJcDLYANZY4ByksiccsMQxuoTI7myPygZTr3CnwvMz8htz+XKwLjZUGQj5I8V3yYdTy9K76shxG+sVpsTNKaxFqDO59tZujp/sr41D5wJJFXym8ox5wyC4QFz4LM9B6obEvOK9Jcuu/v8cN8vJk1eyw1RVPjzgA0e/f6WDF/wq/0MJuHfL9gZ73ZiZuCUGte2bHMuSzTEwiRYA2ahMVKlJNjrwI3qK/K7Q3fuB80ltYA2XguXTrDo7HUna8uT8/j1NeiuZQrSx/RqieXG2SRvjZ//kEFVfgmzquGNrPAB450dwQp4TlPtn+1EyHWMn/Nsz4qehMU3KJTkFVOQEVuypPWDy8qjpGVRVgV",
        "X-Forefront-Antispam-Report": "CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE;\n SFS:(13230028)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199021)(36840700001)(40470700004)(46966006)(70206006)(30864003)(5660300002)(26005)(2906002)(186003)(1076003)(426003)(47076005)(107886003)(2616005)(16526019)(40460700003)(6286002)(8936002)(83380400001)(356005)(40480700001)(36860700001)(70586007)(41300700001)(336012)(6636002)(36756003)(55016003)(7636003)(6666004)(7696005)(82740400003)(478600001)(54906003)(8676002)(86362001)(110136005)(4326008)(82310400005)(316002);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "30 Jun 2023 06:37:08.5063 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 9cd531f3-189c-48b2-5ae1-08db79346d92",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT045.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "MN0PR12MB6056",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "When some failure occurrs in the flow_hw_create_ctrl_tables(), the\n\"rte_flow_error\" should be set properly with all needed information.\nThen the rte_errno and the \"message\" will reflect the actual failure.\n\nThis will also solve the crash when trying to access the \"message\".\n\nFixes: 1939eb6f660c (\"net/mlx5: support flow port action with HWS\")\nFixes: 483181f7b6dd (\"net/mlx5: support device control of representor matching\")\nFixes: ddb68e47331e (\"net/mlx5: add extended metadata mode for HWS\")\nCc: dsosnowski@nvidia.com\n\nSigned-off-by: Bing Zhao <bingz@nvidia.com>\nReviewed-by: Suanming Mou <suanmingm@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow_hw.c | 176 +++++++++++++++++++-------------\n 1 file changed, 106 insertions(+), 70 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c\nindex 87584c1e94..4163fe23e6 100644\n--- a/drivers/net/mlx5/mlx5_flow_hw.c\n+++ b/drivers/net/mlx5/mlx5_flow_hw.c\n@@ -5421,7 +5421,7 @@ flow_hw_pattern_template_create(struct rte_eth_dev *dev,\n \tstruct rte_flow_pattern_template *it;\n \tstruct rte_flow_item *copied_items = NULL;\n \tconst struct rte_flow_item *tmpl_items;\n-\tuint64_t orig_item_nb;\n+\tuint32_t orig_item_nb;\n \tstruct rte_flow_item port = {\n \t\t.type = RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT,\n \t\t.mask = &rte_flow_item_ethdev_mask,\n@@ -6242,12 +6242,15 @@ flow_hw_esw_mgr_regc_marker(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow pattern template on success, NULL otherwise.\n  */\n static struct rte_flow_pattern_template *\n-flow_hw_create_ctrl_esw_mgr_pattern_template(struct rte_eth_dev *dev)\n+flow_hw_create_ctrl_esw_mgr_pattern_template(struct rte_eth_dev *dev,\n+\t\t\t\t\t     struct rte_flow_error *error)\n {\n \tstruct rte_flow_pattern_template_attr attr = {\n \t\t.relaxed_matching = 0,\n@@ -6277,7 +6280,7 @@ flow_hw_create_ctrl_esw_mgr_pattern_template(struct rte_eth_dev *dev)\n \t\t},\n \t};\n \n-\treturn flow_hw_pattern_template_create(dev, &attr, items, NULL);\n+\treturn flow_hw_pattern_template_create(dev, &attr, items, error);\n }\n \n /**\n@@ -6290,12 +6293,15 @@ flow_hw_create_ctrl_esw_mgr_pattern_template(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow pattern template on success, NULL otherwise.\n  */\n static struct rte_flow_pattern_template *\n-flow_hw_create_ctrl_regc_sq_pattern_template(struct rte_eth_dev *dev)\n+flow_hw_create_ctrl_regc_sq_pattern_template(struct rte_eth_dev *dev,\n+\t\t\t\t\t     struct rte_flow_error *error)\n {\n \tstruct rte_flow_pattern_template_attr attr = {\n \t\t.relaxed_matching = 0,\n@@ -6328,7 +6334,7 @@ flow_hw_create_ctrl_regc_sq_pattern_template(struct rte_eth_dev *dev)\n \t\t},\n \t};\n \n-\treturn flow_hw_pattern_template_create(dev, &attr, items, NULL);\n+\treturn flow_hw_pattern_template_create(dev, &attr, items, error);\n }\n \n /**\n@@ -6338,12 +6344,15 @@ flow_hw_create_ctrl_regc_sq_pattern_template(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow pattern template on success, NULL otherwise.\n  */\n static struct rte_flow_pattern_template *\n-flow_hw_create_ctrl_port_pattern_template(struct rte_eth_dev *dev)\n+flow_hw_create_ctrl_port_pattern_template(struct rte_eth_dev *dev,\n+\t\t\t\t\t  struct rte_flow_error *error)\n {\n \tstruct rte_flow_pattern_template_attr attr = {\n \t\t.relaxed_matching = 0,\n@@ -6362,7 +6371,7 @@ flow_hw_create_ctrl_port_pattern_template(struct rte_eth_dev *dev)\n \t\t},\n \t};\n \n-\treturn flow_hw_pattern_template_create(dev, &attr, items, NULL);\n+\treturn flow_hw_pattern_template_create(dev, &attr, items, error);\n }\n \n /*\n@@ -6372,12 +6381,15 @@ flow_hw_create_ctrl_port_pattern_template(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow pattern template on success, NULL otherwise.\n  */\n static struct rte_flow_pattern_template *\n-flow_hw_create_tx_default_mreg_copy_pattern_template(struct rte_eth_dev *dev)\n+flow_hw_create_tx_default_mreg_copy_pattern_template(struct rte_eth_dev *dev,\n+\t\t\t\t\t\t     struct rte_flow_error *error)\n {\n \tstruct rte_flow_pattern_template_attr tx_pa_attr = {\n \t\t.relaxed_matching = 0,\n@@ -6398,10 +6410,8 @@ flow_hw_create_tx_default_mreg_copy_pattern_template(struct rte_eth_dev *dev)\n \t\t\t.type = RTE_FLOW_ITEM_TYPE_END,\n \t\t},\n \t};\n-\tstruct rte_flow_error drop_err;\n \n-\tRTE_SET_USED(drop_err);\n-\treturn flow_hw_pattern_template_create(dev, &tx_pa_attr, eth_all, &drop_err);\n+\treturn flow_hw_pattern_template_create(dev, &tx_pa_attr, eth_all, error);\n }\n \n /**\n@@ -6412,12 +6422,15 @@ flow_hw_create_tx_default_mreg_copy_pattern_template(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow actions template on success, NULL otherwise.\n  */\n static struct rte_flow_actions_template *\n-flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev)\n+flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev,\n+\t\t\t\t\t       struct rte_flow_error *error)\n {\n \tuint32_t marker_mask = flow_hw_esw_mgr_regc_marker_mask(dev);\n \tuint32_t marker_bits = flow_hw_esw_mgr_regc_marker(dev);\n@@ -6484,7 +6497,7 @@ flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev)\n \tset_reg_v.dst.offset = rte_bsf32(marker_mask);\n \trte_memcpy(set_reg_v.src.value, &marker_bits, sizeof(marker_bits));\n \trte_memcpy(set_reg_m.src.value, &marker_mask, sizeof(marker_mask));\n-\treturn flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, NULL);\n+\treturn flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, error);\n }\n \n /**\n@@ -6496,13 +6509,16 @@ flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev)\n  *   Pointer to Ethernet device.\n  * @param group\n  *   Destination group for this action template.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow actions template on success, NULL otherwise.\n  */\n static struct rte_flow_actions_template *\n flow_hw_create_ctrl_jump_actions_template(struct rte_eth_dev *dev,\n-\t\t\t\t\t  uint32_t group)\n+\t\t\t\t\t  uint32_t group,\n+\t\t\t\t\t  struct rte_flow_error *error)\n {\n \tstruct rte_flow_actions_template_attr attr = {\n \t\t.transfer = 1,\n@@ -6532,8 +6548,8 @@ flow_hw_create_ctrl_jump_actions_template(struct rte_eth_dev *dev,\n \t\t}\n \t};\n \n-\treturn flow_hw_actions_template_create(dev, &attr, actions_v, actions_m,\n-\t\t\t\t\t       NULL);\n+\treturn flow_hw_actions_template_create(dev, &attr, actions_v,\n+\t\t\t\t\t       actions_m, error);\n }\n \n /**\n@@ -6542,12 +6558,15 @@ flow_hw_create_ctrl_jump_actions_template(struct rte_eth_dev *dev,\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow action template on success, NULL otherwise.\n  */\n static struct rte_flow_actions_template *\n-flow_hw_create_ctrl_port_actions_template(struct rte_eth_dev *dev)\n+flow_hw_create_ctrl_port_actions_template(struct rte_eth_dev *dev,\n+\t\t\t\t\t  struct rte_flow_error *error)\n {\n \tstruct rte_flow_actions_template_attr attr = {\n \t\t.transfer = 1,\n@@ -6577,8 +6596,7 @@ flow_hw_create_ctrl_port_actions_template(struct rte_eth_dev *dev)\n \t\t}\n \t};\n \n-\treturn flow_hw_actions_template_create(dev, &attr, actions_v, actions_m,\n-\t\t\t\t\t       NULL);\n+\treturn flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, error);\n }\n \n /*\n@@ -6587,12 +6605,15 @@ flow_hw_create_ctrl_port_actions_template(struct rte_eth_dev *dev)\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow actions template on success, NULL otherwise.\n  */\n static struct rte_flow_actions_template *\n-flow_hw_create_tx_default_mreg_copy_actions_template(struct rte_eth_dev *dev)\n+flow_hw_create_tx_default_mreg_copy_actions_template(struct rte_eth_dev *dev,\n+\t\t\t\t\t\t     struct rte_flow_error *error)\n {\n \tstruct rte_flow_actions_template_attr tx_act_attr = {\n \t\t.egress = 1,\n@@ -6657,11 +6678,9 @@ flow_hw_create_tx_default_mreg_copy_actions_template(struct rte_eth_dev *dev)\n \t\t\t.type = RTE_FLOW_ACTION_TYPE_END,\n \t\t},\n \t};\n-\tstruct rte_flow_error drop_err;\n \n-\tRTE_SET_USED(drop_err);\n \treturn flow_hw_actions_template_create(dev, &tx_act_attr, actions,\n-\t\t\t\t\t       masks, &drop_err);\n+\t\t\t\t\t       masks, error);\n }\n \n /**\n@@ -6674,6 +6693,8 @@ flow_hw_create_tx_default_mreg_copy_actions_template(struct rte_eth_dev *dev)\n  *   Pointer to flow pattern template.\n  * @param at\n  *   Pointer to flow actions template.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow table on success, NULL otherwise.\n@@ -6681,7 +6702,8 @@ flow_hw_create_tx_default_mreg_copy_actions_template(struct rte_eth_dev *dev)\n static struct rte_flow_template_table*\n flow_hw_create_ctrl_sq_miss_root_table(struct rte_eth_dev *dev,\n \t\t\t\t       struct rte_flow_pattern_template *it,\n-\t\t\t\t       struct rte_flow_actions_template *at)\n+\t\t\t\t       struct rte_flow_actions_template *at,\n+\t\t\t\t       struct rte_flow_error *error)\n {\n \tstruct rte_flow_template_table_attr attr = {\n \t\t.flow_attr = {\n@@ -6698,7 +6720,7 @@ flow_hw_create_ctrl_sq_miss_root_table(struct rte_eth_dev *dev,\n \t\t.external = false,\n \t};\n \n-\treturn flow_hw_table_create(dev, &cfg, &it, 1, &at, 1, NULL);\n+\treturn flow_hw_table_create(dev, &cfg, &it, 1, &at, 1, error);\n }\n \n \n@@ -6712,6 +6734,8 @@ flow_hw_create_ctrl_sq_miss_root_table(struct rte_eth_dev *dev,\n  *   Pointer to flow pattern template.\n  * @param at\n  *   Pointer to flow actions template.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow table on success, NULL otherwise.\n@@ -6719,7 +6743,8 @@ flow_hw_create_ctrl_sq_miss_root_table(struct rte_eth_dev *dev,\n static struct rte_flow_template_table*\n flow_hw_create_ctrl_sq_miss_table(struct rte_eth_dev *dev,\n \t\t\t\t  struct rte_flow_pattern_template *it,\n-\t\t\t\t  struct rte_flow_actions_template *at)\n+\t\t\t\t  struct rte_flow_actions_template *at,\n+\t\t\t\t  struct rte_flow_error *error)\n {\n \tstruct rte_flow_template_table_attr attr = {\n \t\t.flow_attr = {\n@@ -6736,7 +6761,7 @@ flow_hw_create_ctrl_sq_miss_table(struct rte_eth_dev *dev,\n \t\t.external = false,\n \t};\n \n-\treturn flow_hw_table_create(dev, &cfg, &it, 1, &at, 1, NULL);\n+\treturn flow_hw_table_create(dev, &cfg, &it, 1, &at, 1, error);\n }\n \n /*\n@@ -6748,6 +6773,8 @@ flow_hw_create_ctrl_sq_miss_table(struct rte_eth_dev *dev,\n  *   Pointer to flow pattern template.\n  * @param at\n  *   Pointer to flow actions template.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow table on success, NULL otherwise.\n@@ -6755,7 +6782,8 @@ flow_hw_create_ctrl_sq_miss_table(struct rte_eth_dev *dev,\n static struct rte_flow_template_table*\n flow_hw_create_tx_default_mreg_copy_table(struct rte_eth_dev *dev,\n \t\t\t\t\t  struct rte_flow_pattern_template *pt,\n-\t\t\t\t\t  struct rte_flow_actions_template *at)\n+\t\t\t\t\t  struct rte_flow_actions_template *at,\n+\t\t\t\t\t  struct rte_flow_error *error)\n {\n \tstruct rte_flow_template_table_attr tx_tbl_attr = {\n \t\t.flow_attr = {\n@@ -6769,14 +6797,8 @@ flow_hw_create_tx_default_mreg_copy_table(struct rte_eth_dev *dev,\n \t\t.attr = tx_tbl_attr,\n \t\t.external = false,\n \t};\n-\tstruct rte_flow_error drop_err = {\n-\t\t.type = RTE_FLOW_ERROR_TYPE_NONE,\n-\t\t.cause = NULL,\n-\t\t.message = NULL,\n-\t};\n \n-\tRTE_SET_USED(drop_err);\n-\treturn flow_hw_table_create(dev, &tx_tbl_cfg, &pt, 1, &at, 1, &drop_err);\n+\treturn flow_hw_table_create(dev, &tx_tbl_cfg, &pt, 1, &at, 1, error);\n }\n \n /**\n@@ -6789,6 +6811,8 @@ flow_hw_create_tx_default_mreg_copy_table(struct rte_eth_dev *dev,\n  *   Pointer to flow pattern template.\n  * @param at\n  *   Pointer to flow actions template.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n  *   Pointer to flow table on success, NULL otherwise.\n@@ -6796,7 +6820,8 @@ flow_hw_create_tx_default_mreg_copy_table(struct rte_eth_dev *dev,\n static struct rte_flow_template_table *\n flow_hw_create_ctrl_jump_table(struct rte_eth_dev *dev,\n \t\t\t       struct rte_flow_pattern_template *it,\n-\t\t\t       struct rte_flow_actions_template *at)\n+\t\t\t       struct rte_flow_actions_template *at,\n+\t\t\t       struct rte_flow_error *error)\n {\n \tstruct rte_flow_template_table_attr attr = {\n \t\t.flow_attr = {\n@@ -6813,7 +6838,7 @@ flow_hw_create_ctrl_jump_table(struct rte_eth_dev *dev,\n \t\t.external = false,\n \t};\n \n-\treturn flow_hw_table_create(dev, &cfg, &it, 1, &at, 1, NULL);\n+\treturn flow_hw_table_create(dev, &cfg, &it, 1, &at, 1, error);\n }\n \n /**\n@@ -6822,12 +6847,14 @@ flow_hw_create_ctrl_jump_table(struct rte_eth_dev *dev,\n  *\n  * @param dev\n  *   Pointer to Ethernet device.\n+ * @param error\n+ *   Pointer to error structure.\n  *\n  * @return\n- *   0 on success, EINVAL otherwise\n+ *   0 on success, negative values otherwise\n  */\n static __rte_unused int\n-flow_hw_create_ctrl_tables(struct rte_eth_dev *dev)\n+flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct rte_flow_pattern_template *esw_mgr_items_tmpl = NULL;\n@@ -6840,96 +6867,107 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev)\n \tstruct rte_flow_actions_template *tx_meta_actions_tmpl = NULL;\n \tuint32_t xmeta = priv->sh->config.dv_xmeta_en;\n \tuint32_t repr_matching = priv->sh->config.repr_matching;\n+\tint ret;\n \n \t/* Create templates and table for default SQ miss flow rules - root table. */\n-\tesw_mgr_items_tmpl = flow_hw_create_ctrl_esw_mgr_pattern_template(dev);\n+\tesw_mgr_items_tmpl = flow_hw_create_ctrl_esw_mgr_pattern_template(dev, error);\n \tif (!esw_mgr_items_tmpl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create E-Switch Manager item\"\n \t\t\t\" template for control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n-\tregc_jump_actions_tmpl = flow_hw_create_ctrl_regc_jump_actions_template(dev);\n+\tregc_jump_actions_tmpl = flow_hw_create_ctrl_regc_jump_actions_template(dev, error);\n \tif (!regc_jump_actions_tmpl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create REG_C set and jump action template\"\n \t\t\t\" for control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n \tMLX5_ASSERT(priv->hw_esw_sq_miss_root_tbl == NULL);\n \tpriv->hw_esw_sq_miss_root_tbl = flow_hw_create_ctrl_sq_miss_root_table\n-\t\t\t(dev, esw_mgr_items_tmpl, regc_jump_actions_tmpl);\n+\t\t\t(dev, esw_mgr_items_tmpl, regc_jump_actions_tmpl, error);\n \tif (!priv->hw_esw_sq_miss_root_tbl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create table for default sq miss (root table)\"\n \t\t\t\" for control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n \t/* Create templates and table for default SQ miss flow rules - non-root table. */\n-\tregc_sq_items_tmpl = flow_hw_create_ctrl_regc_sq_pattern_template(dev);\n+\tregc_sq_items_tmpl = flow_hw_create_ctrl_regc_sq_pattern_template(dev, error);\n \tif (!regc_sq_items_tmpl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create SQ item template for\"\n \t\t\t\" control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n-\tport_actions_tmpl = flow_hw_create_ctrl_port_actions_template(dev);\n+\tport_actions_tmpl = flow_hw_create_ctrl_port_actions_template(dev, error);\n \tif (!port_actions_tmpl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create port action template\"\n \t\t\t\" for control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n \tMLX5_ASSERT(priv->hw_esw_sq_miss_tbl == NULL);\n \tpriv->hw_esw_sq_miss_tbl = flow_hw_create_ctrl_sq_miss_table(dev, regc_sq_items_tmpl,\n-\t\t\t\t\t\t\t\t     port_actions_tmpl);\n+\t\t\t\t\t\t\t\t     port_actions_tmpl, error);\n \tif (!priv->hw_esw_sq_miss_tbl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create table for default sq miss (non-root table)\"\n \t\t\t\" for control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n \t/* Create templates and table for default FDB jump flow rules. */\n-\tport_items_tmpl = flow_hw_create_ctrl_port_pattern_template(dev);\n+\tport_items_tmpl = flow_hw_create_ctrl_port_pattern_template(dev, error);\n \tif (!port_items_tmpl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create SQ item template for\"\n \t\t\t\" control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n \tjump_one_actions_tmpl = flow_hw_create_ctrl_jump_actions_template\n-\t\t\t(dev, MLX5_HW_LOWEST_USABLE_GROUP);\n+\t\t\t(dev, MLX5_HW_LOWEST_USABLE_GROUP, error);\n \tif (!jump_one_actions_tmpl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create jump action template\"\n \t\t\t\" for control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n \tMLX5_ASSERT(priv->hw_esw_zero_tbl == NULL);\n \tpriv->hw_esw_zero_tbl = flow_hw_create_ctrl_jump_table(dev, port_items_tmpl,\n-\t\t\t\t\t\t\t       jump_one_actions_tmpl);\n+\t\t\t\t\t\t\t       jump_one_actions_tmpl,\n+\t\t\t\t\t\t\t       error);\n \tif (!priv->hw_esw_zero_tbl) {\n \t\tDRV_LOG(ERR, \"port %u failed to create table for default jump to group 1\"\n \t\t\t\" for control flows\", dev->data->port_id);\n-\t\tgoto error;\n+\t\tgoto err;\n \t}\n \t/* Create templates and table for default Tx metadata copy flow rule. */\n \tif (!repr_matching && xmeta == MLX5_XMETA_MODE_META32_HWS) {\n-\t\ttx_meta_items_tmpl = flow_hw_create_tx_default_mreg_copy_pattern_template(dev);\n+\t\ttx_meta_items_tmpl =\n+\t\t\tflow_hw_create_tx_default_mreg_copy_pattern_template(dev, error);\n \t\tif (!tx_meta_items_tmpl) {\n \t\t\tDRV_LOG(ERR, \"port %u failed to Tx metadata copy pattern\"\n \t\t\t\t\" template for control flows\", dev->data->port_id);\n-\t\t\tgoto error;\n+\t\t\tgoto err;\n \t\t}\n-\t\ttx_meta_actions_tmpl = flow_hw_create_tx_default_mreg_copy_actions_template(dev);\n+\t\ttx_meta_actions_tmpl =\n+\t\t\tflow_hw_create_tx_default_mreg_copy_actions_template(dev, error);\n \t\tif (!tx_meta_actions_tmpl) {\n \t\t\tDRV_LOG(ERR, \"port %u failed to Tx metadata copy actions\"\n \t\t\t\t\" template for control flows\", dev->data->port_id);\n-\t\t\tgoto error;\n+\t\t\tgoto err;\n \t\t}\n \t\tMLX5_ASSERT(priv->hw_tx_meta_cpy_tbl == NULL);\n-\t\tpriv->hw_tx_meta_cpy_tbl = flow_hw_create_tx_default_mreg_copy_table(dev,\n-\t\t\t\t\ttx_meta_items_tmpl, tx_meta_actions_tmpl);\n+\t\tpriv->hw_tx_meta_cpy_tbl =\n+\t\t\tflow_hw_create_tx_default_mreg_copy_table(dev, tx_meta_items_tmpl,\n+\t\t\t\t\t\t\t\t  tx_meta_actions_tmpl, error);\n \t\tif (!priv->hw_tx_meta_cpy_tbl) {\n \t\t\tDRV_LOG(ERR, \"port %u failed to create table for default\"\n \t\t\t\t\" Tx metadata copy flow rule\", dev->data->port_id);\n-\t\t\tgoto error;\n+\t\t\tgoto err;\n \t\t}\n \t}\n \treturn 0;\n-error:\n+err:\n+\t/* Do not overwrite the rte_errno. */\n+\tret = -rte_errno;\n+\tif (ret == 0)\n+\t\tret = rte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,\n+\t\t\t\t\t \"Failed to create control tables.\");\n \tif (priv->hw_esw_zero_tbl) {\n \t\tflow_hw_table_destroy(dev, priv->hw_esw_zero_tbl, NULL);\n \t\tpriv->hw_esw_zero_tbl = NULL;\n@@ -6958,7 +6996,7 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev)\n \t\tflow_hw_pattern_template_destroy(dev, regc_sq_items_tmpl, NULL);\n \tif (esw_mgr_items_tmpl)\n \t\tflow_hw_pattern_template_destroy(dev, esw_mgr_items_tmpl, NULL);\n-\treturn -EINVAL;\n+\treturn ret;\n }\n \n static void\n@@ -7834,11 +7872,9 @@ flow_hw_configure(struct rte_eth_dev *dev,\n \t\t\t\t\t   NULL, \"Failed to create vport actions.\");\n \t\t\tgoto err;\n \t\t}\n-\t\tret = flow_hw_create_ctrl_tables(dev);\n-\t\tif (ret) {\n-\t\t\trte_errno = -ret;\n+\t\tret = flow_hw_create_ctrl_tables(dev, error);\n+\t\tif (ret)\n \t\t\tgoto err;\n-\t\t}\n \t}\n \tif (!priv->shared_host)\n \t\tflow_hw_create_send_to_kernel_actions(priv);\n",
    "prefixes": [
        "5/7"
    ]
}