From patchwork Wed Nov 25 09:44:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Etelson X-Patchwork-Id: 84545 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90FF2A0527; Wed, 25 Nov 2020 10:44:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFAD4C940; Wed, 25 Nov 2020 10:44:48 +0100 (CET) Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by dpdk.org (Postfix) with ESMTP id 3A0C9C93E for ; Wed, 25 Nov 2020 10:44:46 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 25 Nov 2020 01:44:44 -0800 Received: from nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 25 Nov 2020 09:44:42 +0000 From: Gregory Etelson To: CC: , , , , Viacheslav Ovsiienko , "Shahaf Shuler" Date: Wed, 25 Nov 2020 11:44:27 +0200 Message-ID: <20201125094427.7975-1-getelson@nvidia.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201125082643.7375-1-getelson@nvidia.com> References: <20201125082643.7375-1-getelson@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1606297484; bh=J7QdCWiSTZCdIcJrSKC2bzIj0jY6erXnx3axa5GwdBg=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=pZ2lWx2+nXl/eZ1hneckFy8w9Xr5zGWFe+oAD7yEbf48lrHWbgPINlM6YKinPr1Ov shOE5mXg8qXVoBtGyzBrreY6BiksIB2r8CHDA9P0TUFiE5UwkNkVHp5kaAM2wUxYKq VuVb7xvPM51BXlR0vEveagjAz5Wv/1cnuV9PbUmUu643hbr1IUIbV+Gf5njuPBr2rA XrqiG1mvIHfjtSNBaoAx+foN0/SKqtLezLUy2eQcq4McxqSCvESetWG2X7gD8dxnr1 4C/paZrh0Cm2gmqrxd/6X3l0YgSH4P9LQqujTQXij/66CXuP3pbJuaAn6uCU3HUohf FQEEQqonfn2zg== Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix memory management for released offloaded tunnels. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" PMD did not remove tunnel offload object from tunnels database before it released the object memory. As the result, the tunnels database become corrupted and subsequent search operations triggered PMD crash. The patch removes tunnel offload object from the tunnels database when the object is not in-use by PMD any more. Fixes: bc1d90a3cf6f ("net/mlx5: fix build with Direct Verbs disabled") Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 642516ad4b..52ade39a42 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -7423,6 +7423,7 @@ mlx5_flow_tunnel_free(struct rte_eth_dev *dev, DRV_LOG(DEBUG, "port %u release pmd tunnel id=0x%x", dev->data->port_id, tunnel->tunnel_id); + LIST_REMOVE(tunnel, chain); mlx5_hlist_destroy(tunnel->groups); ipool = priv->sh->ipool[MLX5_IPOOL_TUNNEL_ID]; mlx5_ipool_free(ipool, tunnel->tunnel_id);