Skip to content

Commit

Permalink
net/mlx5: fix multiple flow table hash list
Browse files Browse the repository at this point in the history
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: 5453472 ("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>
  • Loading branch information
jackmin authored and Ferruh Yigit committed Jan 17, 2020
1 parent de56175 commit 6801116
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/mlx5/mlx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 6801116

Please sign in to comment.