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 3303FA0527; Wed, 25 Nov 2020 09:27:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B4FBC940; Wed, 25 Nov 2020 09:27:03 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id 065BDC93E for ; Wed, 25 Nov 2020 09:27:01 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 25 Nov 2020 00:27:06 -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 08:26:57 +0000 From: Gregory Etelson To: CC: , , , , Viacheslav Ovsiienko , "Shahaf Shuler" Date: Wed, 25 Nov 2020 10:26:43 +0200 Message-ID: <20201125082643.7375-1-getelson@nvidia.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1606292826; bh=6zADHHBUsEl8+HlJWQAvvbH1HyzJWY25IdzaZUyNLw8=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding:Content-Type:X-Originating-IP: X-ClientProxiedBy; b=hT+hEuMD+D1PUlauISOHhRWUkIFLL9fau4mpa35yyAWvgILuSWrI/XZTT19RpZOMJ i5ksPy1IWemjOMw7K7KTcBxfeiPPD2IQPWr7kjseU+E5sDEpPSct8L70W3zPG0ByUl ylcgMvFew+AyHXjC4q1aEBclHTZSEut+uSqVP+jRft58pEf/K4mQda47Z5ZoCEhpMQ PdjGAAdblA0V15RaoUZg2PsGyTIo/+wxK2ILtOrZSs4BR6ly8rXV0kTXKtn1nmBjMz MeN77UfDrIWqbTZm6PgM4bMIKidfI1KZCCVgeFKKAiIQqFBPJ0elWAKmMnFUQ5ctyu ybUt3gTm/qVPg== Subject: [dpdk-dev] [PATCH] 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 tunnel offload object can be referenced by application tunnel_decap_set or tunnel_match commands, when these commands request private tunnel items or actions and flow rules related to that tunnel. PMD keeps tunnel offload object as long as there is an active reference to that tunnel. PMD releases tunnel offload object after the last reference resumes. The patch removes tunnel offload object from search database before it's memory released. 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, =20 DRV_LOG(DEBUG, "port %u release pmd tunnel id=3D0x%x", dev->data->port_id, tunnel->tunnel_id); + LIST_REMOVE(tunnel, chain); mlx5_hlist_destroy(tunnel->groups); ipool =3D priv->sh->ipool[MLX5_IPOOL_TUNNEL_ID]; mlx5_ipool_free(ipool, tunnel->tunnel_id); --=20 2.29.2