[dpdk-dev] [PATCH v2] common/mlx5: free MR resource while device DMA unmap

Raslan Darawsheh rasland at nvidia.com
Thu Nov 5 14:25:31 CET 2020


Hi,

> -----Original Message-----
> From: Jiawei Wang <jiaweiw at nvidia.com>
> Sent: Monday, November 2, 2020 4:22 AM
> To: Slava Ovsiienko <viacheslavo at nvidia.com>; Matan Azrad
> <matan at nvidia.com>; Shahaf Shuler <shahafs at nvidia.com>; Ori Kam
> <orika at nvidia.com>
> Cc: dev at dpdk.org; Raslan Darawsheh <rasland at nvidia.com>;
> stable at dpdk.org
> Subject: [PATCH v2] common/mlx5: free MR resource while device DMA
> unmap
> 
> 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. The export for mlx5_mr_free
> function from common PMD part is added as well.
> 
> Fixes: 989e999d9305 ("net/mlx5: support PCI device DMA map and unmap")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw at nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
> ---
>  drivers/common/mlx5/mlx5_common_mr.c | 12 ++++++------
>  drivers/common/mlx5/mlx5_common_mr.h |  4 ++++
>  drivers/common/mlx5/version.map      |  1 +
>  drivers/net/mlx5/mlx5_mr.c           |  2 +-
>  4 files changed, 12 insertions(+), 7 deletions(-)
> 

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh


More information about the dev mailing list