patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 19.11] net/mlx5: free MR resource on device DMA unmap
@ 2020-11-23 17:14 Jiawei Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jiawei Wang @ 2020-11-23 17:14 UTC (permalink / raw)
  To: jiaweiw; +Cc: 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")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH 19.11] net/mlx5: free MR resource on device DMA unmap
  2020-11-23 17:52 Jiawei Wang
@ 2020-11-24 11:06 ` Luca Boccassi
  0 siblings, 0 replies; 3+ messages in thread
From: Luca Boccassi @ 2020-11-24 11:06 UTC (permalink / raw)
  To: Jiawei Wang, viacheslavo, shahafs, matan, stable

On Mon, 2020-11-23 at 19:52 +0200, Jiawei Wang wrote:
> [ 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 <jiaweiw@nvidia.com>
> ---
>  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);

Thanks, applied and pushed

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-stable] [PATCH 19.11] net/mlx5: free MR resource on device DMA unmap
@ 2020-11-23 17:52 Jiawei Wang
  2020-11-24 11:06 ` Luca Boccassi
  0 siblings, 1 reply; 3+ messages in thread
From: Jiawei Wang @ 2020-11-23 17:52 UTC (permalink / raw)
  To: viacheslavo, shahafs, matan, stable; +Cc: luca.boccassi

[ 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 <jiaweiw@nvidia.com>
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-24 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 17:14 [dpdk-stable] [PATCH 19.11] net/mlx5: free MR resource on device DMA unmap Jiawei Wang
2020-11-23 17:52 Jiawei Wang
2020-11-24 11:06 ` Luca Boccassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).