Blame SOURCES/0001-net-nfp-fix-mbufs-releasing-when-stop-or-close.patch

c7ffa4
From 0c0e46c36bcc5dfe9d2aa605e1a5f714d45e0b7f Mon Sep 17 00:00:00 2001
c7ffa4
From: Alejandro Lucero <alejandro.lucero@netronome.com>
c7ffa4
Date: Mon, 23 Apr 2018 12:23:58 +0100
c7ffa4
Subject: [PATCH] net/nfp: fix mbufs releasing when stop or close
c7ffa4
c7ffa4
PMDs have the responsibility of releasing mbufs sent through xmit burst
c7ffa4
function. NFP PMD attaches those sent mbufs to the TX ring structure,
c7ffa4
and it is at the next time a specific ring descriptor is going to be
c7ffa4
used when the previous linked mbuf, already transmitted at that point,
c7ffa4
is released. Those mbufs belonging to a chained mbuf got its own link
c7ffa4
to a ring descriptor, and they are released independently of the mbuf
c7ffa4
head of that chain.
c7ffa4
c7ffa4
The problem is how those mbufs are released when the PMD is stopped or
c7ffa4
closed. Instead of releasing those mbufs as the xmit functions does,
c7ffa4
this is independently of being in a mbuf chain, the code calls
c7ffa4
rte_pktmbuf_free which will release not just the mbuf head in that
c7ffa4
chain but all the chained mbufs. The loop will try to release those
c7ffa4
mbufs which have already been released again when chained mbufs exist.
c7ffa4
c7ffa4
This patch fixes the problem using rte_pktmbuf_free_seg instead.
c7ffa4
c7ffa4
Fixes: b812daadad0d ("nfp: add Rx and Tx")
c7ffa4
Cc: stable@dpdk.org
c7ffa4
c7ffa4
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
c7ffa4
---
c7ffa4
 drivers/net/nfp/nfp_net.c | 2 +-
c7ffa4
 1 file changed, 1 insertion(+), 1 deletion(-)
c7ffa4
c7ffa4
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
c7ffa4
index 2a4b006e0..a5875f230 100644
c7ffa4
--- a/drivers/net/nfp/nfp_net.c
c7ffa4
+++ b/drivers/net/nfp/nfp_net.c
c7ffa4
@@ -263,7 +263,7 @@ nfp_net_tx_queue_release_mbufs(struct nfp_net_txq *txq)
c7ffa4
 
c7ffa4
 	for (i = 0; i < txq->tx_count; i++) {
c7ffa4
 		if (txq->txbufs[i].mbuf) {
c7ffa4
-			rte_pktmbuf_free(txq->txbufs[i].mbuf);
c7ffa4
+			rte_pktmbuf_free_seg(txq->txbufs[i].mbuf);
c7ffa4
 			txq->txbufs[i].mbuf = NULL;
c7ffa4
 		}
c7ffa4
 	}
c7ffa4
-- 
c7ffa4
2.17.0
c7ffa4