patch 'net/mlx5: fix send to kernel action resources release' has been queued to stable release 22.11.11
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 20 13:44:44 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.11
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/22/25. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f3ede4f9c5bb71153557a7b0fc3687f0843e3ed6
Thanks.
Luca Boccassi
---
>From f3ede4f9c5bb71153557a7b0fc3687f0843e3ed6 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Wed, 12 Nov 2025 18:24:40 +0200
Subject: [PATCH] net/mlx5: fix send to kernel action resources release
[ upstream commit 472b0994319198090e44a7c2de1e43f0a0e0a270 ]
In the MLX5 PMD hierarchy a flow table is bound to a domain object.
A domain object can be released if it does not reference any flow
tables.
When the PMD creates a send to kernel flow action, it also creates
a dedicated flow table for that action.
The PMD called for Rx, Tx and FDB domain destruction before it
destroyed send to kernel resources - flow action and flow table.
As a result, domain destruction could not be completed.
The patch moves send to kernel actions and tables destruction before
domain destruction.
Fixes: f31a141e6478 ("net/mlx5: add send to kernel action resource holder")
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/linux/mlx5_os.c | 82 ++++++++++++++++++--------------
1 file changed, 45 insertions(+), 37 deletions(-)
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 028b9adece..49f2653169 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -705,44 +705,10 @@ error:
return err;
}
-/**
- * Destroy DR related data within private structure.
- *
- * @param[in] priv
- * Pointer to the private device data structure.
- */
-void
-mlx5_os_free_shared_dr(struct mlx5_priv *priv)
-{
- struct mlx5_dev_ctx_shared *sh = priv->sh;
-
- MLX5_ASSERT(sh && sh->refcnt);
- if (sh->refcnt > 1)
- return;
- MLX5_ASSERT(LIST_EMPTY(&sh->shared_rxqs));
#ifdef HAVE_MLX5DV_DR
- if (sh->rx_domain) {
- mlx5_glue->dr_destroy_domain(sh->rx_domain);
- sh->rx_domain = NULL;
- }
- if (sh->tx_domain) {
- mlx5_glue->dr_destroy_domain(sh->tx_domain);
- sh->tx_domain = NULL;
- }
-#ifdef HAVE_MLX5DV_DR_ESWITCH
- if (sh->fdb_domain) {
- mlx5_glue->dr_destroy_domain(sh->fdb_domain);
- sh->fdb_domain = NULL;
- }
- if (sh->dr_drop_action) {
- mlx5_glue->destroy_flow_action(sh->dr_drop_action);
- sh->dr_drop_action = NULL;
- }
-#endif
- if (sh->pop_vlan_action) {
- mlx5_glue->destroy_flow_action(sh->pop_vlan_action);
- sh->pop_vlan_action = NULL;
- }
+static void
+mlx5_destroy_send_to_kernel_action(struct mlx5_dev_ctx_shared *sh)
+{
if (sh->send_to_kernel_action.action) {
void *action = sh->send_to_kernel_action.action;
@@ -756,6 +722,48 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
flow_dv_tbl_resource_release(sh, tbl);
sh->send_to_kernel_action.tbl = NULL;
}
+}
+#endif /* HAVE_MLX5DV_DR */
+
+/**
+ * Destroy DR related data within private structure.
+ *
+ * @param[in] priv
+ * Pointer to the private device data structure.
+ */
+void
+mlx5_os_free_shared_dr(struct mlx5_priv *priv)
+{
+ struct mlx5_dev_ctx_shared *sh = priv->sh;
+
+ MLX5_ASSERT(sh && sh->refcnt);
+ if (sh->refcnt > 1)
+ return;
+ MLX5_ASSERT(LIST_EMPTY(&sh->shared_rxqs));
+#ifdef HAVE_MLX5DV_DR
+ mlx5_destroy_send_to_kernel_action(sh);
+ if (sh->rx_domain) {
+ mlx5_glue->dr_destroy_domain(sh->rx_domain);
+ sh->rx_domain = NULL;
+ }
+ if (sh->tx_domain) {
+ mlx5_glue->dr_destroy_domain(sh->tx_domain);
+ sh->tx_domain = NULL;
+ }
+#ifdef HAVE_MLX5DV_DR_ESWITCH
+ if (sh->fdb_domain) {
+ mlx5_glue->dr_destroy_domain(sh->fdb_domain);
+ sh->fdb_domain = NULL;
+ }
+ if (sh->dr_drop_action) {
+ mlx5_glue->destroy_flow_action(sh->dr_drop_action);
+ sh->dr_drop_action = NULL;
+ }
+#endif
+ if (sh->pop_vlan_action) {
+ mlx5_glue->destroy_flow_action(sh->pop_vlan_action);
+ sh->pop_vlan_action = NULL;
+ }
#endif /* HAVE_MLX5DV_DR */
if (sh->default_miss_action)
mlx5_glue->destroy_flow_action
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-11-20 12:44:13.222369943 +0000
+++ 0012-net-mlx5-fix-send-to-kernel-action-resources-release.patch 2025-11-20 12:44:12.786088177 +0000
@@ -1 +1 @@
-From 472b0994319198090e44a7c2de1e43f0a0e0a270 Mon Sep 17 00:00:00 2001
+From f3ede4f9c5bb71153557a7b0fc3687f0843e3ed6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 472b0994319198090e44a7c2de1e43f0a0e0a270 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -26,2 +27,2 @@
- drivers/net/mlx5/linux/mlx5_os.c | 40 ++++++++++++++++++++------------
- 1 file changed, 25 insertions(+), 15 deletions(-)
+ drivers/net/mlx5/linux/mlx5_os.c | 82 ++++++++++++++++++--------------
+ 1 file changed, 45 insertions(+), 37 deletions(-)
@@ -30 +31 @@
-index dba3b61b68..8026a68702 100644
+index 028b9adece..49f2653169 100644
@@ -33 +34 @@
-@@ -737,6 +737,30 @@ error:
+@@ -705,44 +705,10 @@ error:
@@ -37 +38,38 @@
-+#ifdef HAVE_MLX5DV_DR
+-/**
+- * Destroy DR related data within private structure.
+- *
+- * @param[in] priv
+- * Pointer to the private device data structure.
+- */
+-void
+-mlx5_os_free_shared_dr(struct mlx5_priv *priv)
+-{
+- struct mlx5_dev_ctx_shared *sh = priv->sh;
+-
+- MLX5_ASSERT(sh && sh->refcnt);
+- if (sh->refcnt > 1)
+- return;
+- MLX5_ASSERT(LIST_EMPTY(&sh->shared_rxqs));
+ #ifdef HAVE_MLX5DV_DR
+- if (sh->rx_domain) {
+- mlx5_glue->dr_destroy_domain(sh->rx_domain);
+- sh->rx_domain = NULL;
+- }
+- if (sh->tx_domain) {
+- mlx5_glue->dr_destroy_domain(sh->tx_domain);
+- sh->tx_domain = NULL;
+- }
+-#ifdef HAVE_MLX5DV_DR_ESWITCH
+- if (sh->fdb_domain) {
+- mlx5_glue->dr_destroy_domain(sh->fdb_domain);
+- sh->fdb_domain = NULL;
+- }
+- if (sh->dr_drop_action) {
+- mlx5_glue->destroy_flow_action(sh->dr_drop_action);
+- sh->dr_drop_action = NULL;
+- }
+-#endif
+- if (sh->pop_vlan_action) {
+- mlx5_glue->destroy_flow_action(sh->pop_vlan_action);
+- sh->pop_vlan_action = NULL;
+- }
@@ -41,17 +79,7 @@
-+ int i;
-+
-+ for (i = 0; i < MLX5DR_TABLE_TYPE_MAX; i++) {
-+ if (sh->send_to_kernel_action[i].action) {
-+ void *action = sh->send_to_kernel_action[i].action;
-+
-+ mlx5_glue->destroy_flow_action(action);
-+ sh->send_to_kernel_action[i].action = NULL;
-+ }
-+ if (sh->send_to_kernel_action[i].tbl) {
-+ struct mlx5_flow_tbl_resource *tbl =
-+ sh->send_to_kernel_action[i].tbl;
-+
-+ flow_dv_tbl_resource_release(sh, tbl);
-+ sh->send_to_kernel_action[i].tbl = NULL;
-+ }
-+ }
+ if (sh->send_to_kernel_action.action) {
+ void *action = sh->send_to_kernel_action.action;
+
+@@ -756,6 +722,48 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
+ flow_dv_tbl_resource_release(sh, tbl);
+ sh->send_to_kernel_action.tbl = NULL;
+ }
@@ -61,7 +89,16 @@
- /**
- * Destroy DR related data within private structure.
- *
-@@ -763,6 +787,7 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
- priv->dev_data->port_id, i);
- MLX5_ASSERT(LIST_EMPTY(&sh->shared_rxqs));
- #ifdef HAVE_MLX5DV_DR
++/**
++ * Destroy DR related data within private structure.
++ *
++ * @param[in] priv
++ * Pointer to the private device data structure.
++ */
++void
++mlx5_os_free_shared_dr(struct mlx5_priv *priv)
++{
++ struct mlx5_dev_ctx_shared *sh = priv->sh;
++
++ MLX5_ASSERT(sh && sh->refcnt);
++ if (sh->refcnt > 1)
++ return;
++ MLX5_ASSERT(LIST_EMPTY(&sh->shared_rxqs));
++#ifdef HAVE_MLX5DV_DR
@@ -69,22 +106,22 @@
- if (sh->rx_domain) {
- mlx5_glue->dr_destroy_domain(sh->rx_domain);
- sh->rx_domain = NULL;
-@@ -785,21 +810,6 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv)
- mlx5_glue->destroy_flow_action(sh->pop_vlan_action);
- sh->pop_vlan_action = NULL;
- }
-- for (i = 0; i < MLX5DR_TABLE_TYPE_MAX; i++) {
-- if (sh->send_to_kernel_action[i].action) {
-- void *action = sh->send_to_kernel_action[i].action;
--
-- mlx5_glue->destroy_flow_action(action);
-- sh->send_to_kernel_action[i].action = NULL;
-- }
-- if (sh->send_to_kernel_action[i].tbl) {
-- struct mlx5_flow_tbl_resource *tbl =
-- sh->send_to_kernel_action[i].tbl;
--
-- flow_dv_tbl_resource_release(sh, tbl);
-- sh->send_to_kernel_action[i].tbl = NULL;
-- }
-- }
++ if (sh->rx_domain) {
++ mlx5_glue->dr_destroy_domain(sh->rx_domain);
++ sh->rx_domain = NULL;
++ }
++ if (sh->tx_domain) {
++ mlx5_glue->dr_destroy_domain(sh->tx_domain);
++ sh->tx_domain = NULL;
++ }
++#ifdef HAVE_MLX5DV_DR_ESWITCH
++ if (sh->fdb_domain) {
++ mlx5_glue->dr_destroy_domain(sh->fdb_domain);
++ sh->fdb_domain = NULL;
++ }
++ if (sh->dr_drop_action) {
++ mlx5_glue->destroy_flow_action(sh->dr_drop_action);
++ sh->dr_drop_action = NULL;
++ }
++#endif
++ if (sh->pop_vlan_action) {
++ mlx5_glue->destroy_flow_action(sh->pop_vlan_action);
++ sh->pop_vlan_action = NULL;
++ }
More information about the stable
mailing list