patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix flow match on GRE key
@ 2020-02-18 14:45 Matan Azrad
  2020-02-19 13:07 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Matan Azrad @ 2020-02-18 14:45 UTC (permalink / raw)
  To: dev; +Cc: Viacheslav Ovsiienko, stable

The RTE_FLOW_ITEM_TYPE_GRE_KEY means that GRE key should
be present on the flow and in addition can explicitly match on the GRE
key field itself.

When no value is set in this item any GRE key should match the flow.

The match on GRE key wrongly was not added if the item fields are NULL
while at least the GRE key should be present in the flow.

Add the GRE key present match when RTE_FLOW_ITEM_TYPE_GRE_KEY is in
the flow item list.

Fixes: a7a0365565a4 ("net/mlx5: match GRE key and present bits")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index a8c8a58..402250e 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5593,13 +5593,13 @@ struct field_modify_info modify_tcp[] = {
 	void *misc_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters);
 	rte_be32_t gre_key_default_mask = RTE_BE32(UINT32_MAX);
 
+	/* GRE K bit must be on and should already be validated */
+	MLX5_SET(fte_match_set_misc, misc_m, gre_k_present, 1);
+	MLX5_SET(fte_match_set_misc, misc_v, gre_k_present, 1);
 	if (!key_v)
 		return;
 	if (!key_m)
 		key_m = &gre_key_default_mask;
-	/* GRE K bit must be on and should already be validated */
-	MLX5_SET(fte_match_set_misc, misc_m, gre_k_present, 1);
-	MLX5_SET(fte_match_set_misc, misc_v, gre_k_present, 1);
 	MLX5_SET(fte_match_set_misc, misc_m, gre_key_h,
 		 rte_be_to_cpu_32(*key_m) >> 8);
 	MLX5_SET(fte_match_set_misc, misc_v, gre_key_h,
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix flow match on GRE key
  2020-02-18 14:45 [dpdk-stable] [PATCH] net/mlx5: fix flow match on GRE key Matan Azrad
@ 2020-02-19 13:07 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2020-02-19 13:07 UTC (permalink / raw)
  To: Matan Azrad, dev; +Cc: Slava Ovsiienko, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Matan Azrad
> Sent: Tuesday, February 18, 2020 4:45 PM
> To: dev@dpdk.org
> Cc: Slava Ovsiienko <viacheslavo@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow match on GRE key
> 
> The RTE_FLOW_ITEM_TYPE_GRE_KEY means that GRE key should
> be present on the flow and in addition can explicitly match on the GRE
> key field itself.
> 
> When no value is set in this item any GRE key should match the flow.
> 
> The match on GRE key wrongly was not added if the item fields are NULL
> while at least the GRE key should be present in the flow.
> 
> Add the GRE key present match when RTE_FLOW_ITEM_TYPE_GRE_KEY is in
> the flow item list.
> 
> Fixes: a7a0365565a4 ("net/mlx5: match GRE key and present bits")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> Acked-by: Ori Kam <orika@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index a8c8a58..402250e 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -5593,13 +5593,13 @@ struct field_modify_info modify_tcp[] = {
>  	void *misc_v = MLX5_ADDR_OF(fte_match_param, key,
> misc_parameters);
>  	rte_be32_t gre_key_default_mask = RTE_BE32(UINT32_MAX);
> 
> +	/* GRE K bit must be on and should already be validated */
> +	MLX5_SET(fte_match_set_misc, misc_m, gre_k_present, 1);
> +	MLX5_SET(fte_match_set_misc, misc_v, gre_k_present, 1);
>  	if (!key_v)
>  		return;
>  	if (!key_m)
>  		key_m = &gre_key_default_mask;
> -	/* GRE K bit must be on and should already be validated */
> -	MLX5_SET(fte_match_set_misc, misc_m, gre_k_present, 1);
> -	MLX5_SET(fte_match_set_misc, misc_v, gre_k_present, 1);
>  	MLX5_SET(fte_match_set_misc, misc_m, gre_key_h,
>  		 rte_be_to_cpu_32(*key_m) >> 8);
>  	MLX5_SET(fte_match_set_misc, misc_v, gre_key_h,
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-19 13:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 14:45 [dpdk-stable] [PATCH] net/mlx5: fix flow match on GRE key Matan Azrad
2020-02-19 13:07 ` [dpdk-stable] [dpdk-dev] " Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).