[dpdk-stable] patch 'net/mlx5: fix dirty array of actions' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Feb 11 12:22:00 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.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 02/13/20. 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.

Thanks.

Luca Boccassi

---
>From 9aab6dd691a5d3f3555e8c6f3ad0ffb1198ed98e Mon Sep 17 00:00:00 2001
From: Dekel Peled <dekelp at mellanox.com>
Date: Wed, 5 Feb 2020 08:42:02 +0200
Subject: [PATCH] net/mlx5: fix dirty array of actions

[ upstream commit ff44839929d0bea529be581ba784a48d085ab893 ]

Previous patch changed the format of struct
mlx5_flow_dv_modify_hdr_resource, to use a flexible array for
modification actions.
In __flow_dv_translate() a union was defined with item of this struct,
and an array of maximal possible size.
Array elements are filled in several functions.
In function flow_dv_convert_action_set_reg(), array element is filled
partially, while the other fields of this array element are left
uninitialized.
This may cause failure of flow_dv_modify_hdr_resource_register()
when calling driver function with the 'dirty' array.

This patch updates flow_dv_convert_action_set_reg(), setting the
selected array element fields while clearing the other fields.
Other functions that fill the same array elements are also updated
for clarity and proofing future use.

Fixes: 024e95759c16 ("net/mlx5: fix modify actions support limitation")

Signed-off-by: Dekel Peled <dekelp at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 7bf1aa518d..df5e279ff4 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -380,10 +380,12 @@ flow_dv_convert_modify_action(struct rte_flow_item *item,
 			 off_b - __builtin_clz(mask);
 		assert(size_b);
 		size_b = size_b == sizeof(uint32_t) * CHAR_BIT ? 0 : size_b;
-		actions[i].action_type = type;
-		actions[i].field = field->id;
-		actions[i].offset = off_b;
-		actions[i].length = size_b;
+		actions[i] = (struct mlx5_modification_cmd) {
+			.action_type = type,
+			.field = field->id,
+			.offset = off_b,
+			.length = size_b,
+		};
 		/* Convert entire record to expected big-endian format. */
 		actions[i].data0 = rte_cpu_to_be_32(actions[i].data0);
 		if (type == MLX5_MODIFICATION_TYPE_COPY) {
@@ -573,10 +575,12 @@ flow_dv_convert_action_modify_vlan_vid
 		return rte_flow_error_set(error, EINVAL,
 			 RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 			 "too many items to modify");
-	actions[i].action_type = MLX5_MODIFICATION_TYPE_SET;
-	actions[i].field = field->id;
-	actions[i].length = field->size;
-	actions[i].offset = field->offset;
+	actions[i] = (struct mlx5_modification_cmd) {
+		.action_type = MLX5_MODIFICATION_TYPE_SET,
+		.field = field->id,
+		.length = field->size,
+		.offset = field->offset,
+	};
 	actions[i].data0 = rte_cpu_to_be_32(actions[i].data0);
 	actions[i].data1 = conf->vlan_vid;
 	actions[i].data1 = actions[i].data1 << 16;
@@ -908,8 +912,10 @@ flow_dv_convert_action_set_reg
 					  "too many items to modify");
 	assert(conf->id != REG_NONE);
 	assert(conf->id < RTE_DIM(reg_to_field));
-	actions[i].action_type = MLX5_MODIFICATION_TYPE_SET;
-	actions[i].field = reg_to_field[conf->id];
+	actions[i] = (struct mlx5_modification_cmd) {
+		.action_type = MLX5_MODIFICATION_TYPE_SET,
+		.field = reg_to_field[conf->id],
+	};
 	actions[i].data0 = rte_cpu_to_be_32(actions[i].data0);
 	actions[i].data1 = rte_cpu_to_be_32(conf->data);
 	++i;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-11 11:17:44.625373626 +0000
+++ 0174-net-mlx5-fix-dirty-array-of-actions.patch	2020-02-11 11:17:38.820009200 +0000
@@ -1,8 +1,10 @@
-From ff44839929d0bea529be581ba784a48d085ab893 Mon Sep 17 00:00:00 2001
+From 9aab6dd691a5d3f3555e8c6f3ad0ffb1198ed98e Mon Sep 17 00:00:00 2001
 From: Dekel Peled <dekelp at mellanox.com>
 Date: Wed, 5 Feb 2020 08:42:02 +0200
 Subject: [PATCH] net/mlx5: fix dirty array of actions
 
+[ upstream commit ff44839929d0bea529be581ba784a48d085ab893 ]
+
 Previous patch changed the format of struct
 mlx5_flow_dv_modify_hdr_resource, to use a flexible array for
 modification actions.
@@ -21,7 +23,6 @@
 for clarity and proofing future use.
 
 Fixes: 024e95759c16 ("net/mlx5: fix modify actions support limitation")
-Cc: stable at dpdk.org
 
 Signed-off-by: Dekel Peled <dekelp at mellanox.com>
 Acked-by: Matan Azrad <matan at mellanox.com>
@@ -31,12 +32,12 @@
  1 file changed, 16 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
-index 2878393b17..3daabd3e68 100644
+index 7bf1aa518d..df5e279ff4 100644
 --- a/drivers/net/mlx5/mlx5_flow_dv.c
 +++ b/drivers/net/mlx5/mlx5_flow_dv.c
-@@ -385,10 +385,12 @@ flow_dv_convert_modify_action(struct rte_flow_item *item,
+@@ -380,10 +380,12 @@ flow_dv_convert_modify_action(struct rte_flow_item *item,
  			 off_b - __builtin_clz(mask);
- 		MLX5_ASSERT(size_b);
+ 		assert(size_b);
  		size_b = size_b == sizeof(uint32_t) * CHAR_BIT ? 0 : size_b;
 -		actions[i].action_type = type;
 -		actions[i].field = field->id;
@@ -51,7 +52,7 @@
  		/* Convert entire record to expected big-endian format. */
  		actions[i].data0 = rte_cpu_to_be_32(actions[i].data0);
  		if (type == MLX5_MODIFICATION_TYPE_COPY) {
-@@ -578,10 +580,12 @@ flow_dv_convert_action_modify_vlan_vid
+@@ -573,10 +575,12 @@ flow_dv_convert_action_modify_vlan_vid
  		return rte_flow_error_set(error, EINVAL,
  			 RTE_FLOW_ERROR_TYPE_ACTION, NULL,
  			 "too many items to modify");
@@ -68,10 +69,10 @@
  	actions[i].data0 = rte_cpu_to_be_32(actions[i].data0);
  	actions[i].data1 = conf->vlan_vid;
  	actions[i].data1 = actions[i].data1 << 16;
-@@ -913,8 +917,10 @@ flow_dv_convert_action_set_reg
+@@ -908,8 +912,10 @@ flow_dv_convert_action_set_reg
  					  "too many items to modify");
- 	MLX5_ASSERT(conf->id != REG_NONE);
- 	MLX5_ASSERT(conf->id < RTE_DIM(reg_to_field));
+ 	assert(conf->id != REG_NONE);
+ 	assert(conf->id < RTE_DIM(reg_to_field));
 -	actions[i].action_type = MLX5_MODIFICATION_TYPE_SET;
 -	actions[i].field = reg_to_field[conf->id];
 +	actions[i] = (struct mlx5_modification_cmd) {


More information about the stable mailing list