patch 'net/mlx5/hws: fix pattern creation' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Sun Apr 9 17:25:17 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.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 04/11/23. 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=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/d4335766d408b7586fa0af976a612bda42611d27

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d4335766d408b7586fa0af976a612bda42611d27 Mon Sep 17 00:00:00 2001
From: Erez Shitrit <erezsh at nvidia.com>
Date: Wed, 22 Mar 2023 16:41:17 +0200
Subject: [PATCH] net/mlx5/hws: fix pattern creation
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 97e1a2ffc6615e1ace06049ee443af6551496194 ]

When creating a new pattern the data area should be clean, otherwise
when the data will come from the arg object it will do OR operation on
the data part in the pattern and use the dirty area as is.

Now we clean the data area on each pattern creation.

Fixes: f8c8a6d8440d ("net/mlx5/hws: add action object")

Signed-off-by: Erez Shitrit <erezsh at nvidia.com>
Reviewed-by: Alex Vesker <valex at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_cmd.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index 721376b8da..acad42e12e 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -507,9 +507,11 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
 	uint32_t in[MLX5_ST_SZ_DW(create_header_modify_pattern_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {0};
 	struct mlx5dr_devx_obj *devx_obj;
-	void *pattern_data;
+	uint64_t *pattern_data;
+	int num_of_actions;
 	void *pattern;
 	void *attr;
+	int i;
 
 	if (pattern_length > MAX_ACTIONS_DATA_IN_HEADER_MODIFY) {
 		DR_LOG(ERR, "Pattern length %d exceeds limit %d",
@@ -535,9 +537,19 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
 	/* Pattern_length is in ddwords */
 	MLX5_SET(header_modify_pattern_in, pattern, pattern_length, pattern_length / (2 * DW_SIZE));
 
-	pattern_data = MLX5_ADDR_OF(header_modify_pattern_in, pattern, pattern_data);
+	pattern_data = (uint64_t *)MLX5_ADDR_OF(header_modify_pattern_in, pattern, pattern_data);
 	memcpy(pattern_data, actions, pattern_length);
 
+	num_of_actions = pattern_length / MLX5DR_MODIFY_ACTION_SIZE;
+	for (i = 0; i < num_of_actions; i++) {
+		int type;
+
+		type = MLX5_GET(set_action_in, &pattern_data[i], action_type);
+		if (type != MLX5_MODIFICATION_TYPE_COPY)
+			/* Action typ-copy use all bytes for control */
+			MLX5_SET(set_action_in, &pattern_data[i], data, 0);
+	}
+
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
 		DR_LOG(ERR, "Failed to create header_modify_pattern");
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.068737600 +0800
+++ 0129-net-mlx5-hws-fix-pattern-creation.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From 97e1a2ffc6615e1ace06049ee443af6551496194 Mon Sep 17 00:00:00 2001
+From d4335766d408b7586fa0af976a612bda42611d27 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 97e1a2ffc6615e1ace06049ee443af6551496194 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +25 @@
-index a444fb4438..0adcedd9c9 100644
+index 721376b8da..acad42e12e 100644
@@ -26 +28 @@
-@@ -523,9 +523,11 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
+@@ -507,9 +507,11 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
@@ -39 +41 @@
-@@ -551,9 +553,19 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
+@@ -535,9 +537,19 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,


More information about the stable mailing list