patch 'net/mlx5: fix meter policy creation assert' has been queued to stable release 21.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Mar 10 13:11:17 CET 2022
Hi,
FYI, your patch has been queued to stable release 21.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 03/14/22. 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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/3bd5cf393d0ab0152596bf2d0d8a8c2270a047d5
Thanks.
Kevin
---
>From 3bd5cf393d0ab0152596bf2d0d8a8c2270a047d5 Mon Sep 17 00:00:00 2001
From: Shun Hao <shunh at nvidia.com>
Date: Wed, 2 Mar 2022 12:33:01 +0200
Subject: [PATCH] net/mlx5: fix meter policy creation assert
[ upstream commit 9267617bb0a6918ee049b1a16062bf0185e2e843 ]
The meter policy creation doesn't belong to flow rule creation
process, so thread workspace was not initialized and there will be
assert error when using it.
This patch removes the incorrect using of thread workspace in meter
policy creation, and adds a flag in policy instead. When creating
flow rule, can use the flag to set the mark flag in thread workspace.
Fixes: 082becbf1f35 ("net/mlx5: fix mark enabling for Rx")
Signed-off-by: Shun Hao <shunh at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
drivers/net/mlx5/mlx5.h | 2 ++
drivers/net/mlx5/mlx5_flow.c | 2 ++
drivers/net/mlx5/mlx5_flow_dv.c | 6 +++---
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 2d682e1e81..128ebd6937 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -748,4 +748,6 @@ struct mlx5_flow_meter_policy {
uint32_t skip_g:1;
/* If green color policy is skipped. */
+ uint32_t mark:1;
+ /* If policy contains mark action. */
rte_spinlock_t sl;
uint32_t ref_cnt;
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index cee8f00413..5b36cfa042 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -6070,4 +6070,6 @@ flow_create_split_meter(struct rte_eth_dev *dev,
NULL);
MLX5_ASSERT(wks->policy);
+ if (wks->policy->mark)
+ wks->mark = 1;
if (wks->policy->is_hierarchy) {
wks->final_policy =
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index a35fb3de4e..1ed0ebb3d9 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -15449,7 +15449,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
} mhdr_dummy;
struct mlx5_flow_dv_modify_hdr_resource *mhdr_res = &mhdr_dummy.res;
- struct mlx5_flow_workspace *wks = mlx5_flow_get_thread_workspace();
- MLX5_ASSERT(wks);
egress = (domain == MLX5_MTR_DOMAIN_EGRESS) ? 1 : 0;
transfer = (domain == MLX5_MTR_DOMAIN_TRANSFER) ? 1 : 0;
@@ -15489,5 +15487,4 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
"cannot create policy "
"mark action for this color");
- wks->mark = 1;
if (flow_dv_tag_resource_register(dev, tag_be,
&dev_flow, &flow_err))
@@ -15501,4 +15498,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
dev_flow.handle->dvh.rix_tag;
action_flags |= MLX5_FLOW_ACTION_MARK;
+ mtr_policy->mark = 1;
break;
}
@@ -15784,4 +15782,6 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
mtr_policy->is_hierarchy = 1;
mtr_policy->dev = next_policy->dev;
+ if (next_policy->mark)
+ mtr_policy->mark = 1;
action_flags |=
MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY;
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2022-03-10 12:05:31.780278514 +0000
+++ 0018-net-mlx5-fix-meter-policy-creation-assert.patch 2022-03-10 12:05:31.305630868 +0000
@@ -1 +1 @@
-From 9267617bb0a6918ee049b1a16062bf0185e2e843 Mon Sep 17 00:00:00 2001
+From 3bd5cf393d0ab0152596bf2d0d8a8c2270a047d5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9267617bb0a6918ee049b1a16062bf0185e2e843 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index dd5cd9209f..23a28f6e52 100644
+index 2d682e1e81..128ebd6937 100644
@@ -29 +30 @@
-@@ -780,4 +780,6 @@ struct mlx5_flow_meter_policy {
+@@ -748,4 +748,6 @@ struct mlx5_flow_meter_policy {
@@ -37 +38 @@
-index efb988a9bb..15a4a8cd98 100644
+index cee8f00413..5b36cfa042 100644
@@ -40 +41 @@
-@@ -6297,4 +6297,6 @@ flow_create_split_meter(struct rte_eth_dev *dev,
+@@ -6070,4 +6070,6 @@ flow_create_split_meter(struct rte_eth_dev *dev,
@@ -48 +49 @@
-index 34d2c7a99f..29751e7eda 100644
+index a35fb3de4e..1ed0ebb3d9 100644
@@ -51 +52 @@
-@@ -15567,7 +15567,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
+@@ -15449,7 +15449,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
@@ -59 +60 @@
-@@ -15607,5 +15605,4 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
+@@ -15489,5 +15487,4 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
@@ -65 +66 @@
-@@ -15619,4 +15616,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
+@@ -15501,4 +15498,5 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
@@ -71 +72 @@
-@@ -15902,4 +15900,6 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
+@@ -15784,4 +15782,6 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,
More information about the stable
mailing list