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 562FA43258; Wed, 1 Nov 2023 05:46:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A70E040E54; Wed, 1 Nov 2023 05:45:26 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2061.outbound.protection.outlook.com [40.107.243.61]) by mails.dpdk.org (Postfix) with ESMTP id A5B8C42D96 for ; Wed, 1 Nov 2023 05:45:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JkrCpA1cED5R74TlMYP7DovQgt2lD4uC669cSiFiIVN4/POYhcjI2QPIscZPqHujEqVus5FWxexiaxyHd1xMrctzV6dtH3jcbx84NwwCHaeJ26AtoK1QnGtHhxBTmTP63fNxEV0tfXV4NF+vHsmk5mQv92KQcOjIocvux5uDb+nvRs9zsQ7YIrzjLW5T51AZM4Y5iEqHxDG4E8EHtC/oBLy34jdGjY7T4gkpRqHKb+ZVffz0udFLQFk3kR0TfX2QdG7+QRl6ePzNAehrrXQA//ZPBC1iqcbMnbKMh2oGmwudqP39NI8LokGCuAVklO6VZ+5X/uicUdQ7b8yg4oPoGQ== 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=QUqiHoWUVwN+cqlv4jPDulGpPr5YkmR3yObQvkJYpXQ=; b=Mvb2SNn+0SHKtq9Tq6vFQwCXyo3SGM9H1TMPs/g7w+flLPx34WBSQK9EOKDEL3x2NN7zJp7cSeGnmMko5ffZR7fQTFj+vT3jVAqbaBl6zIJ7ycxNzjFzRbESOL0rt1WML6bLffOWHfu0L5k1Zjw2Jyv6Vuyp032EyVHFTT9s53sAaOcqrjbwktUMUX/HozjBAdFzIANAt96s0eR6whtmTlZoUwvNfprv9oqGDupLtqUAUeBDUqraZY3nX1MhP/u8IRkzDFQxhnLXxS9bOnnb/Xq5vAwHXHJaxvCSVcYvSMKn8USqLy5d28pu0O3obBNHtuXyUlMznu2dFOfWktrW2A== 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=QUqiHoWUVwN+cqlv4jPDulGpPr5YkmR3yObQvkJYpXQ=; b=XHvJaFBZGaiLwM1YT6eUCHXfoO8pxe/bEKFCG1Ofh3QIxWfDUhsL72qJbhogFv4H6QJWn8XOzT0kloeNQvlhtlr+Gg7rOOhyvfDNkj7ReeMSpiEmruESqoquUQrz7f6a7G0Bk0hic6gZB2/8mMmnIdJvpKFP2ZrBgaXxVLU9xEJnkXNyacW0C/hPy2x9yfS6RCMH9ZGF4wzZ6508VFQx/JdbIPL6SpfxH56LdOhpCijjVq+4PyvZ/TFnmlNwADq7lXls8v+mPuOGud1Dzwp9FJN/pdFxEOZSvS0GQFEV12YeUhEZxbF7r1WGvxhOhMufUaACLbYrncwy1wRbfOqtJA== Received: from CY5PR13CA0032.namprd13.prod.outlook.com (2603:10b6:930:11::6) by MN0PR12MB6174.namprd12.prod.outlook.com (2603:10b6:208:3c5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.22; Wed, 1 Nov 2023 04:45:22 +0000 Received: from CY4PEPF0000E9CE.namprd03.prod.outlook.com (2603:10b6:930:11:cafe::c5) by CY5PR13CA0032.outlook.office365.com (2603:10b6:930:11::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.15 via Frontend Transport; Wed, 1 Nov 2023 04:45:22 +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 CY4PEPF0000E9CE.mail.protection.outlook.com (10.167.241.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19 via Frontend Transport; Wed, 1 Nov 2023 04:45:21 +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 21:45:09 -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 21:45:07 -0700 From: Rongwei Liu To: , , , , , CC: Erez Shitrit Subject: [PATCH v4 13/13] net/mlx5/hws: add stc reparse support for srv6 push pop Date: Wed, 1 Nov 2023 06:44:19 +0200 Message-ID: <20231101044419.732726-14-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231101044419.732726-1-rongweil@nvidia.com> References: <20231031105131.441078-1-rongweil@nvidia.com> <20231101044419.732726-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CE:EE_|MN0PR12MB6174:EE_ X-MS-Office365-Filtering-Correlation-Id: 155b9a85-ac4b-4e82-731e-08dbda955b67 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: dk4MldTObgKH3pf/6O0roumlYfDRfWYcIPeXwhcXzZhnXyptXWPrfbRCNuKxCeVbsJgIiMoJ7q5CIE5tACvZ6uqfB4E86FWlqRVDWEWnFluYfQQIUZU0j0u/ofnYl6Y/8oe4KxXCJ7COpKHoQcfP3XXxQKcDtuhVSbV/78KRXOGQLJ4t0RBKaQmr0lsMTaaaBPMn+W+291sgM5fNGNG7Wim6HlKSvZXS/Di4oNPWiSQU97GUDNDwQyfSay/ZEed2ercvdygQJWHegRjkC7wqoen2AuNnfdMFSFejPxgdZg1AvmqhM/hkV+gwIaaBi+wsn366CoCbAvXznwC14e2QObYDN8Gv+KfRqLSYvTIrTYp+neqoNuf2xbcddvze+zP3vZVb+K/I1zudhhgS3eCn+S254XLRwR29NWWcb/+wFlT9kDivLb1VQyF9f9oFlgR7UmmxAvLjbtY/B19sMsqex+nnAPnjLduPyEAXnfToD66s3qdGf7p4SNQ9u+wtYRY1T1jStEX3MUj0KD1JBBowg3chG+pQrmaPQn8NKDp4BHQdrTz6fPVHa0UiuC9IpMYl6ENzctPr29sYYYOi0M2zj9S72x54Loc09CiCubbAZwzf4ZSMb1QBueqQFFbEshp+xmCzLDK4+O8pCfYckIZVZrZgg4ZbMmvMwFPNG6b3L2JU/V7u66rMkSv7tal3Ad1gs2wT2POGsrdQYP6hXnXf26YRUl9BV3lwSxS9kr+RqZtvNVsDdhUWaxlT9s4IR9XS10rXm/y7pOMCdlCrBqJbwU+ciax3XyaUPpx3koIxXSs= 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)(136003)(39860400002)(346002)(376002)(230922051799003)(230273577357003)(230173577357003)(186009)(64100799003)(451199024)(82310400011)(1800799009)(46966006)(36840700001)(40470700004)(7696005)(426003)(40480700001)(55016003)(336012)(83380400001)(6666004)(478600001)(40460700003)(86362001)(5660300002)(6286002)(107886003)(16526019)(36756003)(4326008)(2616005)(26005)(1076003)(8936002)(41300700001)(316002)(8676002)(356005)(2906002)(82740400003)(110136005)(30864003)(7636003)(36860700001)(70586007)(47076005)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 04:45:21.9983 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 155b9a85-ac4b-4e82-731e-08dbda955b67 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: CY4PEPF0000E9CE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6174 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 After pushing/popping srv6 into/from IPv6 packets, the checksum needs to be correct. In order to achieve this, there is a need to control each STE' reparse behavior(CX7 and above). Add two more flags enumeration definitions to allow external control of reparse property in stc. 1. Push a. 1st STE, insert header action, reparse ignored(default reparse always) b. 2nd STE, modify IPv6 protocol, reparse always as default. c. 3rd STE, modify header list, reparse always(default reparse ignored) 2. Pop a. 1st STE, modify header list, reparse always(default reparse ignored) b. 2nd STE, modify header list, reparse always(default reparse ignored) c. 3rd STE, modify IPv6 protocol, reparse ignored(default reparse always); remove header action, reparse always as default. For CX6Lx and CX6Dx, the reparse behavior is controlled by RTC as always. Only pop action can work well. Signed-off-by: Rongwei Liu Reviewed-by: Erez Shitrit Acked-by: Ori Kam --- drivers/net/mlx5/hws/mlx5dr_action.c | 115 +++++++++++++++++++-------- drivers/net/mlx5/hws/mlx5dr_action.h | 7 ++ 2 files changed, 87 insertions(+), 35 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 43a65bdfd1..862ee3e332 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -552,6 +552,7 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, case MLX5DR_ACTION_TYP_REFORMAT_TNL_L3_TO_L2: case MLX5DR_ACTION_TYP_MODIFY_HDR: attr->action_offset = MLX5DR_ACTION_OFFSET_DW6; + attr->reparse_mode = MLX5_IFC_STC_REPARSE_IGNORE; if (action->modify_header.require_reparse) attr->reparse_mode = MLX5_IFC_STC_REPARSE_ALWAYS; @@ -590,9 +591,12 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L2: case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L3: case MLX5DR_ACTION_TYP_INSERT_HEADER: + attr->reparse_mode = MLX5_IFC_STC_REPARSE_ALWAYS; + if (!action->reformat.require_reparse) + attr->reparse_mode = MLX5_IFC_STC_REPARSE_IGNORE; + attr->action_type = MLX5_IFC_STC_ACTION_TYPE_HEADER_INSERT; attr->action_offset = MLX5DR_ACTION_OFFSET_DW6; - attr->reparse_mode = MLX5_IFC_STC_REPARSE_ALWAYS; attr->insert_header.encap = action->reformat.encap; attr->insert_header.insert_anchor = action->reformat.anchor; attr->insert_header.arg_id = action->reformat.arg_obj->id; @@ -1301,7 +1305,7 @@ static int mlx5dr_action_handle_insert_with_ptr(struct mlx5dr_action *action, uint8_t num_of_hdrs, struct mlx5dr_action_reformat_header *hdrs, - uint32_t log_bulk_sz) + uint32_t log_bulk_sz, uint32_t reparse) { struct mlx5dr_devx_obj *arg_obj; size_t max_sz = 0; @@ -1338,6 +1342,11 @@ mlx5dr_action_handle_insert_with_ptr(struct mlx5dr_action *action, action[i].reformat.encap = 1; } + if (likely(reparse == MLX5DR_ACTION_STC_REPARSE_DEFAULT)) + action[i].reformat.require_reparse = true; + else if (reparse == MLX5DR_ACTION_STC_REPARSE_ON) + action[i].reformat.require_reparse = true; + ret = mlx5dr_action_create_stcs(&action[i], NULL); if (ret) { DR_LOG(ERR, "Failed to create stc for reformat"); @@ -1374,7 +1383,8 @@ mlx5dr_action_handle_l2_to_tunnel_l3(struct mlx5dr_action *action, ret = mlx5dr_action_handle_insert_with_ptr(action, num_of_hdrs, hdrs, - log_bulk_sz); + log_bulk_sz, + MLX5DR_ACTION_STC_REPARSE_DEFAULT); if (ret) goto put_shared_stc; @@ -1517,7 +1527,8 @@ mlx5dr_action_create_reformat_hws(struct mlx5dr_action *action, ret = mlx5dr_action_create_stcs(action, NULL); break; case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L2: - ret = mlx5dr_action_handle_insert_with_ptr(action, num_of_hdrs, hdrs, bulk_size); + ret = mlx5dr_action_handle_insert_with_ptr(action, num_of_hdrs, hdrs, bulk_size, + MLX5DR_ACTION_STC_REPARSE_DEFAULT); break; case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L3: ret = mlx5dr_action_handle_l2_to_tunnel_l3(action, num_of_hdrs, hdrs, bulk_size); @@ -1625,7 +1636,8 @@ static int mlx5dr_action_create_modify_header_hws(struct mlx5dr_action *action, uint8_t num_of_patterns, struct mlx5dr_action_mh_pattern *pattern, - uint32_t log_bulk_size) + uint32_t log_bulk_size, + uint32_t reparse) { struct mlx5dr_devx_obj *pat_obj, *arg_obj = NULL; struct mlx5dr_context *ctx = action->ctx; @@ -1659,8 +1671,12 @@ mlx5dr_action_create_modify_header_hws(struct mlx5dr_action *action, action[i].modify_header.num_of_patterns = num_of_patterns; action[i].modify_header.max_num_of_actions = max_mh_actions; action[i].modify_header.num_of_actions = num_actions; - action[i].modify_header.require_reparse = - mlx5dr_pat_require_reparse(pattern[i].data, num_actions); + + if (likely(reparse == MLX5DR_ACTION_STC_REPARSE_DEFAULT)) + action[i].modify_header.require_reparse = + mlx5dr_pat_require_reparse(pattern[i].data, num_actions); + else if (reparse == MLX5DR_ACTION_STC_REPARSE_ON) + action[i].modify_header.require_reparse = true; if (num_actions == 1) { pat_obj = NULL; @@ -1703,12 +1719,12 @@ mlx5dr_action_create_modify_header_hws(struct mlx5dr_action *action, return rte_errno; } -struct mlx5dr_action * -mlx5dr_action_create_modify_header(struct mlx5dr_context *ctx, - uint8_t num_of_patterns, - struct mlx5dr_action_mh_pattern *patterns, - uint32_t log_bulk_size, - uint32_t flags) +static struct mlx5dr_action * +mlx5dr_action_create_modify_header_reparse(struct mlx5dr_context *ctx, + uint8_t num_of_patterns, + struct mlx5dr_action_mh_pattern *patterns, + uint32_t log_bulk_size, + uint32_t flags, uint32_t reparse) { struct mlx5dr_action *action; int ret; @@ -1756,7 +1772,8 @@ mlx5dr_action_create_modify_header(struct mlx5dr_context *ctx, ret = mlx5dr_action_create_modify_header_hws(action, num_of_patterns, patterns, - log_bulk_size); + log_bulk_size, + reparse); if (ret) goto free_action; @@ -1767,6 +1784,17 @@ mlx5dr_action_create_modify_header(struct mlx5dr_context *ctx, return NULL; } +struct mlx5dr_action * +mlx5dr_action_create_modify_header(struct mlx5dr_context *ctx, + uint8_t num_of_patterns, + struct mlx5dr_action_mh_pattern *patterns, + uint32_t log_bulk_size, + uint32_t flags) +{ + return mlx5dr_action_create_modify_header_reparse(ctx, num_of_patterns, patterns, + log_bulk_size, flags, + MLX5DR_ACTION_STC_REPARSE_DEFAULT); +} static struct mlx5dr_devx_obj * mlx5dr_action_dest_array_process_reformat(struct mlx5dr_context *ctx, enum mlx5dr_action_type type, @@ -2007,12 +2035,12 @@ mlx5dr_action_create_dest_root(struct mlx5dr_context *ctx, return NULL; } -struct mlx5dr_action * -mlx5dr_action_create_insert_header(struct mlx5dr_context *ctx, - uint8_t num_of_hdrs, - struct mlx5dr_action_insert_header *hdrs, - uint32_t log_bulk_size, - uint32_t flags) +static struct mlx5dr_action * +mlx5dr_action_create_insert_header_reparse(struct mlx5dr_context *ctx, + uint8_t num_of_hdrs, + struct mlx5dr_action_insert_header *hdrs, + uint32_t log_bulk_size, + uint32_t flags, uint32_t reparse) { struct mlx5dr_action_reformat_header *reformat_hdrs; struct mlx5dr_action *action; @@ -2065,7 +2093,8 @@ mlx5dr_action_create_insert_header(struct mlx5dr_context *ctx, } ret = mlx5dr_action_handle_insert_with_ptr(action, num_of_hdrs, - reformat_hdrs, log_bulk_size); + reformat_hdrs, log_bulk_size, + reparse); if (ret) { DR_LOG(ERR, "Failed to create HWS reformat action"); goto free_reformat_hdrs; @@ -2082,6 +2111,18 @@ mlx5dr_action_create_insert_header(struct mlx5dr_context *ctx, return NULL; } +struct mlx5dr_action * +mlx5dr_action_create_insert_header(struct mlx5dr_context *ctx, + uint8_t num_of_hdrs, + struct mlx5dr_action_insert_header *hdrs, + uint32_t log_bulk_size, + uint32_t flags) +{ + return mlx5dr_action_create_insert_header_reparse(ctx, num_of_hdrs, hdrs, + log_bulk_size, flags, + MLX5DR_ACTION_STC_REPARSE_DEFAULT); +} + struct mlx5dr_action * mlx5dr_action_create_remove_header(struct mlx5dr_context *ctx, struct mlx5dr_action_remove_header_attr *attr, @@ -2175,8 +2216,9 @@ mlx5dr_action_create_pop_ipv6_route_ext_mhdr1(struct mlx5dr_action *action) pattern.data = cmd; pattern.sz = sizeof(cmd); - return mlx5dr_action_create_modify_header(action->ctx, 1, &pattern, - 0, action->flags); + return mlx5dr_action_create_modify_header_reparse(action->ctx, 1, &pattern, 0, + action->flags, + MLX5DR_ACTION_STC_REPARSE_ON); } static void * @@ -2222,8 +2264,9 @@ mlx5dr_action_create_pop_ipv6_route_ext_mhdr2(struct mlx5dr_action *action) pattern.data = cmd; pattern.sz = sizeof(cmd); - return mlx5dr_action_create_modify_header(action->ctx, 1, &pattern, - 0, action->flags); + return mlx5dr_action_create_modify_header_reparse(action->ctx, 1, &pattern, 0, + action->flags, + MLX5DR_ACTION_STC_REPARSE_ON); } static void * @@ -2249,8 +2292,9 @@ mlx5dr_action_create_pop_ipv6_route_ext_mhdr3(struct mlx5dr_action *action) pattern.data = (__be64 *)cmd; pattern.sz = sizeof(cmd); - return mlx5dr_action_create_modify_header(action->ctx, 1, &pattern, - 0, action->flags); + return mlx5dr_action_create_modify_header_reparse(action->ctx, 1, &pattern, 0, + action->flags, + MLX5DR_ACTION_STC_REPARSE_OFF); } static int @@ -2397,8 +2441,9 @@ mlx5dr_action_create_push_ipv6_route_ext(struct mlx5dr_action *action, insert_hdr.hdr.sz = hdr->sz; insert_hdr.hdr.data = header; action->ipv6_route_ext.action[0] = - mlx5dr_action_create_insert_header(action->ctx, 1, &insert_hdr, - bulk_size, action->flags); + mlx5dr_action_create_insert_header_reparse(action->ctx, 1, &insert_hdr, + bulk_size, action->flags, + MLX5DR_ACTION_STC_REPARSE_OFF); action->ipv6_route_ext.action[1] = mlx5dr_action_create_push_ipv6_route_ext_mhdr1(action); action->ipv6_route_ext.action[2] = @@ -2431,12 +2476,6 @@ mlx5dr_action_create_reformat_ipv6_ext(struct mlx5dr_context *ctx, struct mlx5dr_action *action; int ret; - if (mlx5dr_context_cap_dynamic_reparse(ctx)) { - DR_LOG(ERR, "IPv6 extension actions is not supported"); - rte_errno = ENOTSUP; - return NULL; - } - if (!mlx5dr_action_is_hws_flags(flags) || ((flags & MLX5DR_ACTION_FLAG_SHARED) && log_bulk_size)) { DR_LOG(ERR, "IPv6 extension flags don't fit HWS (flags: 0x%x)", flags); @@ -2461,6 +2500,12 @@ mlx5dr_action_create_reformat_ipv6_ext(struct mlx5dr_context *ctx, ret = mlx5dr_action_create_pop_ipv6_route_ext(action); break; case MLX5DR_ACTION_TYP_PUSH_IPV6_ROUTE_EXT: + if (!mlx5dr_context_cap_dynamic_reparse(ctx)) { + DR_LOG(ERR, "IPv6 routing extension push actions is not supported"); + rte_errno = ENOTSUP; + goto free_action; + } + ret = mlx5dr_action_create_push_ipv6_route_ext(action, hdr, log_bulk_size); break; default: diff --git a/drivers/net/mlx5/hws/mlx5dr_action.h b/drivers/net/mlx5/hws/mlx5dr_action.h index c12d4308c7..fad35a845b 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.h +++ b/drivers/net/mlx5/hws/mlx5dr_action.h @@ -62,6 +62,12 @@ enum mlx5dr_action_setter_flag { ASF_HIT = 1 << 7, }; +enum mlx5dr_action_stc_reparse { + MLX5DR_ACTION_STC_REPARSE_DEFAULT, + MLX5DR_ACTION_STC_REPARSE_ON, + MLX5DR_ACTION_STC_REPARSE_OFF, +}; + struct mlx5dr_action_default_stc { struct mlx5dr_pool_chunk nop_ctr; struct mlx5dr_pool_chunk nop_dw5; @@ -141,6 +147,7 @@ struct mlx5dr_action { uint8_t anchor; uint8_t offset; bool encap; + uint8_t require_reparse; } reformat; struct { struct mlx5dr_action -- 2.27.0