patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix flow mark value missing on combination split
@ 2021-11-22 14:22 Jiawei Wang
  2021-11-23 13:26 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawei Wang @ 2021-11-22 14:22 UTC (permalink / raw)
  To: viacheslavo, matan, orika; +Cc: dev, rasland, stable

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")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index a30ce695aa..f34e4b88aa 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -6096,7 +6096,6 @@ flow_create_split_meter(struct rte_eth_dev *dev,
 			goto exit;
 		}
 		/* Add the prefix subflow. */
-		flow_split_info->prefix_mark = 0;
 		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;
 		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;
 		flow_split_info->table_id = MLX5_MTR_TABLE_ID_SUFFIX;
 	}
 	/* Add the prefix subflow. */
@@ -6281,7 +6280,7 @@ flow_create_split_sample(struct rte_eth_dev *dev,
 		}
 		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
 		 * MLX5_SCALE_FLOW_GROUP_BIT of 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 1de2f2edb0..1f54649c69 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -1111,13 +1111,13 @@ 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. */
 	uint32_t table_id; /**< Flow table identifier. */
+	uint64_t prefix_layers; /**< Prefix subflow layers. */
 };
 
 typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev,
-- 
2.18.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] net/mlx5: fix flow mark value missing on combination split
  2021-11-22 14:22 [PATCH] net/mlx5: fix flow mark value missing on combination split Jiawei Wang
@ 2021-11-23 13:26 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2021-11-23 13:26 UTC (permalink / raw)
  To: Jiawei(Jonny) Wang, Slava Ovsiienko, Matan Azrad, Ori Kam; +Cc: dev, stable

Hi,

> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Monday, November 22, 2021 4:23 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Ori Kam <orika@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix flow mark value missing on combination split
> 
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-23 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 14:22 [PATCH] net/mlx5: fix flow mark value missing on combination split Jiawei Wang
2021-11-23 13:26 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).