patch 'net/mlx5: break flow resource release loop' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Fri Jul 12 13:01:43 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a5a685a9f08f63eec57884f61ea46b058c79fdc7
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From a5a685a9f08f63eec57884f61ea46b058c79fdc7 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev at nvidia.com>
Date: Thu, 30 May 2024 00:46:32 +0300
Subject: [PATCH] net/mlx5: break flow resource release loop
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 62 +++++++++++++++++++--------------
1 file changed, 36 insertions(+), 26 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 39e68b39f7..9667bad68e 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4663,7 +4663,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 use");
+ "table is in use");
}
LIST_REMOVE(table, next);
for (i = 0; i < table->nb_item_templates; i++)
@@ -6706,7 +6706,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev,
return rte_flow_error_set(error, EBUSY,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,
- "action template in using");
+ "action template is in use");
}
if (template->action_flags & flag)
mlx5_free_srh_flex_parser(dev);
@@ -7124,7 +7124,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev,
return rte_flow_error_set(error, EBUSY,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,
- "item template in using");
+ "item template is in use");
}
if (template->item_flags & (MLX5_FLOW_ITEM_OUTER_IPV6_ROUTING_EXT |
MLX5_FLOW_ITEM_INNER_IPV6_ROUTING_EXT))
@@ -9798,10 +9798,10 @@ 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 mlx5_flow_group *grp;
+ struct rte_flow_template_table *tbl, *temp_tbl;
+ struct rte_flow_pattern_template *it, *temp_it;
+ struct rte_flow_actions_template *at, *temp_at;
+ struct mlx5_flow_group *grp, *temp_grp;
uint32_t i;
if (!priv->dr_ctx)
@@ -9811,25 +9811,35 @@ 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_grp)) {
- grp = LIST_FIRST(&priv->flow_hw_grp);
- flow_hw_group_unset_miss_group(dev, grp, NULL);
- }
- while (!LIST_EMPTY(&priv->flow_hw_tbl_ongo)) {
- tbl = LIST_FIRST(&priv->flow_hw_tbl_ongo);
- flow_hw_table_destroy(dev, tbl, NULL);
- }
- while (!LIST_EMPTY(&priv->flow_hw_tbl)) {
- tbl = LIST_FIRST(&priv->flow_hw_tbl);
- flow_hw_table_destroy(dev, tbl, NULL);
- }
- while (!LIST_EMPTY(&priv->flow_hw_itt)) {
- it = LIST_FIRST(&priv->flow_hw_itt);
- flow_hw_pattern_template_destroy(dev, it, NULL);
- }
- while (!LIST_EMPTY(&priv->flow_hw_at)) {
- at = LIST_FIRST(&priv->flow_hw_at);
- flow_hw_actions_template_destroy(dev, at, 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;
+ }
+ 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;
+ }
+ 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;
+ }
+ 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;
+ }
+ 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.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-07-12 18:40:18.206711635 +0800
+++ 0092-net-mlx5-break-flow-resource-release-loop.patch 2024-07-12 18:40:14.306594203 +0800
@@ -1 +1 @@
-From 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd Mon Sep 17 00:00:00 2001
+From a5a685a9f08f63eec57884f61ea46b058c79fdc7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 4fcb7a05e38172aed60f87a6287bb2ee3d9828fd ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -23 +25 @@
-index e8c06387f8..53c6cc5961 100644
+index 39e68b39f7..9667bad68e 100644
@@ -26 +28 @@
-@@ -5062,7 +5062,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
+@@ -4663,7 +4663,7 @@ flow_hw_table_destroy(struct rte_eth_dev *dev,
@@ -35 +37 @@
-@@ -7362,7 +7362,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev,
+@@ -6706,7 +6706,7 @@ flow_hw_actions_template_destroy(struct rte_eth_dev *dev,
@@ -44 +46 @@
-@@ -7986,7 +7986,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev,
+@@ -7124,7 +7124,7 @@ flow_hw_pattern_template_destroy(struct rte_eth_dev *dev,
@@ -53 +55 @@
-@@ -10787,10 +10787,10 @@ void
+@@ -9798,10 +9798,10 @@ void
@@ -68 +70,2 @@
-@@ -10802,25 +10802,35 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+@@ -9811,25 +9811,35 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+ flow_hw_cleanup_ctrl_fdb_tables(dev);
@@ -71 +73,0 @@
- flow_hw_action_template_drop_release(dev);
More information about the stable
mailing list