patches for DPDK stable branches
 help / color / mirror / Atom feed
From: luca.boccassi@gmail.com
To: Alexander Kozyrev <akozyrev@nvidia.com>
Cc: Dariusz Sosnowski <dsosnowski@nvidia.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'net/mlx5: break flow resource release loop' has been queued to stable release 22.11.6
Date: Tue, 25 Jun 2024 00:59:00 +0100	[thread overview]
Message-ID: <20240624235907.885628-74-luca.boccassi@gmail.com> (raw)
In-Reply-To: <20240624235907.885628-1-luca.boccassi@gmail.com>

Hi,

FYI, your patch has been queued to stable release 22.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/24. 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/68b68c76e1f2f9112d5016c732a00e97a0e5460f

Thanks.

Luca Boccassi

---
From 68b68c76e1f2f9112d5016c732a00e97a0e5460f Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Thu, 30 May 2024 00:46:32 +0300
Subject: [PATCH] net/mlx5: break flow resource release loop

[ upstream commit 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd ]

There is a loop inside the flow_hw_resource_release() function
that tries to free all the template patterns and tables until they
are successfully released. But some of the tables may be still in use
in case of the ungraceful application termination. Which causes the
forever loop in the app on the exit. Don't wait for the tables release
and try them to free only once and proceed with the exit.

Fixes: d1559d66ed2d ("net/mlx5: add table management")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 44 +++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 18 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 5333495a59..c902b35f0b 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -3407,7 +3407,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
 		return rte_flow_error_set(error, EBUSY,
 				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 				   NULL,
-				   "table in using");
+				   "table is in use");
 	}
 	LIST_REMOVE(table, next);
 	for (i = 0; i < table->nb_item_templates; i++)
@@ -4660,7 +4660,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev __rte_unused,
 		return rte_flow_error_set(error, EBUSY,
 				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 				   NULL,
-				   "action template in using");
+				   "action template is in use");
 	}
 	LIST_REMOVE(template, next);
 	if (template->tmpl)
@@ -5013,7 +5013,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev __rte_unused,
 		return rte_flow_error_set(error, EBUSY,
 				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 				   NULL,
-				   "item template in using");
+				   "item template is in use");
 	}
 	LIST_REMOVE(template, next);
 	claim_zero(mlx5dr_match_template_destroy(template->mt));
@@ -7458,9 +7458,9 @@ void
 flow_hw_resource_release(struct rte_eth_dev *dev)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
-	struct rte_flow_template_table *tbl;
-	struct rte_flow_pattern_template *it;
-	struct rte_flow_actions_template *at;
+	struct rte_flow_template_table *tbl, *temp_tbl;
+	struct rte_flow_pattern_template *it, *temp_it;
+	struct rte_flow_actions_template *at, *temp_at;
 	uint32_t i;
 
 	if (!priv->dr_ctx)
@@ -7470,21 +7470,29 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
 	flow_hw_cleanup_ctrl_fdb_tables(dev);
 	flow_hw_cleanup_tx_repr_tagging(dev);
 	flow_hw_cleanup_ctrl_rx_tables(dev);
