patch 'net/mlx5: fix metadata and meter split shared tag' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Sun Nov 28 15:54:09 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/32255ff0fe19aedcb65775a8242718b168b8b4bf

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 32255ff0fe19aedcb65775a8242718b168b8b4bf Mon Sep 17 00:00:00 2001
From: Jiawei Wang <jiaweiw at nvidia.com>
Date: Fri, 19 Nov 2021 15:02:00 +0200
Subject: [PATCH] net/mlx5: fix metadata and meter split shared tag
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 16f4aa57ca381c4283826cdfce2cd4e172744ca7 ]

In the metadata flow split, PMD created the prefix subflow
with removed Queue or RSS action and appended the set tag and
copy table jump actions. If the flow being split for metadata
was the meter prefix subflow, the driver supposed to share the same
meter split tag action for the metadata split flow. There was the wrong
check for preceding meter split tag action, causing append with metadata
split set tag action and resulting the meter suffix subflow was missed
due to tag value mismatch.

This patch adds the checking before copying into extend action list,
to make sure the correct shared tag is used.

Fixes: 8d72fa668964 ("net/mlx5: share tag between meter and metadata")

Signed-off-by: Jiawei Wang <jiaweiw at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2533a9102e..ba5ad7b87d 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4415,6 +4415,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
  *   Pointer to the Q/RSS action.
  * @param[in] actions_n
  *   Number of original actions.
+ * @param[in] mtr_sfx
+ *   Check if it is in meter suffix table.
  * @param[out] error
  *   Perform verbose error reporting if not NULL.
  *
@@ -4427,7 +4429,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
 			  struct rte_flow_action *split_actions,
 			  const struct rte_flow_action *actions,
 			  const struct rte_flow_action *qrss,
-			  int actions_n, struct rte_flow_error *error)
+			  int actions_n, int mtr_sfx,
+			  struct rte_flow_error *error)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_rte_flow_action_set_tag *set_tag;
@@ -4442,15 +4445,15 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
 	 * - Add jump to mreg CP_TBL.
 	 * As a result, there will be one more action.
 	 */
-	++actions_n;
 	memcpy(split_actions, actions, sizeof(*split_actions) * actions_n);
+	/* Count MLX5_RTE_FLOW_ACTION_TYPE_TAG. */
+	++actions_n;
 	set_tag = (void *)(split_actions + actions_n);
 	/*
-	 * If tag action is not set to void(it means we are not the meter
-	 * suffix flow), add the tag action. Since meter suffix flow already
-	 * has the tag added.
+	 * If we are not the meter suffix flow, add the tag action.
+	 * Since meter suffix flow already has the tag added.
 	 */
-	if (split_actions[qrss_idx].type != RTE_FLOW_ACTION_TYPE_VOID) {
+	if (!mtr_sfx) {
 		/*
 		 * Allocate the new subflow ID. This one is unique within
 		 * device and not shared with representors. Otherwise,
@@ -4483,6 +4486,12 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
 				MLX5_RTE_FLOW_ACTION_TYPE_TAG,
 			.conf = set_tag,
 		};
+	} else {
+		/*
+		 * If we are the suffix flow of meter, tag already exist.
+		 * Set the QUEUE/RSS action to void.
+		 */
+		split_actions[qrss_idx].type = RTE_FLOW_ACTION_TYPE_VOID;
 	}
 	/* JUMP action to jump to mreg copy table (CP_TBL). */
 	jump = (void *)(set_tag + 1);
@@ -4855,17 +4864,6 @@ flow_create_split_metadata(struct rte_eth_dev *dev,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL, "no memory to split "
 						  "metadata flow");
-		/*
-		 * If we are the suffix flow of meter, tag already exist.
-		 * Set the tag action to void.
-		 */
-		if (mtr_sfx)
-			ext_actions[qrss - actions].type =
-						RTE_FLOW_ACTION_TYPE_VOID;
-		else
-			ext_actions[qrss - actions].type =
-						(enum rte_flow_action_type)
-						MLX5_RTE_FLOW_ACTION_TYPE_TAG;
 		/*
 		 * Create the new actions list with removed Q/RSS action
 		 * and appended set tag and jump to register copy table
@@ -4873,7 +4871,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev,
 		 * in advance, because it is needed for set tag action.
 		 */
 		qrss_id = flow_mreg_split_qrss_prep(dev, ext_actions, actions,
-						    qrss, actions_n, error);
+						    qrss, actions_n,
+						    mtr_sfx, error);
 		if (!mtr_sfx && !qrss_id) {
 			ret = -rte_errno;
 			goto exit;
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-28 22:41:06.558158347 +0800
+++ 0065-net-mlx5-fix-metadata-and-meter-split-shared-tag.patch	2021-11-28 22:41:03.413539290 +0800
@@ -1 +1 @@
-From 16f4aa57ca381c4283826cdfce2cd4e172744ca7 Mon Sep 17 00:00:00 2001
+From 32255ff0fe19aedcb65775a8242718b168b8b4bf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 16f4aa57ca381c4283826cdfce2cd4e172744ca7 ]
@@ -19 +21,0 @@
-Cc: stable at dpdk.org
@@ -28 +30 @@
-index 43598f92ee..84e6f3048c 100644
+index 2533a9102e..ba5ad7b87d 100644
@@ -31 +33 @@
-@@ -5251,6 +5251,8 @@ exit:
+@@ -4415,6 +4415,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -40 +42 @@
-@@ -5263,7 +5265,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
+@@ -4427,7 +4429,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
@@ -50 +52 @@
-@@ -5278,15 +5281,15 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
+@@ -4442,15 +4445,15 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
@@ -71 +73 @@
-@@ -5319,6 +5322,12 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
+@@ -4483,6 +4486,12 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev,
@@ -84 +86 @@
-@@ -5773,17 +5782,6 @@ flow_create_split_metadata(struct rte_eth_dev *dev,
+@@ -4855,17 +4864,6 @@ flow_create_split_metadata(struct rte_eth_dev *dev,
@@ -102 +104 @@
-@@ -5791,7 +5789,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev,
+@@ -4873,7 +4871,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev,


More information about the stable mailing list