net/mlx5: fix masked indirect age action validation
PATCH 1/1 net/mlx5: fix masked indirect age action validation
Masked indirect age flow action is not supported in actions templates.
Up to this patch, this case was checked only through debug assertion. As a side effect, in a build without assertions, this lead to a segfault on the attempt to create
a table using actions template with masked indirect age action. To prevent the segfault, this patch adds relevant validation to actions template creation and removes the debug assertion which now becomes redundant.
--- drivers/net/mlx5/mlx5_flow_hw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/mlx5/mlx5_flow_hw.c +4 -4
@@ -1351,10 +1351,6 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,return -1 ; }break ; -case MLX5_INDIRECT_ACTION_TYPE_AGE : -/* Not supported, prevent by validate function. */ -MLX5_ASSERT (0 ); -break ;case MLX5_INDIRECT_ACTION_TYPE_CT :if (flow_hw_ct_compile (dev,MLX5_HW_INV_QUEUE , idx, &acts->rule_acts[action_dst])) {
@@ -6405,6 +6401,10 @@ flow_hw_validate_action_indirect(struct rte_eth_dev *dev, *action_flags |=MLX5_FLOW_ACTION_INDIRECT_COUNT ;break ;case RTE_FLOW_ACTION_TYPE_AGE : +if (action->conf && mask->conf) +return rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_ACTION , + action, +"Fixed indirect age action is not supported" ); ret =flow_hw_validate_action_age (dev, action, *action_flags, *fixed_cnt, error);if (ret <0 )
--
2.39.5
Hi,
Quoted 10 lines · Dariusz Sosnowski
Masked indirect age flow action is not supported in actions templates.
Up to this patch, this case was checked only through debug assertion. As a side effect, in a build without assertions, this lead to a segfault on the attempt to create
a table using actions template with masked indirect age action. To prevent the segfault, this patch adds relevant validation to actions template creation and removes the debug assertion which now becomes redundant.
Quoted 6 lines
Fixes 04a4de756e14 ("net/mlx5: support flow age action with HWS")Signed-off-by Dariusz Sosnowski <[email protected]>Acked-by Bing Zhao <[email protected]>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh