net/mlx5: fix quit assert when no meter green action
PATCH 1/1 net/mlx5: fix quit assert when no meter green action
When a meter with RSS action being used, there might be several sub-flows using different sub-policies in the flow splitting stage. If there's no green action, there's an error that will always use the same sub-policy for all sub-flows, some resources will be overwritten and cannot be released, leading assert during port close.
This patch fixes this issue by checking both green and yellow queue index during getting a blank sub-policy, to avoid the incorrect resource overwrite.
--- drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +2 -1
@@ -17051,7 +17051,8 @@ __flow_dv_meter_get_rss_sub_policy(struct rte_eth_dev *dev, } }/* Create sub policy. */ -if (!mtr_policy->sub_policys[domain][0 ]->rix_hrxq[0 ]) { +if (!mtr_policy->sub_policys[domain][0 ]->rix_hrxq[RTE_COLOR_GREEN ] && + !mtr_policy->sub_policys[domain][0 ]->rix_hrxq[RTE_COLOR_YELLOW ]) {/* Reuse the first pre-allocated sub_policy. */ sub_policy = mtr_policy->sub_policys[domain][0 ]; sub_policy_idx = sub_policy->idx;
Signature · 1 line
2.20.0
Hi,
Quoted 20 lines
-----Original Message-----
From: Shun Hao <[email protected]>
Sent: Thursday, April 14, 2022 10:55 AM
To: Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Ori Kam <[email protected]>; Bing Zhao <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; [email protected]
Subject: [PATCH v1] net/mlx5: fix quit assert when no meter green actionWhen a meter with RSS action being used, there might be several sub-flows using different sub-policies in the flow splitting stage. If there's no green action, there's an error that will always use the same sub-policy for all sub-flows, some resources will be overwritten and cannot be released, leading assert during port close.
This patch fixes this issue by checking both green and yellow queue index during getting a blank sub-policy, to avoid the incorrect resource overwrite.
Quoted 5 lines
Fixes b38a12272b3a ("net/mlx5: split meter color policy handling")Signed-off-by Shun Hao <[email protected]>Acked-by Matan Azard <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh