patch 'net/mlx5: fix age position in hairpin split' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Sat Apr 13 14:49:46 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.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 04/15/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=9aba4dee4d43bfc96d4a15be0b77c9fb9301d513

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 9aba4dee4d43bfc96d4a15be0b77c9fb9301d513 Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz at nvidia.com>
Date: Thu, 7 Mar 2024 10:09:24 +0200
Subject: [PATCH] net/mlx5: fix age position in hairpin split
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 4c89815eab7471b98388dc958b95777d341f05fc ]

When splitting a hairpin rule implicitly, the count action will
be on either Tx or Rx subflow based on the encapsulation checking.

Once there is a flow rule with both count and age action, one counter
will be reused. If there is only age action and the ASO flow hit is
supported, the flow hit will be chosen instead of a counter.

In the previous flow splitting, the age would always be in the Rx
part, while the count would be on the Tx part when there is an encap.

Before this commit, 2 issues can be observed with a hairpin split:
  1. On the root table, one counter was used on both Rx and Tx parts
     for age and count actions. Then one ingress packet will be
     counted twice.
  2. On the non-root table, an extra ASO flow hit was used on the Rx
     part. This would cause some overhead.

The age and count actions should be in the same subflow instead of 2.

Fixes: daed4b6e3db2 ("net/mlx5: use aging by counter when counter exists")

Signed-off-by: Bing Zhao <bingz at nvidia.com>
Acked-by: Ori Kam <orika at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c    | 1 +
 drivers/net/mlx5/mlx5_flow_dv.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index ee210549e7..ccfd189c1f 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5492,6 +5492,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
 			}
 			break;
 		case RTE_FLOW_ACTION_TYPE_COUNT:
+		case RTE_FLOW_ACTION_TYPE_AGE:
 			if (encap) {
 				rte_memcpy(actions_tx, actions,
 					   sizeof(struct rte_flow_action));
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index e36443436e..7688d97813 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -19094,8 +19094,7 @@ flow_dv_get_aged_flows(struct rte_eth_dev *dev,
 	LIST_FOREACH(act, &age_info->aged_aso, next) {
 		nb_flows++;
 		if (nb_contexts) {
-			context[nb_flows - 1] =
-						act->age_params.context;
+			context[nb_flows - 1] = act->age_params.context;
 			if (!(--nb_contexts))
 				break;
 		}
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.265894063 +0800
+++ 0106-net-mlx5-fix-age-position-in-hairpin-split.patch	2024-04-13 20:43:05.117753775 +0800
@@ -1 +1 @@
-From 4c89815eab7471b98388dc958b95777d341f05fc Mon Sep 17 00:00:00 2001
+From 9aba4dee4d43bfc96d4a15be0b77c9fb9301d513 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 4c89815eab7471b98388dc958b95777d341f05fc ]
@@ -26 +28,0 @@
-Cc: stable at dpdk.org
@@ -36 +38 @@
-index 6484874c35..f31fdfbf3d 100644
+index ee210549e7..ccfd189c1f 100644
@@ -39 +41 @@
-@@ -5399,6 +5399,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
+@@ -5492,6 +5492,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
@@ -48 +50 @@
-index 80239bebee..4badde1a9a 100644
+index e36443436e..7688d97813 100644
@@ -51 +53 @@
-@@ -19361,8 +19361,7 @@ flow_dv_get_aged_flows(struct rte_eth_dev *dev,
+@@ -19094,8 +19094,7 @@ flow_dv_get_aged_flows(struct rte_eth_dev *dev,


More information about the stable mailing list