Skip to contentSkip to conversation

net/i40e: improve i40evf buffer cleanup in Tx vector mode

PATCH In review Roger B Melton 2 participants 2 messages Oct 6, 2017 – Oct 10, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net/i40e: improve i40evf buffer cleanup in Tx vector mode

---
v2 - Same content as v1, but properly signed-off.

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. I've validated this fix within our application.

 drivers/net/i40e/i40e_rxtx_vec_common.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/i40e/i40e_rxtx_vec_common.h +4 -0
index 39a6da0..fdc6fce 100644
@@ -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;
 		}
 	}
 
Signature · 1 line
2.10.3.dirty