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 01E3E427E2; Mon, 20 Mar 2023 15:13:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D10F640A7F; Mon, 20 Mar 2023 15:13:11 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2047.outbound.protection.outlook.com [40.107.95.47]) by mails.dpdk.org (Postfix) with ESMTP id 257BA406BC for ; Mon, 20 Mar 2023 15:13:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IXbK/XisDjk+g3y91GbZHqqjUx+v4QQzJdQPd/IQkhvpsYo6MW9VD+0qeSCznB9DhPDX3xCrKVtfLGaQVsUMzt16pQb9uFw8H6suUdBGC1L3uf9dvF22dZdTcVJrvGMSNaHyjkIj+IMxCaTfgbQd2v9Cm0nM89otCTTgr1Rn8OSFYS81x6PVWZPL/qMtXi7r9KaPsTobfse7UgDhMG8eVziTaw14QhcUoYgtpUgQ9nFMyNsTnkpIBgw0HAnruNnR7EFDLkwUKDrnZsr+0N1xee8sffjZdPuorCXxU8OW7jYsXP4tBe+6bI9ayL7/BvHChGI0lD7y4lOqml5f02EVDg== 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=3WmEIGwL3vLo4JxXi4jnWNTDqgUH0WN5cpYzahd+ZpU=; b=hZSN/DpSCHvqtWGHtD8bSui4Bv7LYKUaPhfC5AMsrUfrWbY4GEl0jnmWi3cWtdoDv191Fo1k/LrQgyqHI9TUqHHOEZDH7j8cHrViNQvYS9BVzVBE4A/1RFC+m3wsnBDSLqMreZWP/Ug2j3bLbNjiylCPyj7+DNtFLL8NgIvJFnJwjIPV/CYXqpjfppHRJrbeW9olGA1ksClPKOErIBwB6D1o6nP7ojydrNHoXrX9Oa9CUGAjOJplJUPV461dZ58+pbe7DPZOb+eyfsMab8kiJyJJrUCjKXeGxWxJ7WRkRTfHmweJDKDC1xSE2eSDvISmdU1B9pvDmN9AAHSvyHvxoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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 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=3WmEIGwL3vLo4JxXi4jnWNTDqgUH0WN5cpYzahd+ZpU=; b=guz2oh2+vdt8Rt0tyOGzOhIM+CRriNicLkNOBX8nBjyn5gQKVMuq5fXq2ckrXg8V6XRlSQnTYd/vwRb5NIyeRTbDfv8ynhbKb+HNRHleGkwisTxyASmRDIpa78KIkmFp6RjXdvJUOiMGlhUh6Q5EEh3PZ/IMa9uWBTn97gi/KGI8k6SlRiy01CNvHEsYFZAuHc6+usBejPCDQHiPPR6mOnXL5ojFoGilSwmW29SBliaQsLg/iuvd0pqtjmExYx9bBTWM2WOPQkEtU2xb5OASiuEzXC28SIMWpU8tPR+WIgk/ellGL3dMBSj401fzKMvj0/sSgN1TZ6slZ1AVq8T2IQ== Received: from MW4P221CA0021.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::26) by CH3PR12MB8878.namprd12.prod.outlook.com (2603:10b6:610:17e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:13:08 +0000 Received: from CO1NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::33) by MW4P221CA0021.outlook.office365.com (2603:10b6:303:8b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37 via Frontend Transport; Mon, 20 Mar 2023 14:13:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT004.mail.protection.outlook.com (10.13.175.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.15 via Frontend Transport; Mon, 20 Mar 2023 14:13:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 20 Mar 2023 07:12:59 -0700 Received: from nvidia.com (10.126.231.37) 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.37; Mon, 20 Mar 2023 07:12:56 -0700 From: Hamdan Igbaria To: , , , , Matan Azrad CC: , , Subject: [v1 1/3] net/mlx5/hws: support dest root table action Date: Mon, 20 Mar 2023 16:12:26 +0200 Message-ID: <20230320141229.104748-1-hamdani@nvidia.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] 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: CO1NAM11FT004:EE_|CH3PR12MB8878:EE_ X-MS-Office365-Filtering-Correlation-Id: 314b6b3c-a948-4e89-9c62-08db294d3ae5 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: QCPatWsALJW+pjQu56Wkxq3U24rlZwQRSLMN43uCgT5W8cVwTBi/A4LbF/X31quwmlZrsSs8E+7QhPJSuoKNFUpj1fS0s7qSn6Hl/ZtlMP6HqyYeFG3egr/9G29W0+fIzWL0VuBFz48zCC3xLnMK3SCGa4LhT0QYreYmIFfthTj1WJQpdSD3GBzsW3gvwcF10+EVsTkQWoZ0xCoJ+h60wvwUgnK2D6diqlZXVTXpr8te2bd/pR6TA8C/VOJ75dmvmgvUXU/1j3ywAmprzvWRBAqhMuAAyOM7Dou5UyjtzO6zVsjeqJoxKzy9k1V5p+08pFyHZTCpQa3Hr6SA1BTFzwkGnMOjMHL3XNYF3n7neqS6j4GIZkHmNiQTdUUJim7tj0Ba51NE6y25bs37Eg8oLJpuSisyDUFbbnTiQ1qhmcFXRuVYqSDCtSxAfimIODNQoGJn9yyA5zk7NbYIPeu1DXucoCNJH+Dcg6UvTHkznQSSfh/+4R0FTqG+aTEbgN3SMC6CuVM1NjyPqBl//aPBjGarYMm0bHhcrQUq62vrKRlC4FW1sghCMhocau31FKVJqa8kBo/ia2FfIvhe98worI7V+70MXawtm8YfEnZzt1pfSUY7prmijWDA05uthNnxXOV54j1m9NZTlSoIFp77Q5bjcegbWbzJP+Hk0x1I9VK5njZjxoHVqTVGw7KHsMCSMME7R3olShoQk8qNZlueTf5HFKHPTrB6jrkkKbVYuQfw/tQXRXy1KLuWtRH8gBLK X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(376002)(39860400002)(136003)(346002)(396003)(451199018)(40470700004)(46966006)(36840700001)(40460700003)(4326008)(110136005)(5660300002)(70586007)(70206006)(8676002)(41300700001)(54906003)(6636002)(478600001)(316002)(6666004)(8936002)(36860700001)(336012)(1076003)(107886003)(30864003)(26005)(186003)(83380400001)(7696005)(6286002)(16526019)(426003)(47076005)(82310400005)(2616005)(40480700001)(36756003)(86362001)(2906002)(82740400003)(7636003)(356005)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:13:07.9310 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 314b6b3c-a948-4e89-9c62-08db294d3ae5 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8878 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 Add support for dest root table action creation. This support will allow to redirect the packets to the kernel from non root tables. Signed-off-by: Hamdan Igbaria Reviewed-by: Alex Vesker --- drivers/common/mlx5/linux/meson.build | 2 + drivers/common/mlx5/linux/mlx5_glue.c | 28 +++++++++ drivers/common/mlx5/linux/mlx5_glue.h | 16 +++++ drivers/net/mlx5/hws/mlx5dr.h | 19 ++++++ drivers/net/mlx5/hws/mlx5dr_action.c | 84 +++++++++++++++++++++++++-- drivers/net/mlx5/hws/mlx5dr_action.h | 3 + drivers/net/mlx5/hws/mlx5dr_debug.c | 1 + 7 files changed, 147 insertions(+), 6 deletions(-) diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build index 96a6c6c9be..16d7011899 100644 --- a/drivers/common/mlx5/linux/meson.build +++ b/drivers/common/mlx5/linux/meson.build @@ -219,6 +219,8 @@ has_sym_args = [ 'ibv_import_device' ], [ 'HAVE_MLX5DV_DR_ACTION_CREATE_DEST_ROOT_TABLE', 'infiniband/mlx5dv.h', 'mlx5dv_dr_action_create_dest_root_table' ], + [ 'HAVE_MLX5DV_CREATE_STEERING_ANCHOR', 'infiniband/mlx5dv.h', + 'mlx5dv_create_steering_anchor'], ] if libmtcr_ul_found has_sym_args += [ diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c index 702eb36b62..3497aa940d 100644 --- a/drivers/common/mlx5/linux/mlx5_glue.c +++ b/drivers/common/mlx5/linux/mlx5_glue.c @@ -1548,6 +1548,32 @@ mlx5_glue_dr_create_flow_action_send_to_kernel(void *tbl, uint16_t priority) #endif } +static struct mlx5dv_steering_anchor * +mlx5_glue_dv_create_steering_anchor(struct ibv_context *context, + struct mlx5dv_steering_anchor_attr *attr) +{ +#ifdef HAVE_MLX5DV_CREATE_STEERING_ANCHOR + return mlx5dv_create_steering_anchor(context, attr); +#else + (void)context; + (void)attr; + errno = ENOTSUP; + return NULL; +#endif +} + +static int +mlx5_glue_dv_destroy_steering_anchor(struct mlx5dv_steering_anchor *sa) +{ +#ifdef HAVE_MLX5DV_CREATE_STEERING_ANCHOR + return mlx5dv_destroy_steering_anchor(sa); +#else + (void)sa; + errno = ENOTSUP; + return -ENOTSUP; +#endif +} + __rte_cache_aligned const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) { .version = MLX5_GLUE_VERSION, @@ -1685,4 +1711,6 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) { .dv_free_pp = mlx5_glue_dv_free_pp, .dr_create_flow_action_send_to_kernel = mlx5_glue_dr_create_flow_action_send_to_kernel, + .create_steering_anchor = mlx5_glue_dv_create_steering_anchor, + .destroy_steering_anchor = mlx5_glue_dv_destroy_steering_anchor, }; diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h index 88aa7430e8..81d6b0aaf9 100644 --- a/drivers/common/mlx5/linux/mlx5_glue.h +++ b/drivers/common/mlx5/linux/mlx5_glue.h @@ -148,6 +148,18 @@ struct mlx5dv_var { uint32_t page_id; uint32_t length; off_t mmap_off; #define IBV_ACCESS_RELAXED_ORDERING 0 #endif +#ifndef HAVE_MLX5DV_CREATE_STEERING_ANCHOR +struct mlx5dv_steering_anchor_attr { + uint32_t ft_type; + uint16_t priority; + uint64_t comp_mask; +}; + +struct mlx5dv_steering_anchor { + uint32_t id; +}; +#endif + struct mlx5_glue { const char *version; int (*fork_init)(void); @@ -392,6 +404,10 @@ struct mlx5_glue { uint32_t offset, uint32_t flags, uint8_t return_reg_c); void *(*dr_create_flow_action_send_to_kernel)(void *tbl, uint16_t priority); + struct mlx5dv_steering_anchor *(*create_steering_anchor) + (struct ibv_context *context, + struct mlx5dv_steering_anchor_attr *attr); + int (*destroy_steering_anchor)(struct mlx5dv_steering_anchor *sa); }; extern const struct mlx5_glue *mlx5_glue; diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h index 2b02884dc3..c14fef7a6b 100644 --- a/drivers/net/mlx5/hws/mlx5dr.h +++ b/drivers/net/mlx5/hws/mlx5dr.h @@ -45,6 +45,7 @@ enum mlx5dr_action_type { MLX5DR_ACTION_TYP_PUSH_VLAN, MLX5DR_ACTION_TYP_ASO_METER, MLX5DR_ACTION_TYP_ASO_CT, + MLX5DR_ACTION_TYP_DEST_ROOT_TABLE, MLX5DR_ACTION_TYP_MAX, }; @@ -565,6 +566,24 @@ mlx5dr_action_create_pop_vlan(struct mlx5dr_context *ctx, uint32_t flags); struct mlx5dr_action * mlx5dr_action_create_push_vlan(struct mlx5dr_context *ctx, uint32_t flags); +/* Create dest root table, this action will jump to root table according + * the given priority. + * @param[in] ctx + * The context in which the new action will be created. + * @param[in] tbl + * The root table to jump to. + * @param[in] priority + * The priority of matcher in the root table to jump to. + * @param[in] flags + * Action creation flags. (enum mlx5dr_action_flags). + * @return pointer to mlx5dr_action on success NULL otherwise. + */ +struct mlx5dr_action * +mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx, + struct mlx5dr_table *tbl, + uint16_t priority, + uint32_t flags); + /* Destroy direct rule action. * * @param[in] action diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 2db62635c1..9a408b0a1a 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -33,7 +33,8 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_ BIT(MLX5DR_ACTION_TYP_FT) | BIT(MLX5DR_ACTION_TYP_MISS) | BIT(MLX5DR_ACTION_TYP_TIR) | - BIT(MLX5DR_ACTION_TYP_DROP), + BIT(MLX5DR_ACTION_TYP_DROP) | + BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE), BIT(MLX5DR_ACTION_TYP_LAST), }, [MLX5DR_TABLE_TYPE_NIC_TX] = { @@ -49,7 +50,8 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_ BIT(MLX5DR_ACTION_TYP_L2_TO_TNL_L3), BIT(MLX5DR_ACTION_TYP_FT) | BIT(MLX5DR_ACTION_TYP_MISS) | - BIT(MLX5DR_ACTION_TYP_DROP), + BIT(MLX5DR_ACTION_TYP_DROP) | + BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE), BIT(MLX5DR_ACTION_TYP_LAST), }, [MLX5DR_TABLE_TYPE_FDB] = { @@ -68,7 +70,8 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_ BIT(MLX5DR_ACTION_TYP_FT) | BIT(MLX5DR_ACTION_TYP_MISS) | BIT(MLX5DR_ACTION_TYP_VPORT) | - BIT(MLX5DR_ACTION_TYP_DROP), + BIT(MLX5DR_ACTION_TYP_DROP) | + BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE), BIT(MLX5DR_ACTION_TYP_LAST), }, }; @@ -521,6 +524,11 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action, attr->action_offset = MLX5DR_ACTION_OFFSET_HIT; attr->dest_table_id = obj->id; break; + case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE: + attr->action_type = MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT; + attr->action_offset = MLX5DR_ACTION_OFFSET_HIT; + attr->dest_table_id = action->root_tbl.sa->id; + break; case MLX5DR_ACTION_TYP_TNL_L2_TO_L2: attr->action_type = MLX5_IFC_STC_ACTION_TYPE_HEADER_REMOVE; attr->action_offset = MLX5DR_ACTION_OFFSET_DW5; @@ -1172,12 +1180,12 @@ mlx5dr_action_conv_reformat_to_verbs(uint32_t action_type, static int mlx5dr_action_conv_flags_to_ft_type(uint32_t flags, enum mlx5dv_flow_table_type *ft_type) { - if (flags & MLX5DR_ACTION_FLAG_ROOT_RX) { + if (flags & (MLX5DR_ACTION_FLAG_ROOT_RX | MLX5DR_ACTION_FLAG_HWS_RX)) { *ft_type = MLX5DV_FLOW_TABLE_TYPE_NIC_RX; - } else if (flags & MLX5DR_ACTION_FLAG_ROOT_TX) { + } else if (flags & (MLX5DR_ACTION_FLAG_ROOT_TX | MLX5DR_ACTION_FLAG_HWS_TX)) { *ft_type = MLX5DV_FLOW_TABLE_TYPE_NIC_TX; #ifdef HAVE_MLX5DV_FLOW_MATCHER_FT_TYPE - } else if (flags & MLX5DR_ACTION_FLAG_ROOT_FDB) { + } else if (flags & (MLX5DR_ACTION_FLAG_ROOT_FDB | MLX5DR_ACTION_FLAG_HWS_FDB)) { *ft_type = MLX5DV_FLOW_TABLE_TYPE_FDB; #endif } else { @@ -1633,6 +1641,65 @@ mlx5dr_action_create_modify_header(struct mlx5dr_context *ctx, return NULL; } +struct mlx5dr_action * +mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx, + struct mlx5dr_table *tbl, + uint16_t priority, + uint32_t flags) +{ + struct mlx5dv_steering_anchor_attr attr = {0}; + struct mlx5dv_steering_anchor *sa; + struct mlx5dr_action *action; + int ret; + + if (mlx5dr_action_is_root_flags(flags)) { + DR_LOG(ERR, "Action flags must be only non root (HWS)"); + rte_errno = ENOTSUP; + return NULL; + } + + if (!mlx5dr_table_is_root(tbl)) { + DR_LOG(ERR, "Non root table cannot be set as destination"); + rte_errno = ENOTSUP; + return NULL; + } + + if (mlx5dr_context_shared_gvmi_used(ctx)) { + DR_LOG(ERR, "Cannot use this action in shared GVMI context"); + rte_errno = ENOTSUP; + return NULL; + } + + if (mlx5dr_action_conv_flags_to_ft_type(flags, &attr.ft_type)) + return NULL; + + attr.priority = priority; + + sa = mlx5_glue->create_steering_anchor(ctx->ibv_ctx, &attr); + if (!sa) { + DR_LOG(ERR, "Creation of steering anchor failed"); + return NULL; + } + + action = mlx5dr_action_create_generic(ctx, flags, MLX5DR_ACTION_TYP_DEST_ROOT_TABLE); + if (!action) + goto free_steering_anchor; + + action->root_tbl.sa = sa; + + ret = mlx5dr_action_create_stcs(action, NULL); + if (ret) + goto free_action; + + return action; + +free_action: + simple_free(action); +free_steering_anchor: + mlx5_glue->destroy_steering_anchor(sa); + return NULL; +} + static void mlx5dr_action_destroy_hws(struct mlx5dr_action *action) { switch (action->type) { @@ -1652,6 +1719,10 @@ static void mlx5dr_action_destroy_hws(struct mlx5dr_action *action) case MLX5DR_ACTION_TYP_PUSH_VLAN: mlx5dr_action_destroy_stcs(action); break; + case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE: + mlx5dr_action_destroy_stcs(action); + mlx5_glue->destroy_steering_anchor(action->root_tbl.sa); + break; case MLX5DR_ACTION_TYP_POP_VLAN: mlx5dr_action_destroy_stcs(action); mlx5dr_action_put_shared_stc(action, MLX5DR_CONTEXT_SHARED_STC_POP); @@ -2132,6 +2203,7 @@ int mlx5dr_action_template_process(struct mlx5dr_action_template *at) case MLX5DR_ACTION_TYP_DROP: case MLX5DR_ACTION_TYP_TIR: case MLX5DR_ACTION_TYP_FT: + case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE: case MLX5DR_ACTION_TYP_VPORT: case MLX5DR_ACTION_TYP_MISS: /* Hit action */ diff --git a/drivers/net/mlx5/hws/mlx5dr_action.h b/drivers/net/mlx5/hws/mlx5dr_action.h index 17619c0057..a85f3b0139 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.h +++ b/drivers/net/mlx5/hws/mlx5dr_action.h @@ -141,6 +141,9 @@ struct mlx5dr_action { struct { struct mlx5dr_devx_obj *devx_obj; } alias; + struct { + struct mlx5dv_steering_anchor *sa; + } root_tbl; }; }; diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c index 6b32ac4ee6..e29122aa98 100644 --- a/drivers/net/mlx5/hws/mlx5dr_debug.c +++ b/drivers/net/mlx5/hws/mlx5dr_debug.c @@ -22,6 +22,7 @@ const char *mlx5dr_debug_action_type_str[] = { [MLX5DR_ACTION_TYP_PUSH_VLAN] = "PUSH_VLAN", [MLX5DR_ACTION_TYP_ASO_METER] = "ASO_METER", [MLX5DR_ACTION_TYP_ASO_CT] = "ASO_CT", + [MLX5DR_ACTION_TYP_DEST_ROOT_TABLE] = "DEST_ROOT_TABLE", }; static_assert(ARRAY_SIZE(mlx5dr_debug_action_type_str) == MLX5DR_ACTION_TYP_MAX, -- 2.26.3