Skip to content

Commit

Permalink
net/mlx5: reject jump to root table
Browse files Browse the repository at this point in the history
[ upstream commit 87b2652 ]

Currently root table as destination is not supported.
The jump action which finally be translated to underlying root table in
rdma-core should be rejected.

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

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  • Loading branch information
jackmin authored and kevintraynor committed Feb 21, 2022
1 parent bc3452d commit 37d27ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/mlx5/mlx5_flow_dv.c
Expand Up @@ -4968,7 +4968,7 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
const struct rte_flow_attr *attributes,
bool external, struct rte_flow_error *error)
{
uint32_t target_group, table;
uint32_t target_group, table = 0;
int ret = 0;
struct flow_grp_info grp_info = {
.external = !!external,
Expand Down Expand Up @@ -4999,6 +4999,10 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
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,
NULL, "root table shouldn't be destination");
return 0;
}

Expand Down

0 comments on commit 37d27ab

Please sign in to comment.