summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
diff options
context:
space:
mode:
authorYevgeny Kliteynik <kliteyn@nvidia.com>2022-11-07 02:49:22 +0200
committerSaeed Mahameed <saeedm@nvidia.com>2023-04-14 15:06:22 -0700
commit0caebadda57b7f1740406b054ddff36cedf0bf39 (patch)
tree59f225997675cf3dd0756ce3fcbd8ac4b912dcb7 /drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
parent608d4f1769d80824d0b02eca73243d377468ee68 (diff)
net/mlx5: DR, Add modify header argument pointer to actions attributes
While building the actions, add the pointer of the arguments for accelerated modify list action into the action's attributes. This will be used later on while building the specific STE for this action. 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_ste_v1.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
index cf8508139f55..3d04ac08be77 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
@@ -2179,27 +2179,44 @@ dr_ste_v1_build_tnl_gtpu_flex_parser_1_init(struct mlx5dr_ste_build *sb,
int dr_ste_v1_alloc_modify_hdr_ptrn_arg(struct mlx5dr_action *action)
{
struct mlx5dr_ptrn_mgr *ptrn_mgr;
+ int ret;
ptrn_mgr = action->rewrite->dmn->ptrn_mgr;
if (!ptrn_mgr)
return -EOPNOTSUPP;
+ action->rewrite->arg = mlx5dr_arg_get_obj(action->rewrite->dmn->arg_mgr,
+ action->rewrite->num_of_actions,
+ action->rewrite->data);
+ if (!action->rewrite->arg) {
+ mlx5dr_err(action->rewrite->dmn, "Failed allocating args for modify header\n");
+ return -EAGAIN;
+ }
+
action->rewrite->ptrn =
mlx5dr_ptrn_cache_get_pattern(ptrn_mgr,
action->rewrite->num_of_actions,
action->rewrite->data);
if (!action->rewrite->ptrn) {
mlx5dr_err(action->rewrite->dmn, "Failed to get pattern\n");
- return -EAGAIN;
+ ret = -EAGAIN;
+ goto put_arg;
}
return 0;
+
+put_arg:
+ mlx5dr_arg_put_obj(action->rewrite->dmn->arg_mgr,
+ action->rewrite->arg);
+ return ret;
}
void dr_ste_v1_free_modify_hdr_ptrn_arg(struct mlx5dr_action *action)
{
mlx5dr_ptrn_cache_put_pattern(action->rewrite->dmn->ptrn_mgr,
action->rewrite->ptrn);
+ mlx5dr_arg_put_obj(action->rewrite->dmn->arg_mgr,
+ action->rewrite->arg);
}
static struct mlx5dr_ste_ctx ste_ctx_v1 = {