patch 'net/mlx5/hws: fix check of range templates' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Mon Aug 12 14:49:58 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=dcd02c715e00c5d2609a90248aff83980e1f2178
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From dcd02c715e00c5d2609a90248aff83980e1f2178 Mon Sep 17 00:00:00 2001
From: Itamar Gozlan <igozlan at nvidia.com>
Date: Tue, 9 Jul 2024 15:30:58 +0300
Subject: [PATCH] net/mlx5/hws: fix check of range templates
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 2cb66e444aa9066f697e157c51525126479b6dde ]
Using range and non range templates is not allowed, and in HWS there is a
check that enforce that limitation with constantly check that, in a loop,
if the current template defined as range, the last one
should also be defined as range.
But, in the case where there are two templates in the following order:
(1) template with range, and (2) template without range.
The existing checks will not cover this case.
This commit fixes that hole by maintain the invariant that if a template
without a range exist, all the previous match template are also.
Fixes: 9732ffe13bd6 ("net/mlx5/hws: add range definer creation")
Signed-off-by: Itamar Gozlan <igozlan at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_definer.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 003b50623c..031e87bc0c 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -3206,15 +3206,18 @@ mlx5dr_definer_matcher_range_init(struct mlx5dr_context *ctx,
/* Create optional range definers */
for (i = 0; i < matcher->num_of_mt; i++) {
- if (!mt[i].fcr_sz)
- continue;
-
/* All must use range if requested */
- if (i && !mt[i - 1].range_definer) {
+ bool is_range = !!mt[i].fcr_sz;
+ bool has_range = matcher->flags & MLX5DR_MATCHER_FLAGS_RANGE_DEFINER;
+
+ if (i && ((is_range && !has_range) || (!is_range && has_range))) {
DR_LOG(ERR, "Using range and non range templates is not allowed");
goto free_definers;
}
+ if (!mt[i].fcr_sz)
+ continue;
+
matcher->flags |= MLX5DR_MATCHER_FLAGS_RANGE_DEFINER;
/* Create definer without fcr binding, already binded */
mt[i].range_definer = mlx5dr_definer_alloc(ctx,
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-12 20:44:06.333529595 +0800
+++ 0121-net-mlx5-hws-fix-check-of-range-templates.patch 2024-08-12 20:44:02.495069373 +0800
@@ -1 +1 @@
-From 2cb66e444aa9066f697e157c51525126479b6dde Mon Sep 17 00:00:00 2001
+From dcd02c715e00c5d2609a90248aff83980e1f2178 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 2cb66e444aa9066f697e157c51525126479b6dde ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index 9ebda9267d..51a3f7be4b 100644
+index 003b50623c..031e87bc0c 100644
@@ -29 +31 @@
-@@ -4041,15 +4041,18 @@ mlx5dr_definer_matcher_range_init(struct mlx5dr_context *ctx,
+@@ -3206,15 +3206,18 @@ mlx5dr_definer_matcher_range_init(struct mlx5dr_context *ctx,
More information about the stable
mailing list