DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix multiple flow table hash list
@ 2019-12-16  9:27 Xiaoyu Min
  2019-12-17  8:39 ` Matan Azrad
  2019-12-17 12:13 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Xiaoyu Min @ 2019-12-16  9:27 UTC (permalink / raw)
  To: orika, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko
  Cc: dev, stable, Zhike Wang

The eth devices which share one ibv device only need one hash list of
flow table.

Currently, flow table hash list is created per each eth device
whatever whether they share one ibv device or not.

If the devices share one ibv device, the previously created hash list
will become dangle because the pointer point to (sh->flow_tbls) is
overwritten by the later created hast list.

To fix this, just don't create hash list if it is already created.

Fixes: 54534725d2f3 ("net/mlx5: fix flow table hash list conversion")
Cc: stable@dpdk.org

Reported-by: Zhike Wang <wangzhike@jd.com>
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
---
 drivers/net/mlx5/mlx5.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index d84a6f91b4..50960c91ce 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -868,8 +868,13 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 {
 	struct mlx5_ibv_shared *sh = priv->sh;
 	char s[MLX5_HLIST_NAMESIZE];
-	int err = mlx5_alloc_table_hash_list(priv);
+	int err = 0;
 
+	if (!sh->flow_tbls)
+		err = mlx5_alloc_table_hash_list(priv);
+	else
+		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created, reuse\n",
+			(void *)sh->flow_tbls);
 	if (err)
 		return err;
 	/* Create tags hash list table. */
-- 
2.24.0


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix multiple flow table hash list
  2019-12-16  9:27 [dpdk-dev] [PATCH] net/mlx5: fix multiple flow table hash list Xiaoyu Min
@ 2019-12-17  8:39 ` Matan Azrad
  2019-12-17 12:13 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Matan Azrad @ 2019-12-17  8:39 UTC (permalink / raw)
  To: Jack Min, Ori Kam, Shahaf Shuler, Slava Ovsiienko; +Cc: dev, stable, Zhike Wang



> From: Xiaoyu Min
> The eth devices which share one ibv device only need one hash list of flow
> table.
> 
> Currently, flow table hash list is created per each eth device whatever
> whether they share one ibv device or not.
> 
> If the devices share one ibv device, the previously created hash list will
> become dangle because the pointer point to (sh->flow_tbls) is overwritten
> by the later created hast list.
> 
> To fix this, just don't create hash list if it is already created.
> 
> Fixes: 54534725d2f3 ("net/mlx5: fix flow table hash list conversion")
> Cc: stable@dpdk.org
> 
> Reported-by: Zhike Wang <wangzhike@jd.com>
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix multiple flow table hash list
  2019-12-16  9:27 [dpdk-dev] [PATCH] net/mlx5: fix multiple flow table hash list Xiaoyu Min
  2019-12-17  8:39 ` Matan Azrad
@ 2019-12-17 12:13 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2019-12-17 12:13 UTC (permalink / raw)
  To: Jack Min, Ori Kam, Matan Azrad, Shahaf Shuler, Slava Ovsiienko
  Cc: dev, stable, Zhike Wang

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiaoyu Min
> Sent: Monday, December 16, 2019 11:28 AM
> To: Ori Kam <orika@mellanox.com>; Matan Azrad <matan@mellanox.com>;
> Shahaf Shuler <shahafs@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Zhike Wang <wangzhike@jd.com>
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix multiple flow table hash list
> 
> The eth devices which share one ibv device only need one hash list of flow
> table.
> 
> Currently, flow table hash list is created per each eth device whatever
> whether they share one ibv device or not.
> 
> If the devices share one ibv device, the previously created hash list will
> become dangle because the pointer point to (sh->flow_tbls) is overwritten
> by the later created hast list.
> 
> To fix this, just don't create hash list if it is already created.
> 
> Fixes: 54534725d2f3 ("net/mlx5: fix flow table hash list conversion")
> Cc: stable@dpdk.org
> 
> Reported-by: Zhike Wang <wangzhike@jd.com>
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> d84a6f91b4..50960c91ce 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -868,8 +868,13 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv)  {
>  	struct mlx5_ibv_shared *sh = priv->sh;
>  	char s[MLX5_HLIST_NAMESIZE];
> -	int err = mlx5_alloc_table_hash_list(priv);
> +	int err = 0;
> 
> +	if (!sh->flow_tbls)
> +		err = mlx5_alloc_table_hash_list(priv);
> +	else
> +		DRV_LOG(DEBUG, "sh->flow_tbls[%p] already created,
> reuse\n",
> +			(void *)sh->flow_tbls);
>  	if (err)
>  		return err;
>  	/* Create tags hash list table. */
> --
> 2.24.0


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2019-12-17 12:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16  9:27 [dpdk-dev] [PATCH] net/mlx5: fix multiple flow table hash list Xiaoyu Min
2019-12-17  8:39 ` Matan Azrad
2019-12-17 12:13 ` 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).