DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] nfp: fixing a bug when gather
@ 2016-04-26 13:06 Alejandro Lucero
  2016-05-03 14:50 ` Bruce Richardson
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Lucero @ 2016-04-26 13:06 UTC (permalink / raw)
  To: dev

mbufs where not properly released when they are chained.

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

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 559ebe6..1259d2c 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -323,7 +323,7 @@ nfp_net_tx_queue_release_mbufs(struct nfp_net_txq *txq)
 
 	for (i = 0; i < txq->tx_count; i++) {
 		if (txq->txbufs[i].mbuf) {
-			rte_pktmbuf_free_seg(txq->txbufs[i].mbuf);
+			rte_pktmbuf_free(txq->txbufs[i].mbuf);
 			txq->txbufs[i].mbuf = NULL;
 		}
 	}
@@ -1976,11 +1976,16 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		 */
 		pkt_size = pkt->pkt_len;
 
-		while (pkt_size) {
-			/* Releasing mbuf which was prefetched above */
-			if (*lmbuf)
-				rte_pktmbuf_free_seg(*lmbuf);
+		/* Releasing mbuf which was prefetched above */
+		if (*lmbuf)
+			rte_pktmbuf_free(*lmbuf);
+		/*
+		 * Linking mbuf with descriptor for being released
+		 * next time descriptor is used
+		 */
+		*lmbuf = pkt;
 
+		while (pkt_size) {
 			dma_size = pkt->data_len;
 			dma_addr = rte_mbuf_data_dma_addr(pkt);
 			PMD_TX_LOG(DEBUG, "Working with mbuf at dma address:"
@@ -1994,12 +1999,6 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 			ASSERT(free_descs > 0);
 			free_descs--;
 
-			/*
-			 * Linking mbuf with descriptor for being released
-			 * next time descriptor is used
-			 */
-			*lmbuf = pkt;
-
 			txq->wr_p++;
 			txq->tail++;
 			if (unlikely(txq->tail == txq->tx_count)) /* wrapping?*/
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH] nfp: fixing a bug when gather
  2016-04-26 13:06 [dpdk-dev] [PATCH] nfp: fixing a bug when gather Alejandro Lucero
@ 2016-05-03 14:50 ` Bruce Richardson
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Richardson @ 2016-05-03 14:50 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: dev

On Tue, Apr 26, 2016 at 02:06:36PM +0100, Alejandro Lucero wrote:
> mbufs where not properly released when they are chained.
> 
> Fixes: b812daadad0d ("nfp: add Rx and Tx")
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> ---
>  drivers/net/nfp/nfp_net.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)

Applied to dpdk-next-net/rel_16_07

/Bruce

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

end of thread, other threads:[~2016-05-03 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 13:06 [dpdk-dev] [PATCH] nfp: fixing a bug when gather Alejandro Lucero
2016-05-03 14:50 ` Bruce Richardson

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).