[v7,2/4] net/mlx5: support match GRE protocol on DR engine

Message ID a923bb70c695b3545b0e5ba905ae58561b3bcdac.1562320050.git.jackmin@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series match on GRE's key |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Xiaoyu Min July 5, 2019, 9:54 a.m. UTC
  DR engine support matching on GRE protocol field without MPLS supports.
So bypassing the MPLS check when DR is enabled.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Slava Ovsiienko July 9, 2019, 5:21 a.m. UTC | #1
> -----Original Message-----
> From: Xiaoyu Min <jackmin@mellanox.com>
> Sent: Friday, July 5, 2019 12:54
> To: Adrien Mazarguil <adrien.mazarguil@6wind.com>; Ori Kam
> <orika@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>;
> Shahaf Shuler <shahafs@mellanox.com>; Yongseok Koh
> <yskoh@mellanox.com>
> Cc: dev@dpdk.org
> Subject: [Suspected-Phishing][PATCH v7 2/4] net/mlx5: support match GRE
> protocol on DR engine
> 
> DR engine support matching on GRE protocol field without MPLS supports.
> So bypassing the MPLS check when DR is enabled.
> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_flow.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index dc48252791..0c6bf4114b 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -1610,6 +1610,7 @@ mlx5_flow_validate_item_gre(const struct
> rte_flow_item *item,
>  		 sizeof(struct rte_flow_item_gre), error);
>  	if (ret < 0)
>  		return ret;
> +#ifndef HAVE_MLX5DV_DR
>  #ifndef HAVE_IBV_DEVICE_MPLS_SUPPORT
>  	if (spec && (spec->protocol & mask->protocol))
>  		return rte_flow_error_set(error, ENOTSUP, @@ -1617,6
> +1618,7 @@ mlx5_flow_validate_item_gre(const struct rte_flow_item
> *item,
>  					  "without MPLS support the"
>  					  " specification cannot be used for"
>  					  " filtering");
> +#endif
>  #endif
>  	return 0;
>  }
> --
> 2.21.0
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index dc48252791..0c6bf4114b 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1610,6 +1610,7 @@  mlx5_flow_validate_item_gre(const struct rte_flow_item *item,
 		 sizeof(struct rte_flow_item_gre), error);
 	if (ret < 0)
 		return ret;
+#ifndef HAVE_MLX5DV_DR
 #ifndef HAVE_IBV_DEVICE_MPLS_SUPPORT
 	if (spec && (spec->protocol & mask->protocol))
 		return rte_flow_error_set(error, ENOTSUP,
@@ -1617,6 +1618,7 @@  mlx5_flow_validate_item_gre(const struct rte_flow_item *item,
 					  "without MPLS support the"
 					  " specification cannot be used for"
 					  " filtering");
+#endif
 #endif
 	return 0;
 }