Skip to contentSkip to conversation

net/mlx5: fix the timing of releasing drop action

PATCH In review Bing Zhao 2 participants 2 messages Mar 8, 2024 – Mar 13, 2024 Network drivers

lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH 1/1 net/mlx5: fix the timing of releasing drop action

When creating the drop action Devx object, the global counter set is also used as in the regular or hairpin queue creation.

The drop action should be destroyed before the global counter set release procedure. Or else, the counter set object is still referenced and cannot be released successfully. This would cause the counter set resources to be exhausted after starting and stopping the ports repeatedly.

Fixes 65b3cd0dc39b ("net/mlx5: create global drop action")
---
 drivers/net/mlx5/mlx5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5.c +2 -2
index 39dc1830d1..984eeb3709 100644
@@ -2381,12 +2381,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 		priv->txqs = NULL;
 	}
 	mlx5_proc_priv_uninit(dev);
+	if (priv->drop_queue.hrxq)
+		mlx5_drop_action_destroy(dev);
 	if (priv->q_counters) {
 		mlx5_devx_cmd_destroy(priv->q_counters);
 		priv->q_counters = NULL;
 	}
-	if (priv->drop_queue.hrxq)
-		mlx5_drop_action_destroy(dev);
 	if (priv->mreg_cp_tbl)
 		mlx5_hlist_destroy(priv->mreg_cp_tbl);
 	mlx5_mprq_free_mp(dev);
Signature · 1 line
2.34.1
#1 lore raw

Hi,

Quoted 18 lines

-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Friday, March 8, 2024 5:23 AM
To: Suanming Mou <[email protected]>; [email protected]; Raslan Darawsheh <[email protected]>
Cc: Ori Kam <[email protected]>; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix the timing of releasing drop action

When creating the drop action Devx object, the global counter set is also used as in the regular or hairpin queue creation.

The drop action should be destroyed before the global counter set release procedure. Or else, the counter set object is still referenced and cannot be released successfully. This would cause the counter set resources to be exhausted after starting and stopping the ports repeatedly.

Quoted 6 lines
Fixes 65b3cd0dc39b ("net/mlx5: create global drop action")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh