All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix mbufs releasing when stop or close
@ 2018-04-23 11:23 Alejandro Lucero
  2018-04-24 14:10 ` [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Lucero @ 2018-04-23 11:23 UTC (permalink / raw)
  To: dev; +Cc: stable

PMDs have the responsabilty of releasing mbufs sent through xmit burst
function. NFP PMD attaches those sent mbufs to the TX ring structure,
and it is at the next time a specific ring descriptor is going to be
used when the previous linked mbuf, already transmitted at that point,
is released. Those mbufs belonging to a chained mbuf got its own link
to a ring descriptor, and they are released independently of the mbuf
head of that chain.

The problem is how those mbufs are released when the PMD is stopped or
closed. Instead of releasing those mbufs as the xmit functions does,
this is independently of being in a mbuf chain, the code calls
rte_pktmbuf_free which will release not just the mbuf head in that
chain but all the chained mbufs. The loop will try to release those
mbufs which have already been released again when chained mbufs exist.

This patch fixes the problem using rte_pktmbuf_free_seg instead.

Fixes: b812daadad0d ("nfp: add Rx and Tx")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 2a4b006..a5875f2 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -263,7 +263,7 @@ enum nfp_qcp_ptr {
 
 	for (i = 0; i < txq->tx_count; i++) {
 		if (txq->txbufs[i].mbuf) {
-			rte_pktmbuf_free(txq->txbufs[i].mbuf);
+			rte_pktmbuf_free_seg(txq->txbufs[i].mbuf);
 			txq->txbufs[i].mbuf = NULL;
 		}
 	}
-- 
1.9.1

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

* Re: [dpdk-stable] [PATCH] net/nfp: fix mbufs releasing when stop or close
  2018-04-23 11:23 [PATCH] net/nfp: fix mbufs releasing when stop or close Alejandro Lucero
@ 2018-04-24 14:10 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2018-04-24 14:10 UTC (permalink / raw)
  To: Alejandro Lucero, dev; +Cc: stable

On 4/23/2018 12:23 PM, Alejandro Lucero wrote:
> PMDs have the responsabilty of releasing mbufs sent through xmit burst
> function. NFP PMD attaches those sent mbufs to the TX ring structure,
> and it is at the next time a specific ring descriptor is going to be
> used when the previous linked mbuf, already transmitted at that point,
> is released. Those mbufs belonging to a chained mbuf got its own link
> to a ring descriptor, and they are released independently of the mbuf
> head of that chain.
> 
> The problem is how those mbufs are released when the PMD is stopped or
> closed. Instead of releasing those mbufs as the xmit functions does,
> this is independently of being in a mbuf chain, the code calls
> rte_pktmbuf_free which will release not just the mbuf head in that
> chain but all the chained mbufs. The loop will try to release those
> mbufs which have already been released again when chained mbufs exist.
> 
> This patch fixes the problem using rte_pktmbuf_free_seg instead.
> 
> Fixes: b812daadad0d ("nfp: add Rx and Tx")
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>

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

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

end of thread, other threads:[~2018-04-24 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 11:23 [PATCH] net/nfp: fix mbufs releasing when stop or close Alejandro Lucero
2018-04-24 14:10 ` [dpdk-stable] " 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.