net/mlx5: fix Rx Hash queue resource release in sample flow

Message ID 20240520150709.39835-1-jiaweiw@nvidia.com (mailing list archive)
State Awaiting Upstream
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix Rx Hash queue resource release in sample flow |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-compile-amd64-testing success Testing PASS

Commit Message

Jiawei Wang May 20, 2024, 3:07 p.m. UTC
  While the queue/rss action was added to sample action lists,
the rx hash queue resource was allocated in the sample action
translation to create the sample DR action later.

While there's a failure in the flow creation, the Rx hash queue
resource of the sample action list was destroyed in the wrong place.

This patch adds the checking to release the Rx hash queue
resource after the sample action release, to avoid one more
extra release if there's a failure.

Fixes: ca5eb60ecd5b ("net/mlx5: fix resource release for mirror flow")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Dariusz Sosnowski May 21, 2024, 11:22 a.m. UTC | #1
> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Monday, May 20, 2024 17:07
> To: Bing Zhao <bingz@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>;
> Dariusz Sosnowski <dsosnowski@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix Rx Hash queue resource release in sample flow
> 
> While the queue/rss action was added to sample action lists, the rx hash queue
> resource was allocated in the sample action translation to create the sample DR
> action later.
> 
> While there's a failure in the flow creation, the Rx hash queue resource of the
> sample action list was destroyed in the wrong place.
> 
> This patch adds the checking to release the Rx hash queue resource after the
> sample action release, to avoid one more extra release if there's a failure.
> 
> Fixes: ca5eb60ecd5b ("net/mlx5: fix resource release for mirror flow")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Reviewed-by: Bing Zhao <bingz@nvidia.com>

Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

Best regards,
Dariusz Sosnowski
  
Raslan Darawsheh May 27, 2024, 11:37 a.m. UTC | #2
Hi,

From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
Sent: Monday, May 20, 2024 6:07 PM
To: Bing Zhao; Suanming Mou; Dariusz Sosnowski; Slava Ovsiienko; Ori Kam; Matan Azrad
Cc: dev@dpdk.org; Raslan Darawsheh; stable@dpdk.org
Subject: [PATCH] net/mlx5: fix Rx Hash queue resource release in sample flow

While the queue/rss action was added to sample action lists,
the rx hash queue resource was allocated in the sample action
translation to create the sample DR action later.

While there's a failure in the flow creation, the Rx hash queue
resource of the sample action list was destroyed in the wrong place.

This patch adds the checking to release the Rx hash queue
resource after the sample action release, to avoid one more
extra release if there's a failure.

Fixes: ca5eb60ecd5b ("net/mlx5: fix resource release for mirror flow")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index d434c678c8..16d5f68622 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -15656,7 +15656,8 @@  flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
 	SILIST_FOREACH(priv->sh->ipool[MLX5_IPOOL_MLX5_FLOW], flow->dev_handles,
 		       handle_idx, dh, next) {
 		/* hrxq is union, don't clear it if the flag is not set. */
-		if (dh->fate_action == MLX5_FLOW_FATE_QUEUE && dh->rix_hrxq) {
+		if (dh->fate_action == MLX5_FLOW_FATE_QUEUE && dh->rix_hrxq &&
+		    !dh->dvh.rix_sample && !dh->dvh.rix_dest_array) {
 			mlx5_hrxq_release(dev, dh->rix_hrxq);
 			dh->rix_hrxq = 0;
 		} else if (dh->fate_action == MLX5_FLOW_FATE_SHARED_RSS) {