-	while (!LIST_EMPTY(&priv->flow_hw_tbl_ongo)) {
-		tbl = LIST_FIRST(&priv->flow_hw_tbl_ongo);
-		flow_hw_table_destroy(dev, tbl, NULL);
+	tbl = LIST_FIRST(&priv->flow_hw_tbl_ongo);
+	while (tbl) {
+		temp_tbl = LIST_NEXT(tbl, next);
+		claim_zero(flow_hw_table_destroy(dev, tbl, NULL));
+		tbl = temp_tbl;
 	}
-	while (!LIST_EMPTY(&priv->flow_hw_tbl)) {
-		tbl = LIST_FIRST(&priv->flow_hw_tbl);
-		flow_hw_table_destroy(dev, tbl, NULL);
+	tbl = LIST_FIRST(&priv->flow_hw_tbl);
+	while (tbl) {
+		temp_tbl = LIST_NEXT(tbl, next);
+		claim_zero(flow_hw_table_destroy(dev, tbl, NULL));
+		tbl = temp_tbl;
 	}
-	while (!LIST_EMPTY(&priv->flow_hw_itt)) {
-		it = LIST_FIRST(&priv->flow_hw_itt);
-		flow_hw_pattern_template_destroy(dev, it, NULL);
+	it = LIST_FIRST(&priv->flow_hw_itt);
+	while (it) {
+		temp_it = LIST_NEXT(it, next);
+		claim_zero(flow_hw_pattern_template_destroy(dev, it, NULL));
+		it = temp_it;
 	}
-	while (!LIST_EMPTY(&priv->flow_hw_at)) {
-		at = LIST_FIRST(&priv->flow_hw_at);
-		flow_hw_actions_template_destroy(dev, at, NULL);
+	at = LIST_FIRST(&priv->flow_hw_at);
+	while (at) {
+		temp_at = LIST_NEXT(at, next);
+		claim_zero(flow_hw_actions_template_destroy(dev, at, NULL));
+		at = temp_at;
 	}
 	for (i = 0; i < MLX5_HW_ACTION_FLAG_MAX; i++) {
 		if (priv->hw_drop[i])
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-06-25 00:22:17.360608425 +0100
+++ 0074-net-mlx5-break-flow-resource-release-loop.patch	2024-06-25 00:22:13.273187443 +0100
@@ -1 +1 @@
-From 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd Mon Sep 17 00:00:00 2001
+From 68b68c76e1f2f9112d5016c732a00e97a0e5460f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- drivers/net/mlx5/mlx5_flow_hw.c | 54 +++++++++++++++++++--------------
- 1 file changed, 32 insertions(+), 22 deletions(-)
+ drivers/net/mlx5/mlx5_flow_hw.c | 44 +++++++++++++++++++--------------
+ 1 file changed, 26 insertions(+), 18 deletions(-)
@@ -23 +24 @@
-index e8c06387f8..53c6cc5961 100644
+index 5333495a59..c902b35f0b 100644
@@ -26 +27 @@
-@@ -5062,7 +5062,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
+@@ -3407,7 +3407,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
@@ -30 +31 @@
--				   "table in use");
+-				   "table in using");
@@ -35 +36 @@
-@@ -7362,7 +7362,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev,
+@@ -4660,7 +4660,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev __rte_unused,
@@ -42,3 +43,3 @@
- 	if (template->action_flags & flag)
- 		mlx5_free_srh_flex_parser(dev);
-@@ -7986,7 +7986,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev,
+ 	LIST_REMOVE(template, next);
+ 	if (template->tmpl)
+@@ -5013,7 +5013,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev __rte_unused,
@@ -51,3 +52,3 @@
- 	if (template->item_flags & (MLX5_FLOW_ITEM_OUTER_IPV6_ROUTING_EXT |
- 				    MLX5_FLOW_ITEM_INNER_IPV6_ROUTING_EXT))
-@@ -10787,10 +10787,10 @@ void
+ 	LIST_REMOVE(template, next);
+ 	claim_zero(mlx5dr_match_template_destroy(template->mt));
+@@ -7458,9 +7458,9 @@ void
@@ -60 +60,0 @@
--	struct mlx5_flow_group *grp;
@@ -64 +63,0 @@
-+	struct mlx5_flow_group *grp, *temp_grp;
@@ -68 +67,2 @@
-@@ -10802,25 +10802,35 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+@@ -7470,21 +7470,29 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+ 	flow_hw_cleanup_ctrl_fdb_tables(dev);
@@ -71,10 +70,0 @@
- 	flow_hw_action_template_drop_release(dev);
--	while (!LIST_EMPTY(&priv->flow_hw_grp)) {
--		grp = LIST_FIRST(&priv->flow_hw_grp);
--		flow_hw_group_unset_miss_group(dev, grp, NULL);
-+	grp = LIST_FIRST(&priv->flow_hw_grp);
-+	while (grp) {
-+		temp_grp = LIST_NEXT(grp, next);
-+		claim_zero(flow_hw_group_unset_miss_group(dev, grp, NULL));
-+		grp = temp_grp;
- 	}

  parent reply	other threads:[~2024-06-25  0:03 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 23:57 patch 'test: force IOVA mode on PPC64 without huge pages' " luca.boccassi
2024-06-24 23:57 ` patch 'bus/pci: fix build with musl 1.2.4 / Alpine 3.19' " luca.boccassi
2024-06-24 23:57 ` patch 'eal/unix: support ZSTD compression for firmware' " luca.boccassi
2024-06-24 23:57 ` patch 'pcapng: add memcpy check' " luca.boccassi
2024-06-24 23:57 ` patch 'net/virtio-user: " luca.boccassi
2024-06-24 23:57 ` patch 'eal/windows: install sched.h file' " luca.boccassi
2024-06-24 23:57 ` patch 'latencystats: fix literal float suffix' " luca.boccassi
2024-06-24 23:57 ` patch 'net/nfp: fix representor port queue release' " luca.boccassi
2024-06-24 23:57 ` patch 'net/bonding: fix failover time of LACP with mode 4' " luca.boccassi
2024-06-24 23:57 ` patch 'net/hns3: fix offload flag of IEEE 1588' " luca.boccassi
2024-06-24 23:57 ` patch 'net/hns3: fix Rx timestamp flag' " luca.boccassi
2024-06-24 23:57 ` patch 'net/hns3: fix double free for Rx/Tx queue' " luca.boccassi
2024-06-24 23:57 ` patch 'net/hns3: fix variable overflow' " luca.boccassi
2024-06-24 23:58 ` patch 'net/hns3: disable SCTP verification tag for RSS hash input' " luca.boccassi
2024-06-24 23:58 ` patch 'net/af_packet: align Rx/Tx structs to cache line' " luca.boccassi
2024-06-24 23:58 ` patch 'doc: fix testpmd ring size command' " luca.boccassi
2024-06-24 23:58 ` patch 'net/af_xdp: fix port ID in Rx mbuf' " luca.boccassi
2024-06-24 23:58 ` patch 'net/af_xdp: count mbuf allocation failures' " luca.boccassi
2024-06-24 23:58 ` patch 'net/af_xdp: fix stats reset' " luca.boccassi
2024-06-24 23:58 ` patch 'net/af_xdp: remove unused local statistic' " luca.boccassi
2024-06-24 23:58 ` patch 'net/tap: fix file descriptor check in isolated flow' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: fix MDIO access for non-zero ports and CL45 PHYs' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: reset link when link never comes back' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: fix fluctuations for 1G Bel Fuse SFP' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: update DMA coherency values' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: disable interrupts during device removal' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: disable RRC for yellow carp devices' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: enable PLL control for fixed PHY modes only' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: fix SFP codes check for DAC cables' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: fix connection for SFP+ active " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: check only minimum speed for " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: fix Tx flow on 30H HW' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: delay AN timeout during KR training' " luca.boccassi
2024-06-24 23:58 ` patch 'net/axgbe: fix linkup in PHY status' " luca.boccassi
2024-06-24 23:58 ` patch 'net/ice: fix check for outer UDP checksum offload' " luca.boccassi
2024-06-24 23:58 ` patch 'app/testpmd: fix outer IP " luca.boccassi
2024-06-24 23:58 ` patch 'net: fix outer UDP checksum in Intel prepare helper' " luca.boccassi
2024-06-24 23:58 ` patch 'net/i40e: fix outer UDP checksum offload for X710' " luca.boccassi
2024-06-24 23:58 ` patch 'net/iavf: remove outer UDP checksum offload for X710 VF' " luca.boccassi
2024-06-24 23:58 ` patch 'app/testpmd: fix lcore ID restriction' " luca.boccassi
2024-06-24 23:58 ` patch 'hash: fix return code description in Doxygen' " luca.boccassi
2024-06-24 23:58 ` patch 'hash: check name when creating a hash' " luca.boccassi
2024-06-24 23:58 ` patch 'mempool: replace GCC pragma with cast' " luca.boccassi
2024-06-24 23:58 ` patch 'vhost: fix build with GCC 13' " luca.boccassi
2024-06-24 23:58 ` patch 'vhost: cleanup resubmit info before inflight setup' " luca.boccassi
2024-06-24 23:58 ` patch 'net/virtio: fix MAC table update' " luca.boccassi
2024-06-24 23:58 ` patch 'baseband/acc: fix memory barrier' " luca.boccassi
2024-06-24 23:58 ` patch 'event/sw: fix warning from useless snprintf' " luca.boccassi
2024-06-24 23:58 ` patch 'eventdev/crypto: fix opaque field handling' " luca.boccassi
2024-06-24 23:58 ` patch 'eal: fix logs for '--lcores'' " luca.boccassi
2024-06-24 23:58 ` patch 'net/fm10k: fix cleanup during init failure' " luca.boccassi
2024-06-24 23:58 ` patch 'net/ixgbe: do not update link status in secondary process' " luca.boccassi
2024-06-24 23:58 ` patch 'net/ixgbe: do not create delayed interrupt handler twice' " luca.boccassi
2024-06-24 23:58 ` patch 'net/e1000/base: fix link power down' " luca.boccassi
2024-06-24 23:58 ` patch 'net/ixgbe/base: revert advertising for X550 2.5G/5G' " luca.boccassi
2024-06-24 23:58 ` patch 'net/ixgbe/base: fix 5G link speed reported on VF' " luca.boccassi
2024-06-24 23:58 ` patch 'net/ixgbe/base: fix PHY ID for X550' " luca.boccassi
2024-06-24 23:58 ` patch 'net/cnxk: fix RSS config' " luca.boccassi
2024-06-24 23:58 ` patch 'net/cnxk: fix outbound security with higher packet burst' " luca.boccassi
2024-06-24 23:58 ` patch 'net/cnxk: fix promiscuous state after MAC change' " luca.boccassi
2024-06-24 23:58 ` patch 'graph: fix ID collisions' " luca.boccassi
2024-06-24 23:58 ` patch 'bpf: disable on 32-bit x86' " luca.boccassi
2024-06-24 23:58 ` patch 'hash: fix RCU reclamation size' " luca.boccassi
2024-06-24 23:58 ` patch 'common/mlx5: fix unsigned/signed mismatch' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5/hws: decrease log level for creation failure' " luca.boccassi
2024-06-24 23:58 ` patch 'common/mlx5: fix PRM structs' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5/hws: fix function comment' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5/hws: fix spinlock release on context open' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5/hws: add template match none flag' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5/hws: fix action template dump' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5: fix indexed pool with invalid index' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5: fix hash Rx queue release in flow sample' " luca.boccassi
2024-06-24 23:58 ` patch 'net/mlx5: fix flow template indirect action failure' " luca.boccassi
2024-06-24 23:59 ` luca.boccassi [this message]
2024-06-24 23:59 ` patch 'net/mlx5: fix access to flow template operations' " luca.boccassi
2024-06-24 23:59 ` patch 'net/mlx5: support jump in meter hierarchy' " luca.boccassi
2024-06-24 23:59 ` patch 'net/mlx5: fix crash on counter pool destroy' " luca.boccassi
2024-06-24 23:59 ` patch 'test/crypto: fix enqueue/dequeue callback case' " luca.boccassi
2024-06-24 23:59 ` patch 'telemetry: lower log level on socket error' " luca.boccassi
2024-06-24 23:59 ` patch 'bus/vdev: revert fix devargs in secondary process' " luca.boccassi
2024-06-24 23:59 ` patch 'doc: fix link to hugepage mapping from Linux guide' " luca.boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240624235907.885628-74-luca.boccassi@gmail.com \
    --to=luca.boccassi@gmail.com \
    --cc=akozyrev@nvidia.com \
    --cc=dsosnowski@nvidia.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).