net/mlx5: fix mlx5dr context release ordering
PATCH 1/1 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.
--- drivers/net/mlx5/mlx5.c | 7 +++++++ drivers/net/mlx5/mlx5_flow_hw.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5.c +7 -0
@@ -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 )
drivers/net/mlx5/mlx5_flow_hw.c +0 -2
@@ -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 ;
Signature · 1 line
2.25.1
Hi,
Quoted 15 lines
-----Original Message-----
From: Maayan Kashani <[email protected]>
Sent: Wednesday, March 6, 2024 8:02 AM
To: [email protected]
Cc: Maayan Kashani <[email protected]>; Raslan Darawsheh <[email protected]>; [email protected]; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>
Subject: [PATCH] net/mlx5: fix mlx5dr context release orderingCreating 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.
Quoted 6 lines
Remove mlx5dr context release from hws resource release function.
Fixes b401400db24e ("net/mlx5: add port flow configuration")Signed-off-by Maayan Kashani <[email protected]>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh