All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix redundant free of Tx buffer
@ 2017-05-31 17:48 Yongseok Koh
  2017-06-01  8:08 ` Nélio Laranjeiro
  0 siblings, 1 reply; 3+ messages in thread
From: Yongseok Koh @ 2017-05-31 17:48 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: dev, adrien.mazarguil, nelio.laranjeiro, Yongseok Koh, stable

SW completion ring of Tx (txq->elts) stores individual mbufs even if a
multi-segmented packet is sent. rte_pktmbuf_free_seg() must be used when
cleaning up the completion ring. Otherwise, chained mbufs are redundantly
freed and finally it would cause a crash.

CC: stable@dpdk.org
Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_txq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 6c1387e56..bf72468d5 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -117,7 +117,7 @@ txq_free_elts(struct txq_ctrl *txq_ctrl)
 		struct rte_mbuf *elt = (*elts)[elts_tail];
 
 		assert(elt != NULL);
-		rte_pktmbuf_free(elt);
+		rte_pktmbuf_free_seg(elt);
 #ifndef NDEBUG
 		/* Poisoning. */
 		memset(&(*elts)[elts_tail],
-- 
2.11.0

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

* Re: [PATCH] net/mlx5: fix redundant free of Tx buffer
  2017-05-31 17:48 [PATCH] net/mlx5: fix redundant free of Tx buffer Yongseok Koh
@ 2017-06-01  8:08 ` Nélio Laranjeiro
  2017-06-01 10:33   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Nélio Laranjeiro @ 2017-06-01  8:08 UTC (permalink / raw)
  To: Yongseok Koh; +Cc: ferruh.yigit, dev, adrien.mazarguil, stable

On Wed, May 31, 2017 at 10:48:45AM -0700, Yongseok Koh wrote:
> SW completion ring of Tx (txq->elts) stores individual mbufs even if a
> multi-segmented packet is sent. rte_pktmbuf_free_seg() must be used when
> cleaning up the completion ring. Otherwise, chained mbufs are redundantly
> freed and finally it would cause a crash.
> 
> CC: stable@dpdk.org
> Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_txq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
> index 6c1387e56..bf72468d5 100644
> --- a/drivers/net/mlx5/mlx5_txq.c
> +++ b/drivers/net/mlx5/mlx5_txq.c
> @@ -117,7 +117,7 @@ txq_free_elts(struct txq_ctrl *txq_ctrl)
>  		struct rte_mbuf *elt = (*elts)[elts_tail];
>  
>  		assert(elt != NULL);
> -		rte_pktmbuf_free(elt);
> +		rte_pktmbuf_free_seg(elt);
>  #ifndef NDEBUG
>  		/* Poisoning. */
>  		memset(&(*elts)[elts_tail],
> -- 
> 2.11.0
 
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

-- 
Nélio Laranjeiro
6WIND

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

* Re: [PATCH] net/mlx5: fix redundant free of Tx buffer
  2017-06-01  8:08 ` Nélio Laranjeiro
@ 2017-06-01 10:33   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-06-01 10:33 UTC (permalink / raw)
  To: Nélio Laranjeiro, Yongseok Koh; +Cc: dev, adrien.mazarguil, stable

On 6/1/2017 9:08 AM, Nélio Laranjeiro wrote:
> On Wed, May 31, 2017 at 10:48:45AM -0700, Yongseok Koh wrote:
>> SW completion ring of Tx (txq->elts) stores individual mbufs even if a
>> multi-segmented packet is sent. rte_pktmbuf_free_seg() must be used when
>> cleaning up the completion ring. Otherwise, chained mbufs are redundantly
>> freed and finally it would cause a crash.
>>
>> CC: stable@dpdk.org
>> Fixes: 1d88ba171942 ("net/mlx5: refactor Tx data path")
>>
>> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>

> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2017-06-01 10:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 17:48 [PATCH] net/mlx5: fix redundant free of Tx buffer Yongseok Koh
2017-06-01  8:08 ` Nélio Laranjeiro
2017-06-01 10:33   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.