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

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