From: Dekel Peled Date: Sun, 17 Jan 2021 09:40:45 +0000 (+0200) Subject: net/mlx5: fix flow split combined with age action X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=14ccfd2ed1686fa6bb42117b0461be278816eca6;p=dpdk.git net/mlx5: fix flow split combined with age action Currently, for a flow containing an age action, if flow is split to sub-flows, a new age action will be created for each sub-flow. However only the action created for the last sub-flow will be queried on flow query and cleared on flow removal. This behavior is wrong, causing a leak of resources. Need to create just one action per flow, and use it for all sub-flows. This patch adds the required check to make sure an age action is created just once per flow, and used by all sub-flows. Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 012d5893ba..f32d6c12df 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -10344,14 +10344,22 @@ flow_dv_translate(struct rte_eth_dev *dev, break; case RTE_FLOW_ACTION_TYPE_AGE: if (priv->sh->flow_hit_aso_en && attr->group) { - flow->age = flow_dv_translate_create_aso_age - (dev, action->conf, error); - if (!flow->age) - return rte_flow_error_set + /* + * Create one shared age action, to be used + * by all sub-flows. + */ + if (!flow->age) { + flow->age = + flow_dv_translate_create_aso_age + (dev, action->conf, + error); + if (!flow->age) + return rte_flow_error_set (error, rte_errno, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "can't create ASO age action"); + } dev_flow->dv.actions[actions_n++] = (flow_aso_age_get_by_idx (dev, flow->age))->dr_action;