[dpdk-stable] patch 'net/mlx5: fix unnecessary init in mark conversion' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Aug 6 11:53:45 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 08/08/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 20f72df8bd3f34822de495d6021943f66e31c703 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba at mellanox.com>
Date: Tue, 21 Jul 2020 12:04:37 +0000
Subject: [PATCH] net/mlx5: fix unnecessary init in mark conversion

[ upstream commit 7301d1923a7103974077577520511d15420c7407 ]

The flow_dv_convert_action_mark function defines an array of
field_modify_info structures and initializes the first entity.

In the first entity id field, it initializes to 0, even though its type
is an enum that has no value of 0.
In fact, the function does not use this id field before assigning the
appropriate register id into it, so the initialization is unnecessary.
Moreover, this initialization is int into enum, and it would be better
not to create a type conflict for no reason.

Wait for the first entity initialization until the appropriate register
id is already known.

Fixes: 55deee1715f0 ("net/mlx5: extend flow mark support")

Signed-off-by: Michael Baum <michaelba at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 9cf38be7e..387036d0b 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1147,8 +1147,7 @@ flow_dv_convert_action_mark(struct rte_eth_dev *dev,
 		.mask = &mask,
 	};
 	struct field_modify_info reg_c_x[] = {
-		{4, 0, 0}, /* dynamic instead of MLX5_MODI_META_REG_C_1. */
-		{0, 0, 0},
+		[1] = {0, 0, 0},
 	};
 	int reg;
 
@@ -1168,7 +1167,7 @@ flow_dv_convert_action_mark(struct rte_eth_dev *dev,
 		mask = rte_cpu_to_be_32(mask) & msk_c0;
 		mask = rte_cpu_to_be_32(mask << shl_c0);
 	}
-	reg_c_x[0].id = reg_to_field[reg];
+	reg_c_x[0] = (struct field_modify_info){4, 0, reg_to_field[reg]};
 	return flow_dv_convert_modify_action(&item, reg_c_x, NULL, resource,
 					     MLX5_MODIFICATION_TYPE_SET, error);
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-06 10:53:16.454251004 +0100
+++ 0017-net-mlx5-fix-unnecessary-init-in-mark-conversion.patch	2020-08-06 10:53:15.764596689 +0100
@@ -1,8 +1,10 @@
-From 7301d1923a7103974077577520511d15420c7407 Mon Sep 17 00:00:00 2001
+From 20f72df8bd3f34822de495d6021943f66e31c703 Mon Sep 17 00:00:00 2001
 From: Michael Baum <michaelba at mellanox.com>
 Date: Tue, 21 Jul 2020 12:04:37 +0000
 Subject: [PATCH] net/mlx5: fix unnecessary init in mark conversion
 
+[ upstream commit 7301d1923a7103974077577520511d15420c7407 ]
+
 The flow_dv_convert_action_mark function defines an array of
 field_modify_info structures and initializes the first entity.
 
@@ -17,7 +19,6 @@
 id is already known.
 
 Fixes: 55deee1715f0 ("net/mlx5: extend flow mark support")
-Cc: stable at dpdk.org
 
 Signed-off-by: Michael Baum <michaelba at mellanox.com>
 Acked-by: Matan Azrad <matan at mellanox.com>
@@ -26,10 +27,10 @@
  1 file changed, 2 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
-index 2ba320d2d..53399800f 100644
+index 9cf38be7e..387036d0b 100644
 --- a/drivers/net/mlx5/mlx5_flow_dv.c
 +++ b/drivers/net/mlx5/mlx5_flow_dv.c
-@@ -1152,8 +1152,7 @@ flow_dv_convert_action_mark(struct rte_eth_dev *dev,
+@@ -1147,8 +1147,7 @@ flow_dv_convert_action_mark(struct rte_eth_dev *dev,
  		.mask = &mask,
  	};
  	struct field_modify_info reg_c_x[] = {
@@ -39,7 +40,7 @@
  	};
  	int reg;
  
-@@ -1173,7 +1172,7 @@ flow_dv_convert_action_mark(struct rte_eth_dev *dev,
+@@ -1168,7 +1167,7 @@ flow_dv_convert_action_mark(struct rte_eth_dev *dev,
  		mask = rte_cpu_to_be_32(mask) & msk_c0;
  		mask = rte_cpu_to_be_32(mask << shl_c0);
  	}


More information about the stable mailing list