Skip to content

Commit

Permalink
ethdev: fix indirect action conversion
Browse files Browse the repository at this point in the history
[ upstream commit fb131e295ea838f062278fa63f21c89a4f080d21 ]

As indirect action conf fills the indirect action handler, while
converting indirect action, the action conf(action handler) should
be copied from original indirect action conf instead of duplicating
the action handler memory.

Fixes: 4b61b87 ("ethdev: introduce indirect flow action")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
  • Loading branch information
smou-mlnx authored and kevintraynor committed Jul 11, 2023
1 parent b374bc7 commit c11ee88
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/ethdev/rte_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,15 @@ rte_flow_conv_actions(struct rte_flow_action *dst,
src -= num;
dst -= num;
do {
if (src->conf) {
if (src->type == RTE_FLOW_ACTION_TYPE_INDIRECT) {
/*
* Indirect action conf fills the indirect action
* handler. Copy the action handle directly instead
* of duplicating the pointer memory.
*/
if (size)
dst->conf = src->conf;
} else if (src->conf) {
off = RTE_ALIGN_CEIL(off, sizeof(double));
ret = rte_flow_conv_action_conf
((void *)(data + off),
Expand Down

0 comments on commit c11ee88

Please sign in to comment.