DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: Improve i40evf buffer cleanup in tx vector mode
@ 2017-10-05 19:11 Roger B Melton
  2017-10-05 23:42 ` Roger B. Melton
  2017-10-06  8:54 ` Bruce Richardson
  0 siblings, 2 replies; 7+ messages in thread
From: Roger B Melton @ 2017-10-05 19:11 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev, Roger B Melton

---

i40evf tx vector logic frees mbufs, but it does not remove the
mbufs from software rings which leads to double frees.  This change
 corrects that oversight.  We've validated this fix within our application.

 drivers/net/i40e/i40e_rxtx_vec_common.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index 39a6da0..fdc6fce 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -127,6 +127,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
 	if (likely(m != NULL)) {
 		free[0] = m;
 		nb_free = 1;
+		txep[0].mbuf = NULL;
 		for (i = 1; i < n; i++) {
 			m = rte_pktmbuf_prefree_seg(txep[i].mbuf);
 			if (likely(m != NULL)) {
@@ -139,14 +140,17 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
 					free[0] = m;
 					nb_free = 1;
 				}
+				txep[i].mbuf = NULL;
 			}
 		}
 		rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free);
 	} else {
+		txep[0].mbuf = NULL;
 		for (i = 1; i < n; i++) {
 			m = rte_pktmbuf_prefree_seg(txep[i].mbuf);
 			if (m != NULL)
 				rte_mempool_put(m->pool, m);
+			txep[i].mbuf = NULL;
 		}
 	}
 
-- 
2.10.3.dirty

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05 19:11 [dpdk-dev] [PATCH] net/i40e: Improve i40evf buffer cleanup in tx vector mode Roger B Melton
2017-10-05 23:42 ` Roger B. Melton
2017-10-06  0:33   ` Ferruh Yigit
2017-10-06  8:54 ` Bruce Richardson
2017-10-06 12:38   ` Roger B. Melton
2017-10-06 13:51     ` Bruce Richardson
2017-10-06 14:06       ` Roger B. Melton

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