From: Shun Hao Date: Thu, 14 Apr 2022 07:55:20 +0000 (+0300) Subject: net/mlx5: fix no-green metering with RSS X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fc7211097d41957bd6e29d64fd42ce679b4147b8;p=dpdk.git net/mlx5: fix no-green metering with RSS 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. Fixes: b38a12272b3a ("net/mlx5: split meter color policy handling") Cc: stable@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index cb5006bb11..f9c56204c4 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -17054,7 +17054,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;