From 7e275590e51019b5b34b86c54b0d126523da93ae Mon Sep 17 00:00:00 2001 From: Xiaoyu Min Date: Tue, 18 Jan 2022 19:38:50 +0800 Subject: [PATCH] net/mlx5: reject jump to root table [ upstream commit 87b26522f7ff65375fb1d773a7f93c70bf857b96 ] 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: f78f747f41d0 ("net/mlx5: allow jump to group lower than current") Signed-off-by: Xiaoyu Min Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index e16a98be3b..6f0876f233 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3487,7 +3487,7 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action, 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; if (action_flags & (MLX5_FLOW_FATE_ACTIONS | @@ -3515,6 +3515,10 @@ flow_dv_validate_action_jump(const struct rte_flow_action *action, 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; }