From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DEC33A04B3 for ; Mon, 16 Dec 2019 10:28:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A0A041BF95; Mon, 16 Dec 2019 10:28:30 +0100 (CET) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 77A8F288C; Mon, 16 Dec 2019 10:28:27 +0100 (CET) From: Xiaoyu Min To: orika@mellanox.com, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Cc: dev@dpdk.org, stable@dpdk.org, Zhike Wang Date: Mon, 16 Dec 2019 11:27:41 +0200 Message-Id: <748a95b9f9030c78c55ddda4642915283de3f13b.1576487133.git.jackmin@mellanox.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] net/mlx5: fix multiple flow table hash list X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 Signed-off-by: Xiaoyu Min --- 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