patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix mlx5dr context release ordering
@ 2024-03-06  6:02 Maayan Kashani
  2024-03-13  7:44 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Maayan Kashani @ 2024-03-06  6:02 UTC (permalink / raw)
  To: dev
  Cc: mkashani, rasland, stable, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Ori Kam, Suanming Mou, Matan Azrad

Creating rules on group >0, creates a jump action on the group table.
Non template code releases the group data under shared mlx5dr free code,
And the mlx5dr context was already closed in HWS code.

Remove mlx5dr context release from hws resource release function.

Fixes: b401400db24e ("net/mlx5: add port flow configuration")
Cc: stable@dpdk.org
Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5.c         | 7 +++++++
 drivers/net/mlx5/mlx5_flow_hw.c | 2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 39dc1830d1..8b54843a43 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2355,6 +2355,7 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 	mlx5_indirect_list_handles_release(dev);
 #ifdef HAVE_MLX5_HWS_SUPPORT
 	flow_hw_destroy_vport_action(dev);
+	/* dr context will be closed after mlx5_os_free_shared_dr. */
 	flow_hw_resource_release(dev);
 	flow_hw_clear_port_info(dev);
 	if (priv->tlv_options != NULL) {
@@ -2391,6 +2392,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 		mlx5_hlist_destroy(priv->mreg_cp_tbl);
 	mlx5_mprq_free_mp(dev);
 	mlx5_os_free_shared_dr(priv);
+#ifdef HAVE_MLX5_HWS_SUPPORT
+	if (priv->dr_ctx) {
+		claim_zero(mlx5dr_context_close(priv->dr_ctx));
+		priv->dr_ctx = NULL;
+	}
+#endif
 	if (priv->rss_conf.rss_key != NULL)
 		mlx5_free(priv->rss_conf.rss_key);
 	if (priv->reta_idx != NULL)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 4216433c6e..f52093a59a 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -10707,13 +10707,11 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
 	}
 	mlx5_free(priv->hw_q);
 	priv->hw_q = NULL;
-	claim_zero(mlx5dr_context_close(priv->dr_ctx));
 	if (priv->shared_host) {
 		struct mlx5_priv *host_priv = priv->shared_host->data->dev_private;
 		__atomic_fetch_sub(&host_priv->shared_refcnt, 1, __ATOMIC_RELAXED);
 		priv->shared_host = NULL;
 	}
-	priv->dr_ctx = NULL;
 	mlx5_free(priv->hw_attr);
 	priv->hw_attr = NULL;
 	priv->nb_queue = 0;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] net/mlx5: fix mlx5dr context release ordering
  2024-03-06  6:02 [PATCH] net/mlx5: fix mlx5dr context release ordering Maayan Kashani
@ 2024-03-13  7:44 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2024-03-13  7:44 UTC (permalink / raw)
  To: Maayan Kashani, dev
  Cc: stable, Dariusz Sosnowski, Slava Ovsiienko, Ori Kam,
	Suanming Mou, Matan Azrad

Hi,

> -----Original Message-----
> From: Maayan Kashani <mkashani@nvidia.com>
> Sent: Wednesday, March 6, 2024 8:02 AM
> To: dev@dpdk.org
> Cc: Maayan Kashani <mkashani@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; stable@dpdk.org; Dariusz Sosnowski
> <dsosnowski@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori
> Kam <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>; Matan
> Azrad <matan@nvidia.com>
> Subject: [PATCH] net/mlx5: fix mlx5dr context release ordering
> 
> Creating rules on group >0, creates a jump action on the group table.
> Non template code releases the group data under shared mlx5dr free code,
> And the mlx5dr context was already closed in HWS code.
> 
> Remove mlx5dr context release from hws resource release function.
> 
> Fixes: b401400db24e ("net/mlx5: add port flow configuration")
> Cc: stable@dpdk.org
> Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
> Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-13  7:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06  6:02 [PATCH] net/mlx5: fix mlx5dr context release ordering Maayan Kashani
2024-03-13  7:44 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).