Skip to content

Commit

Permalink
net/mlx5: fix jump action validation
Browse files Browse the repository at this point in the history
[ upstream commit 9c289272ae692bd03d1dc9726ef19785beedd313 ]

Currently PMD doesn't allow to jump to the same group in order to
avoid dead loop. But this also prevent experienced user to create
flow with less Hops in order to have better performance.

For example, rules in [1] should have better performance then [2].

Furthermore, this protection will not really prevent dead loop, i.e
[3]. So just remove this protection and user should take the
responsibility to avoid dead loop.

This patch enables jumping to the same group.

[1]:
flow create 0 group 1 priority 1 pattern eth / ipv4 / udp / gtp / end
actions raw_decap / raw_encap / jump group 1 / end
flow create 0 group 1 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
/ end actions queues index 1 / end

[2]:
flow create 0 group 1 priority 0 pattern eth / ipv4 / udp / gtp / end
actions raw_decap / raw_encap / jump group 2 / end
flow create 0 group 2 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
/ end actions queues index 1 / end

[3]:
flow create 0 group 1 pattern eth / end actions jump group 2 / end
flow create 0 group 2 pattern eth / end actions jump group 1 / end

Fixes: f78f747 ("net/mlx5: allow jump to group lower than current")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
michaelbaum1 authored and kevintraynor committed Mar 5, 2024
1 parent 79c2b50 commit 9fe858d
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/net/mlx5/mlx5_flow_dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4998,13 +4998,6 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
&grp_info, error);
if (ret)
return ret;
if (attributes->group == target_group &&
!(action_flags & (MLX5_FLOW_ACTION_TUNNEL_SET |
MLX5_FLOW_ACTION_TUNNEL_MATCH)))
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, NULL,
"target group must be other than"
" the current flow group");
if (table == 0)
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION_CONF,
Expand Down

0 comments on commit 9fe858d

Please sign in to comment.