net/mlx5: fix redundant use of directive

Message ID 1f303dbfa3900b1d435ff323a05ab166684da8b9.1564988649.git.dekelp@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix redundant use of directive |

Checks

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

Commit Message

Dekel Peled Aug. 5, 2019, 7:07 a.m. UTC
  Part of the code in function flow_dv_matcher_enable() is enclosed in
'#ifdef HAVE_MLX5DV_DR' preprocessor directive.
Using this directive is not needed here, and prevents compilation of
relevant code.

This patch removes the redundant preprocessor directive.

Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")

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

Comments

Slava Ovsiienko Aug. 5, 2019, 11:01 a.m. UTC | #1
> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Monday, August 5, 2019 10:07
> To: Yongseok Koh <yskoh@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org
> Subject: [PATCH] net/mlx5: fix redundant use of directive
> 
> Part of the code in function flow_dv_matcher_enable() is enclosed in '#ifdef
> HAVE_MLX5DV_DR' preprocessor directive.
> Using this directive is not needed here, and prevents compilation of relevant
> code.
> 
> This patch removes the redundant preprocessor directive.
> 
> Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 9c0a261..582f644 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -4324,11 +4324,9 @@ struct field_modify_info modify_tcp[] = {
>  	match_criteria_enable |=
>  		(!HEADER_IS_ZERO(match_criteria, misc_parameters_2)) <<
>  		MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT;
> -#ifdef HAVE_MLX5DV_DR
>  	match_criteria_enable |=
>  		(!HEADER_IS_ZERO(match_criteria, misc_parameters_3)) <<
>  		MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT;
> -#endif
>  	return match_criteria_enable;
>  }
> 
> --
> 1.8.3.1
  
Raslan Darawsheh Aug. 5, 2019, 12:59 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Monday, August 5, 2019 10:07 AM
> To: Yongseok Koh <yskoh@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix redundant use of directive
> 
> Part of the code in function flow_dv_matcher_enable() is enclosed in '#ifdef
> HAVE_MLX5DV_DR' preprocessor directive.
> Using this directive is not needed here, and prevents compilation of relevant
> code.
> 
> This patch removes the redundant preprocessor directive.
> 
> Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 9c0a261..582f644 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -4324,11 +4324,9 @@ struct field_modify_info modify_tcp[] = {
>  	match_criteria_enable |=
>  		(!HEADER_IS_ZERO(match_criteria, misc_parameters_2)) <<
>  		MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT;
> -#ifdef HAVE_MLX5DV_DR
>  	match_criteria_enable |=
>  		(!HEADER_IS_ZERO(match_criteria, misc_parameters_3)) <<
>  		MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT;
> -#endif
>  	return match_criteria_enable;
>  }
> 
> --
> 1.8.3.1

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 9c0a261..582f644 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -4324,11 +4324,9 @@  struct field_modify_info modify_tcp[] = {
 	match_criteria_enable |=
 		(!HEADER_IS_ZERO(match_criteria, misc_parameters_2)) <<
 		MLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT;
-#ifdef HAVE_MLX5DV_DR
 	match_criteria_enable |=
 		(!HEADER_IS_ZERO(match_criteria, misc_parameters_3)) <<
 		MLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT;
-#endif
 	return match_criteria_enable;
 }