[dpdk-stable] patch 'net/mlx5: fix resource release for mirror flow' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:02:16 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.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 05/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/8e59d734a21524c537a0109fa5460150a2ae8844

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 8e59d734a21524c537a0109fa5460150a2ae8844 Mon Sep 17 00:00:00 2001
From: Jiawei Wang <jiaweiw at nvidia.com>
Date: Fri, 9 Apr 2021 15:33:28 +0300
Subject: [PATCH] net/mlx5: fix resource release for mirror flow
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit ca5eb60ecd5bcd9d4dfed6972ea991d7ead0e9a3 ]

The mlx5 PMD allocated the resources of the sample actions, and then
moved these ones to the destination actions array. The original indices
were not cleared and the resources were referenced twice in the
flow object - as the fate actions and in the destination actions array.

This causes the failure on flow destroy because PMD tried to release the
same objects twice.

The patch clears the original indices, add the missed checking for zero
and eliminates multiple object releasing.

Fixes: 00c10c22118a ("net/mlx5: update translate function for mirroring")

Signed-off-by: Jiawei Wang <jiaweiw at nvidia.com>
Reviewed-by: Suanming Mou <suanmingm at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index b1c8a95e8a..a1d1579991 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -9024,20 +9024,8 @@ flow_dv_dest_array_create_cb(struct mlx5_cache_list *list __rte_unused,
 	return &cache_resource->entry;
 error:
 	for (idx = 0; idx < resource->num_of_dest; idx++) {
-		struct mlx5_flow_sub_actions_idx *act_res =
-					&cache_resource->sample_idx[idx];
-		if (act_res->rix_hrxq &&
-		    !mlx5_hrxq_release(dev,
-				act_res->rix_hrxq))
-			act_res->rix_hrxq = 0;
-		if (act_res->rix_encap_decap &&
-			!flow_dv_encap_decap_resource_release(dev,
-				act_res->rix_encap_decap))
-			act_res->rix_encap_decap = 0;
-		if (act_res->rix_port_id_action &&
-			!flow_dv_port_id_action_resource_release(dev,
-				act_res->rix_port_id_action))
-			act_res->rix_port_id_action = 0;
+		flow_dv_sample_sub_actions_release(dev,
+				&cache_resource->sample_idx[idx]);
 		if (dest_attr[idx])
 			mlx5_free(dest_attr[idx]);
 	}
@@ -9368,6 +9356,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev,
 				dev_flow->handle->dvh.rix_encap_decap;
 			sample_act->dr_encap_action =
 				dev_flow->dv.encap_decap->action;
+			dev_flow->handle->dvh.rix_encap_decap = 0;
 		}
 		if (sample_act->action_flags & MLX5_FLOW_ACTION_PORT_ID) {
 			normal_idx++;
@@ -9375,6 +9364,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev,
 				dev_flow->handle->rix_port_id_action;
 			sample_act->dr_port_id_action =
 				dev_flow->dv.port_id_action->action;
+			dev_flow->handle->rix_port_id_action = 0;
 		}
 		sample_act->actions_num = normal_idx;
 		/* update sample action resource into first index of array */
@@ -11193,7 +11183,8 @@ flow_dv_fate_resource_release(struct rte_eth_dev *dev,
 		return;
 	switch (handle->fate_action) {
 	case MLX5_FLOW_FATE_QUEUE:
-		mlx5_hrxq_release(dev, handle->rix_hrxq);
+		if (!handle->dvh.rix_sample && !handle->dvh.rix_dest_array)
+			mlx5_hrxq_release(dev, handle->rix_hrxq);
 		break;
 	case MLX5_FLOW_FATE_JUMP:
 		flow_dv_jump_tbl_resource_release(dev, handle);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:31.416433600 +0800
+++ 0188-net-mlx5-fix-resource-release-for-mirror-flow.patch	2021-05-10 23:59:26.640000000 +0800
@@ -1 +1 @@
-From ca5eb60ecd5bcd9d4dfed6972ea991d7ead0e9a3 Mon Sep 17 00:00:00 2001
+From 8e59d734a21524c537a0109fa5460150a2ae8844 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit ca5eb60ecd5bcd9d4dfed6972ea991d7ead0e9a3 ]
@@ -18 +20,0 @@
-Cc: stable at dpdk.org
@@ -24,2 +26,2 @@
- drivers/net/mlx5/mlx5_flow_dv.c | 25 ++++++-------------------
- 1 file changed, 6 insertions(+), 19 deletions(-)
+ drivers/net/mlx5/mlx5_flow_dv.c | 21 ++++++---------------
+ 1 file changed, 6 insertions(+), 15 deletions(-)
@@ -28 +30 @@
-index 4914c7085f..07a0ee5abb 100644
+index b1c8a95e8a..a1d1579991 100644
@@ -31 +33 @@
-@@ -10155,24 +10155,8 @@ flow_dv_dest_array_create_cb(struct mlx5_cache_list *list __rte_unused,
+@@ -9024,20 +9024,8 @@ flow_dv_dest_array_create_cb(struct mlx5_cache_list *list __rte_unused,
@@ -49,4 +50,0 @@
--		if (act_res->rix_jump &&
--			!flow_dv_jump_tbl_resource_release(dev,
--				act_res->rix_jump))
--			act_res->rix_jump = 0;
@@ -58 +56 @@
-@@ -10542,6 +10526,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev,
+@@ -9368,6 +9356,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev,
@@ -66 +64 @@
-@@ -10549,6 +10534,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev,
+@@ -9375,6 +9364,7 @@ flow_dv_create_action_sample(struct rte_eth_dev *dev,
@@ -72,3 +70,3 @@
- 		if (sample_act->action_flags & MLX5_FLOW_ACTION_JUMP) {
- 			normal_idx++;
-@@ -12415,7 +12401,8 @@ flow_dv_fate_resource_release(struct rte_eth_dev *dev,
+ 		sample_act->actions_num = normal_idx;
+ 		/* update sample action resource into first index of array */
+@@ -11193,7 +11183,8 @@ flow_dv_fate_resource_release(struct rte_eth_dev *dev,
@@ -83 +81 @@
- 		flow_dv_jump_tbl_resource_release(dev, handle->rix_jump);
+ 		flow_dv_jump_tbl_resource_release(dev, handle);


More information about the stable mailing list