Skip to content

Commit

Permalink
net/mlx5: fix decap action checking in sample flow
Browse files Browse the repository at this point in the history
[ upstream commit c40023aece2ec9a7899fafecf474d7337212776e ]

This patch uses the temp variable to check the current action type,
to avoid overlap the sample action following the decap.

Fixes: 7356aec ("net/mlx5: fix mirror flow split with L3 encapsulation")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
  • Loading branch information
jiaweiwsz authored and kevintraynor committed Nov 16, 2023
1 parent 97cf69e commit 9f2c545
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/net/mlx5/mlx5_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -5513,6 +5513,7 @@ flow_check_match_action(const struct rte_flow_action actions[],
{
const struct rte_flow_action_sample *sample;
const struct rte_flow_action_raw_decap *decap;
const struct rte_flow_action *action_cur = NULL;
int actions_n = 0;
uint32_t ratio = 0;
int sub_type = 0;
Expand Down Expand Up @@ -5573,12 +5574,12 @@ flow_check_match_action(const struct rte_flow_action actions[],
break;
case RTE_FLOW_ACTION_TYPE_RAW_DECAP:
decap = actions->conf;
while ((++actions)->type == RTE_FLOW_ACTION_TYPE_VOID)
action_cur = actions;
while ((++action_cur)->type == RTE_FLOW_ACTION_TYPE_VOID)
;
actions_n++;
if (actions->type == RTE_FLOW_ACTION_TYPE_RAW_ENCAP) {
if (action_cur->type == RTE_FLOW_ACTION_TYPE_RAW_ENCAP) {
const struct rte_flow_action_raw_encap *encap =
actions->conf;
action_cur->conf;
if (decap->size <=
MLX5_ENCAPSULATION_DECISION_SIZE &&
encap->size >
Expand Down

0 comments on commit 9f2c545

Please sign in to comment.