From: Xiaoyu Min Date: Tue, 18 Jan 2022 11:38:50 +0000 (+0800) Subject: net/mlx5: reject jump to root table X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=87b26522f7ff65375fb1d773a7f93c70bf857b96;p=dpdk.git net/mlx5: reject jump to root table 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") Cc: stable@dpdk.org Signed-off-by: Xiaoyu Min Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 18992b1e26..af90a7fd0a 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -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, @@ -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; }