patch 'net/mlx5: fix tag ID conflict with sample action' has been queued to stable release 20.11.4
Xueming Li
xuemingl at nvidia.com
Sun Nov 28 15:53:12 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/2a9a0c9d63e2bfcb01b8d16eebb23b60a561a6eb
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 2a9a0c9d63e2bfcb01b8d16eebb23b60a561a6eb Mon Sep 17 00:00:00 2001
From: Jiawei Wang <jiaweiw at nvidia.com>
Date: Wed, 3 Nov 2021 15:07:59 +0200
Subject: [PATCH] net/mlx5: fix tag ID conflict with sample action
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit a9b6ea45bed6acb2d95c93bc177f9d5cb53275ef ]
For the flows containing sample action, the tag action was added
implicitly to store the unique flow index into metadata register in the
split prefix subflow, and then match on this index in the split suffix
subflow. The metadata register for flow index of sample split subflows
was also used to store application metadata TAG 0 item, this might cause
TAG 0 corruption in the flows with sample actions.
This patch uses the same metadata register C index as used for
ASO action since it's reserved and not used directly by the application,
and adds the checking in validation to make sure not to conflict
with ASO CT in the same flow.
Fixes: b4c0ddbfcc58 ("net/mlx5: split sample flow into two sub-flows")
Signed-off-by: Jiawei Wang <jiaweiw at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 3 ++-
drivers/net/mlx5/mlx5_flow.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1fa361b318..b8e11a43f5 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -835,6 +835,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
REG_C_3;
case MLX5_MTR_COLOR:
case MLX5_ASO_FLOW_HIT: /* Both features use the same REG_C. */
+ case MLX5_SAMPLE_ID:
MLX5_ASSERT(priv->mtr_color_reg != REG_NON);
return priv->mtr_color_reg;
case MLX5_COPY_MARK:
@@ -4656,7 +4657,7 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
if (!fdb_tx) {
/* Prepare the prefix tag action. */
set_tag = (void *)(actions_pre + actions_n + 1);
- ret = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG, 0, error);
+ ret = mlx5_flow_get_reg_id(dev, MLX5_SAMPLE_ID, 0, error);
if (ret < 0)
return ret;
set_tag->id = ret;
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 56af30c2bb..c7021c2110 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -81,6 +81,7 @@ enum mlx5_feature_name {
MLX5_MTR_COLOR,
MLX5_MTR_SFX,
MLX5_ASO_FLOW_HIT,
+ MLX5_SAMPLE_ID,
};
/* Default queue number. */
--
2.34.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-11-28 22:41:03.964883622 +0800
+++ 0008-net-mlx5-fix-tag-ID-conflict-with-sample-action.patch 2021-11-28 22:41:03.213542911 +0800
@@ -1 +1 @@
-From a9b6ea45bed6acb2d95c93bc177f9d5cb53275ef Mon Sep 17 00:00:00 2001
+From 2a9a0c9d63e2bfcb01b8d16eebb23b60a561a6eb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit a9b6ea45bed6acb2d95c93bc177f9d5cb53275ef ]
@@ -19 +21,0 @@
-Cc: stable at dpdk.org
@@ -24,4 +26,3 @@
- drivers/net/mlx5/mlx5_flow.c | 3 ++-
- drivers/net/mlx5/mlx5_flow.h | 1 +
- drivers/net/mlx5/mlx5_flow_dv.c | 4 ++++
- 3 files changed, 7 insertions(+), 1 deletion(-)
+ drivers/net/mlx5/mlx5_flow.c | 3 ++-
+ drivers/net/mlx5/mlx5_flow.h | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
@@ -30 +31 @@
-index 29134b4825..f657980737 100644
+index 1fa361b318..b8e11a43f5 100644
@@ -33 +34,2 @@
-@@ -907,6 +907,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
+@@ -835,6 +835,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
+ REG_C_3;
@@ -35,2 +37 @@
- case MLX5_ASO_FLOW_HIT:
- case MLX5_ASO_CONNTRACK:
+ case MLX5_ASO_FLOW_HIT: /* Both features use the same REG_C. */
@@ -38 +38,0 @@
- /* All features use the same REG_C. */
@@ -41 +41,3 @@
-@@ -5581,7 +5582,7 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
+ case MLX5_COPY_MARK:
+@@ -4656,7 +4657,7 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
+ if (!fdb_tx) {
@@ -43,2 +45 @@
- append_index++;
- set_tag = (void *)(actions_pre + actions_n + append_index);
+ set_tag = (void *)(actions_pre + actions_n + 1);
@@ -49 +50 @@
- mlx5_ipool_malloc(priv->sh->ipool
+ set_tag->id = ret;
@@ -51 +52 @@
-index 4026255ce4..696d294ca5 100644
+index 56af30c2bb..c7021c2110 100644
@@ -54,2 +55,3 @@
-@@ -109,6 +109,7 @@ enum mlx5_feature_name {
- MLX5_MTR_ID,
+@@ -81,6 +81,7 @@ enum mlx5_feature_name {
+ MLX5_MTR_COLOR,
+ MLX5_MTR_SFX,
@@ -57 +58,0 @@
- MLX5_ASO_CONNTRACK,
@@ -62,15 +62,0 @@
-diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
-index 8fa7829341..0beaf7b62d 100644
---- a/drivers/net/mlx5/mlx5_flow_dv.c
-+++ b/drivers/net/mlx5/mlx5_flow_dv.c
-@@ -5574,6 +5574,10 @@ flow_dv_validate_action_sample(uint64_t *action_flags,
- RTE_FLOW_ERROR_TYPE_ACTION, action,
- "wrong action order, jump should "
- "be after sample action");
-+ if (*action_flags & MLX5_FLOW_ACTION_CT)
-+ return rte_flow_error_set(error, EINVAL,
-+ RTE_FLOW_ERROR_TYPE_ACTION, action,
-+ "Sample after CT not supported");
- act = sample->actions;
- for (; act->type != RTE_FLOW_ACTION_TYPE_END; act++) {
- if (actions_n == MLX5_DV_MAX_NUMBER_OF_ACTIONS)
More information about the stable
mailing list