Skip to content

Commit

Permalink
net/mlx5: DR, Support decap L3 action using pattern / arg mechanism
Browse files Browse the repository at this point in the history
Use the new accelerated action for decap L3 on RX side:
use the mechanism of pattern and argument same as in
modify-header action.

Signed-off-by: Erez Shitrit <erezsh@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>
  • Loading branch information
Yevgeny Kliteynik authored and Saeed Mahameed committed Apr 14, 2023
1 parent 62e40c8 commit 947e258
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,23 +1428,12 @@ dr_action_create_reformat_action(struct mlx5dr_domain *dmn,
return ret;
}

action->rewrite->chunk = mlx5dr_icm_alloc_chunk(dmn->action_icm_pool,
DR_CHUNK_SIZE_8);
if (!action->rewrite->chunk) {
mlx5dr_dbg(dmn, "Failed allocating modify header chunk\n");
return -ENOMEM;
}

action->rewrite->data = (void *)hw_actions;
action->rewrite->index = (mlx5dr_icm_pool_get_chunk_icm_addr
(action->rewrite->chunk) -
dmn->info.caps.hdr_modify_icm_addr) /
DR_ACTION_CACHE_LINE_SIZE;
action->rewrite->data = hw_actions;
action->rewrite->dmn = dmn;

ret = mlx5dr_send_postsend_action(dmn, action);
ret = mlx5dr_ste_alloc_modify_hdr(action);
if (ret) {
mlx5dr_dbg(dmn, "Writing decap l3 actions to ICM failed\n");
mlx5dr_icm_free_chunk(action->rewrite->chunk);
mlx5dr_dbg(dmn, "Failed preparing reformat data\n");
return ret;
}
return 0;
Expand Down Expand Up @@ -2161,7 +2150,7 @@ int mlx5dr_action_destroy(struct mlx5dr_action *action)
refcount_dec(&action->reformat->dmn->refcount);
break;
case DR_ACTION_TYP_TNL_L3_TO_L2:
mlx5dr_icm_free_chunk(action->rewrite->chunk);
mlx5dr_ste_free_modify_hdr(action);
refcount_dec(&action->rewrite->dmn->refcount);
break;
case DR_ACTION_TYP_L2_TO_TNL_L2:
Expand Down

0 comments on commit 947e258

Please sign in to comment.