net/mlx5: remove unneeded constant definition

Message ID 020dc5f0dcd17d2780c233d780bfffcdf182753d.1566902525.git.dekelp@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: remove unneeded constant definition |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-Compile-Testing success Compile Testing PASS
ci/intel-Performance-Testing fail Performance Testing issues
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Dekel Peled Aug. 27, 2019, 10:46 a.m. UTC
  Constant MLX5_GROUP_FACTOR is defined with value 1, and used to
multiply group value in two places.

This patch removes the unneeded constant definition and use.

Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 drivers/net/mlx5/mlx5.h         | 1 -
 drivers/net/mlx5/mlx5_flow_dv.c | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)
  

Comments

Matan Azrad Aug. 27, 2019, 12:24 p.m. UTC | #1
From: Dekel Peled <dekelp@mellanox.com>
> Constant MLX5_GROUP_FACTOR is defined with value 1, and used to
> multiply group value in two places.
> 
> This patch removes the unneeded constant definition and use.
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
  
Raslan Darawsheh Sept. 5, 2019, 10:44 a.m. UTC | #2
Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Tuesday, August 27, 2019 1:47 PM
> To: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: remove unneeded constant
> definition
> 
> Constant MLX5_GROUP_FACTOR is defined with value 1, and used to
> multiply group value in two places.
> 
> This patch removes the unneeded constant definition and use.
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index d878e33..0308e5e 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -516,7 +516,6 @@  struct mlx5_flow_tbl_resource {
 
 #define MLX5_MAX_TABLES 0xffff
 #define MLX5_MAX_TABLES_FDB 0xffff
-#define MLX5_GROUP_FACTOR 1
 
 #define MLX5_DBR_PAGE_SIZE 4096 /* Must be >= 512. */
 #define MLX5_DBR_SIZE 8
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 7ae4b1c..7b2ba07 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -4476,7 +4476,7 @@  struct field_modify_info modify_tcp[] = {
 		return rte_flow_error_set(error, ENOMEM,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
 					  "cannot allocate matcher memory");
-	tbl = flow_dv_tbl_resource_get(dev, matcher->group * MLX5_GROUP_FACTOR,
+	tbl = flow_dv_tbl_resource_get(dev, matcher->group,
 				       matcher->egress, matcher->transfer,
 				       error);
 	if (!tbl) {
@@ -4866,8 +4866,7 @@  struct field_modify_info modify_tcp[] = {
 			break;
 		case RTE_FLOW_ACTION_TYPE_JUMP:
 			jump_data = action->conf;
-			tbl = flow_dv_tbl_resource_get(dev, jump_data->group *
-						       MLX5_GROUP_FACTOR,
+			tbl = flow_dv_tbl_resource_get(dev, jump_data->group,
 						       attr->egress,
 						       attr->transfer, error);
 			if (!tbl)