[dpdk-stable] patch 'net/mlx5: fix flow split combined with counter' has been queued to stable release 20.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 5 12:18:31 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.1

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/79fa0ec96a14c2ecb223c22dc53a6a8a722aed9a

Thanks.

Luca Boccassi

---
>From 79fa0ec96a14c2ecb223c22dc53a6a8a722aed9a Mon Sep 17 00:00:00 2001
From: Dekel Peled <dekelp at nvidia.com>
Date: Sun, 17 Jan 2021 11:40:46 +0200
Subject: [PATCH] net/mlx5: fix flow split combined with counter

[ upstream commit 63f4d5693ed8459f8867a23d0b87cf9c60983767 ]

Currently, for a flow containing a count action, if flow is split to
sub-flows, a new counter will be created for each sub-flow.
However only the counter created for the last sub-flow will be queried
on flow query and cleared on flow removal.

This behavior is wrong, causing a leak of resources.
Need to create just one counter per flow, and use it for all sub-flows.

This patch adds the required check to make sure a counter is
created just once per flow, and used by all sub-flows.

Fixes: fa2d01c87d2b ("net/mlx5: support flow aging")

Signed-off-by: Dekel Peled <dekelp at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 407e76e7b1..ab9aaab4ec 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -10235,17 +10235,22 @@ flow_dv_translate(struct rte_eth_dev *dev,
 					handle->dvh.modify_hdr->action;
 			}
 			if (action_flags & MLX5_FLOW_ACTION_COUNT) {
-				flow->counter =
-					flow_dv_translate_create_counter(dev,
-						dev_flow, count, age);
-
-				if (!flow->counter)
-					return rte_flow_error_set
+				/*
+				 * Create one count action, to be used
+				 * by all sub-flows.
+				 */
+				if (!flow->counter) {
+					flow->counter =
+						flow_dv_translate_create_counter
+							(dev, dev_flow, count,
+							 age);
+					if (!flow->counter)
+						return rte_flow_error_set
 						(error, rte_errno,
-						RTE_FLOW_ERROR_TYPE_ACTION,
-						NULL,
-						"cannot create counter"
-						" object.");
+						 RTE_FLOW_ERROR_TYPE_ACTION,
+						 NULL, "cannot create counter"
+						 " object.");
+				}
 				dev_flow->dv.actions[actions_n] =
 					  (flow_dv_counter_get_by_idx(dev,
 					  flow->counter, NULL))->action;
-- 
2.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-05 11:18:39.083446225 +0000
+++ 0225-net-mlx5-fix-flow-split-combined-with-counter.patch	2021-02-05 11:18:29.190698423 +0000
@@ -1 +1 @@
-From 63f4d5693ed8459f8867a23d0b87cf9c60983767 Mon Sep 17 00:00:00 2001
+From 79fa0ec96a14c2ecb223c22dc53a6a8a722aed9a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 63f4d5693ed8459f8867a23d0b87cf9c60983767 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -27 +28 @@
-index 5e34cbeea9..012d5893ba 100644
+index 407e76e7b1..ab9aaab4ec 100644
@@ -30 +31 @@
-@@ -10681,17 +10681,22 @@ flow_dv_translate(struct rte_eth_dev *dev,
+@@ -10235,17 +10235,22 @@ flow_dv_translate(struct rte_eth_dev *dev,


More information about the stable mailing list