From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id AD088A04B1
	for <public@inbox.dpdk.org>; Tue, 24 Nov 2020 12:06:05 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id A2E7DC902;
	Tue, 24 Nov 2020 12:06:04 +0100 (CET)
Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com
 [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 9A06BC902
 for <stable@dpdk.org>; Tue, 24 Nov 2020 12:06:03 +0100 (CET)
Received: by mail-wm1-f66.google.com with SMTP id x22so2030120wmc.5
 for <stable@dpdk.org>; Tue, 24 Nov 2020 03:06:03 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to
 :references:content-transfer-encoding:user-agent:mime-version;
 bh=lkLIXvEnPimXXR8k3NzztEbgoUVhggVpB8lDcMQOZC0=;
 b=YOubznnJUdykBIdFIFHLD26hlj6KjzhIxc/Q67xDk1ppu2m8GIsSxVvddvzQf9a/ab
 TAp1eVnkSyHFSeklDOJlHZfBApGpTqya4QKcM8bH9ZYNmpGGhG9qc/0CO6geMkTeNPcO
 gN9pmJ5CZyX++jGCtQdsXW9EUDJCQvhpZ9lhgsUEt+DHmH3EQg97tkuFzoAj8DJPWcqF
 IiDH4y0yyBmUo51dg1mQvKhw+buuHPHFekvU7uuHC6v2fq7gkdLSM8fZ7Xs7sm8MUCkj
 KfXYErbW62vD6jNCDFoAQkZK8iITa8dbPQPuvCt9wSM2Yp0Vo0/KomL6Lw4hz9HeNymZ
 4SWQ==
X-Gm-Message-State: AOAM5304gDpWoFBwT8U4lCu74nXOnqzRAjHM7wQFKsU002OhUmcmWxEW
 7Hda+I4R+AYo4/YJi7wI/sU=
X-Google-Smtp-Source: ABdhPJxceuPLyH0/txqPgGXw7Wifo2wyK8NgDGuhJxmHyq7QOwRuEOwUeBzW1Z6Uh/0JqDvC7MXhjA==
X-Received: by 2002:a1c:8085:: with SMTP id b127mr3768433wmd.142.1606215962030; 
 Tue, 24 Nov 2020 03:06:02 -0800 (PST)
Received: from localhost ([88.98.246.218])
 by smtp.gmail.com with ESMTPSA id w10sm26066239wra.34.2020.11.24.03.06.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 Nov 2020 03:06:01 -0800 (PST)
Message-ID: <ecd6898d801c56a92ee8fe0a10fc3144d1a29630.camel@debian.org>
From: Luca Boccassi <bluca@debian.org>
To: Jiawei Wang <jiaweiw@nvidia.com>, viacheslavo@nvidia.com, 
 shahafs@nvidia.com, matan@nvidia.com, stable@dpdk.org
Date: Tue, 24 Nov 2020 11:06:00 +0000
In-Reply-To: <1606153965-90811-1-git-send-email-jiaweiw@nvidia.com>
References: <1606153965-90811-1-git-send-email-jiaweiw@nvidia.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.30.5-1.1 
MIME-Version: 1.0
Subject: Re: [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 <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

On Mon, 2020-11-23 at 19:52 +0200, Jiawei Wang wrote:
> [ upstream commit 992e6df3dafebf0625a59a51136a5e07a361000f ]
>=20
> 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.
>=20
> The fix immediately frees the MR resource on mlx5_dma_unmap
> call not engaging the list.
>=20
> Fixes: 989e999d9305 ("net/mlx5: support PCI device DMA map and unmap")
>=20
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> 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);

Thanks, applied and pushed

--=20
Kind regards,
Luca Boccassi