net/mlx5: fix condition to create default rule

Message ID 68c9b97142373f84eb6af76e5fcf3178bfe4e21c.1573138940.git.dekelp@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix condition to create default rule |

Checks

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

Commit Message

Dekel Peled Nov. 7, 2019, 3:04 p.m. UTC
  Previous patch added creation of a default flow rule on port start.
Rule is created under the condition that device is in eswitch mode,
and is not a VF, to make sure rule is created only once.
In Bluefield, where PF representor is used, this condition is not
sufficient. Rule is created twice, causing loss of traffic.

This patch updates this condition, adding check that device is also
not a representor.

Fixes: b67b4ecbde22 ("net/mlx5: skip table zero to improve insertion rate")

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

Comments

Slava Ovsiienko Nov. 7, 2019, 3:09 p.m. UTC | #1
> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Thursday, November 7, 2019 17:04
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org
> Subject: [PATCH] net/mlx5: fix condition to create default rule
> 
> Previous patch added creation of a default flow rule on port start.
> Rule is created under the condition that device is in eswitch mode, and is not
> a VF, to make sure rule is created only once.
> In Bluefield, where PF representor is used, this condition is not sufficient.
> Rule is created twice, causing loss of traffic.
> 
> This patch updates this condition, adding check that device is also not a
> representor.
> 
> Fixes: b67b4ecbde22 ("net/mlx5: skip table zero to improve insertion rate")
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_trigger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_trigger.c
> b/drivers/net/mlx5/mlx5_trigger.c index cafab25..f4dc047 100644
> --- a/drivers/net/mlx5/mlx5_trigger.c
> +++ b/drivers/net/mlx5/mlx5_trigger.c
> @@ -420,7 +420,7 @@
>  		}
>  		mlx5_txq_release(dev, i);
>  	}
> -	if (priv->config.dv_esw_en && !priv->config.vf)
> +	if (priv->config.dv_esw_en && !priv->config.vf && !priv-
> >representor)
>  		if (!mlx5_flow_create_esw_table_zero_flow(dev))
>  			goto error;
>  	if (priv->isolated)
> --
> 1.8.3.1
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
  
Raslan Darawsheh Nov. 7, 2019, 11:32 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Thursday, November 7, 2019 5:04 PM
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: Ori Kam <orika@mellanox.com>; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix condition to create default rule
> 
> Previous patch added creation of a default flow rule on port start.
> Rule is created under the condition that device is in eswitch mode,
> and is not a VF, to make sure rule is created only once.
> In Bluefield, where PF representor is used, this condition is not
> sufficient. Rule is created twice, causing loss of traffic.
> 
> This patch updates this condition, adding check that device is also
> not a representor.
> 
> Fixes: b67b4ecbde22 ("net/mlx5: skip table zero to improve insertion rate")
> 
> 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_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index cafab25..f4dc047 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -420,7 +420,7 @@ 
 		}
 		mlx5_txq_release(dev, i);
 	}
-	if (priv->config.dv_esw_en && !priv->config.vf)
+	if (priv->config.dv_esw_en && !priv->config.vf && !priv->representor)
 		if (!mlx5_flow_create_esw_table_zero_flow(dev))
 			goto error;
 	if (priv->isolated)