summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
diff options
context:
space:
mode:
authorYevgeny Kliteynik <kliteyn@nvidia.com>2023-03-27 23:26:55 +0300
committerSaeed Mahameed <saeedm@nvidia.com>2023-04-14 15:06:21 -0700
commit608d4f1769d80824d0b02eca73243d377468ee68 (patch)
tree033a24222767afa8af68aa9309471a3a1670d51c /drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
parent17dc71c336aac381f59ba541cf85fb0c192d1c1c (diff)
net/mlx5: DR, Add modify header arg pool mechanism
Added new mechanism for handling arguments for modify-header action. The new action "accelerated modify-header" asks for the arguments from separated area from the pattern, this area accessed via general objects. Handling of these object is done via the pool-manager struct. When the new header patterns are supported, while loading the domain, a few pools for argument creations will be created. The requests for allocating/deallocating arg objects are done via the pool manager API. Signed-off-by: Muhammad Sammar <muhammads@nvidia.com> Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Reviewed-by: Alex Vesker <valex@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
index 7a0381572c4c..c4545daf179b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
@@ -26,7 +26,18 @@ static int dr_domain_init_modify_header_resources(struct mlx5dr_domain *dmn)
return -ENOMEM;
}
+ /* create argument pool */
+ dmn->arg_mgr = mlx5dr_arg_mgr_create(dmn);
+ if (!dmn->arg_mgr) {
+ mlx5dr_err(dmn, "Couldn't create arg_mgr\n");
+ goto free_modify_header_pattern;
+ }
+
return 0;
+
+free_modify_header_pattern:
+ mlx5dr_ptrn_mgr_destroy(dmn->ptrn_mgr);
+ return -ENOMEM;
}
static void dr_domain_destroy_modify_header_resources(struct mlx5dr_domain *dmn)
@@ -34,6 +45,7 @@ static void dr_domain_destroy_modify_header_resources(struct mlx5dr_domain *dmn)
if (!mlx5dr_domain_is_support_ptrn_arg(dmn))
return;
+ mlx5dr_arg_mgr_destroy(dmn->arg_mgr);
mlx5dr_ptrn_mgr_destroy(dmn->ptrn_mgr);
}