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 29C27A04B1 for ; Mon, 23 Nov 2020 18:52:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F3DCBA3; Mon, 23 Nov 2020 18:52:49 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 02FA5A3 for ; Mon, 23 Nov 2020 18:52:48 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from jiaweiw@nvidia.com) with SMTP; 23 Nov 2020 19:52:45 +0200 Received: from nvidia.com (gen-l-vrt-280.mtl.labs.mlnx [10.237.45.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0ANHqj3h011841; Mon, 23 Nov 2020 19:52:45 +0200 From: Jiawei Wang To: viacheslavo@nvidia.com, shahafs@nvidia.com, matan@nvidia.com, stable@dpdk.org Cc: luca.boccassi@gmail.com Date: Mon, 23 Nov 2020 19:52:45 +0200 Message-Id: <1606153965-90811-1-git-send-email-jiaweiw@nvidia.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH 19.11] net/mlx5: free MR resource on device DMA unmap 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" [ upstream commit 992e6df3dafebf0625a59a51136a5e07a361000f ] mlx5 PMD created the MR (Memory Region) resource on the mlx5_dma_map call to make the memory available for DMA operations. On the mlx5_dma_unmap call the MR resource was not freed but inserted to MR Free list for further garbage collection. Actual MR resource destroying happened on device stop call. That caused the runtime out of memory in case of application performed multiple DMA map/unmap calls. The fix immediately frees the MR resource on mlx5_dma_unmap call not engaging the list. Fixes: 989e999d9305 ("net/mlx5: support PCI device DMA map and unmap") Signed-off-by: Jiawei Wang --- drivers/net/mlx5/mlx5_mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index 0d549b6..54a11bd 100644 --- a/drivers/net/mlx5/mlx5_mr.c +++ b/drivers/net/mlx5/mlx5_mr.c @@ -1408,7 +1408,7 @@ struct mr_update_mp_data { return -1; } LIST_REMOVE(mr, mr); - LIST_INSERT_HEAD(&sh->mr.mr_free_list, mr, mr); + mr_free(mr); DEBUG("port %u remove MR(%p) from list", dev->data->port_id, (void *)mr); mr_rebuild_dev_cache(sh); -- 1.8.3.1