patch 'net/mlx5: fix flow mark with sampling and metering' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Sun Nov 28 15:54:11 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 6e5d1776da0318075b1239bc078b9a6e39a9b68b Mon Sep 17 00:00:00 2001
From: Jiawei Wang <jiaweiw at nvidia.com>
Date: Mon, 22 Nov 2021 16:22:52 +0200
Subject: [PATCH] net/mlx5: fix flow mark with sampling and metering
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 693c7d4b1e12024cd429ef563e9df5cc2c477aee ]

If there are sample action and the meter action in the same flow,
mlx5 PMD performs several levels of splitting. For example, sampling
feature splits the original flow into prefix subflow with sample action,
and suffix subflow with the rest of actions. Then, metering feature
splits the sampling suffix subflow into its own meter subflows.
If mark action was added before the sample and meter action, the
flow mark flag was kept in the sample subflows but reset on
handling the metering split, causing the flow mark value missed.

This patch keeps the flow mark flag of previous subflow, and then
the following meter subflows handle the flow mark correctly.

Fixes: 9ade91dfe85d ("net/mlx5: fix group value of sample suffix flow")

Signed-off-by: Jiawei Wang <jiaweiw at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 5 ++---
 drivers/net/mlx5/mlx5_flow.h | 6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index ba5ad7b87d..3c35b87964 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5063,7 +5063,6 @@ flow_create_split_meter(struct rte_eth_dev *dev,
 			goto exit;
 		}
 		/* Add the prefix subflow. */
-		flow_split_info->prefix_mark = 0;
 		ret = flow_create_split_inner(dev, flow, &dev_flow,
 					      attr, items, pre_actions,
 					      flow_split_info, error);
@@ -5078,7 +5077,7 @@ flow_create_split_meter(struct rte_eth_dev *dev,
 				 MLX5_FLOW_TABLE_LEVEL_SUFFIX;
 		flow_split_info->prefix_layers =
 				flow_get_prefix_layer_flags(dev_flow);
-		flow_split_info->prefix_mark = dev_flow->handle->mark;
+		flow_split_info->prefix_mark |= dev_flow->handle->mark;
 	}
 	/* Add the prefix subflow. */
 	ret = flow_create_split_metadata(dev, flow,
@@ -5209,7 +5208,7 @@ flow_create_split_sample(struct rte_eth_dev *dev,
 					 sfx_table_key.table_id;
 		flow_split_info->prefix_layers =
 				flow_get_prefix_layer_flags(dev_flow);
-		flow_split_info->prefix_mark = dev_flow->handle->mark;
+		flow_split_info->prefix_mark |= dev_flow->handle->mark;
 		/* Suffix group level already be scaled with factor, set
 		 * skip_scale to 1 to avoid scale again in translation.
 		 */
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index c7021c2110..ed9e9f7240 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1126,11 +1126,11 @@ struct mlx5_flow_workspace {
 };
 
 struct mlx5_flow_split_info {
-	bool external;
+	uint32_t external:1;
 	/**< True if flow is created by request external to PMD. */
-	uint8_t skip_scale; /**< Skip the scale the table with factor. */
+	uint32_t prefix_mark:1; /**< Prefix subflow mark flag. */
+	uint32_t skip_scale:8; /**< Skip the scale the table with factor. */
 	uint32_t flow_idx; /**< This memory pool index to the flow. */
-	uint32_t prefix_mark; /**< Prefix subflow mark flag. */
 	uint64_t prefix_layers; /**< Prefix subflow layers. */
 };
 
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-28 22:41:06.648923770 +0800
+++ 0067-net-mlx5-fix-flow-mark-with-sampling-and-metering.patch	2021-11-28 22:41:03.420205836 +0800
@@ -1 +1 @@
-From 693c7d4b1e12024cd429ef563e9df5cc2c477aee Mon Sep 17 00:00:00 2001
+From 6e5d1776da0318075b1239bc078b9a6e39a9b68b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 693c7d4b1e12024cd429ef563e9df5cc2c477aee ]
@@ -19 +21,0 @@
-Cc: stable at dpdk.org
@@ -25,2 +27,2 @@
- drivers/net/mlx5/mlx5_flow.h | 8 ++++----
- 2 files changed, 6 insertions(+), 7 deletions(-)
+ drivers/net/mlx5/mlx5_flow.h | 6 +++---
+ 2 files changed, 5 insertions(+), 6 deletions(-)
@@ -29 +31 @@
-index a30ce695aa..f34e4b88aa 100644
+index ba5ad7b87d..3c35b87964 100644
@@ -32 +34 @@
-@@ -6096,7 +6096,6 @@ flow_create_split_meter(struct rte_eth_dev *dev,
+@@ -5063,7 +5063,6 @@ flow_create_split_meter(struct rte_eth_dev *dev,
@@ -37,5 +39,5 @@
- 		skip_scale_restore = flow_split_info->skip_scale;
- 		flow_split_info->skip_scale |=
- 			1 << MLX5_SCALE_JUMP_FLOW_GROUP_BIT;
-@@ -6129,7 +6128,7 @@ flow_create_split_meter(struct rte_eth_dev *dev,
- 				 MLX5_FLOW_TABLE_LEVEL_METER;
+ 		ret = flow_create_split_inner(dev, flow, &dev_flow,
+ 					      attr, items, pre_actions,
+ 					      flow_split_info, error);
+@@ -5078,7 +5077,7 @@ flow_create_split_meter(struct rte_eth_dev *dev,
+ 				 MLX5_FLOW_TABLE_LEVEL_SUFFIX;
@@ -46 +47,0 @@
- 		flow_split_info->table_id = MLX5_MTR_TABLE_ID_SUFFIX;
@@ -49,2 +50,3 @@
-@@ -6281,7 +6280,7 @@ flow_create_split_sample(struct rte_eth_dev *dev,
- 		}
+ 	ret = flow_create_split_metadata(dev, flow,
+@@ -5209,7 +5208,7 @@ flow_create_split_sample(struct rte_eth_dev *dev,
+ 					 sfx_table_key.table_id;
@@ -56,2 +58,2 @@
- 		 * MLX5_SCALE_FLOW_GROUP_BIT of skip_scale to 1 to avoid scale
- 		 * again in translation.
+ 		 * skip_scale to 1 to avoid scale again in translation.
+ 		 */
@@ -59 +61 @@
-index 1de2f2edb0..1f54649c69 100644
+index c7021c2110..ed9e9f7240 100644
@@ -62 +64 @@
-@@ -1111,13 +1111,13 @@ struct mlx5_flow_workspace {
+@@ -1126,11 +1126,11 @@ struct mlx5_flow_workspace {
@@ -74,3 +76 @@
--	uint64_t prefix_layers; /**< Prefix subflow layers. */
- 	uint32_t table_id; /**< Flow table identifier. */
-+	uint64_t prefix_layers; /**< Prefix subflow layers. */
+ 	uint64_t prefix_layers; /**< Prefix subflow layers. */
@@ -79 +78,0 @@
- typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev,


More information about the stable mailing list