iflib: Free full mbuf chains when draining transmit queues

Submitted by:	Sai Rajesh Tallamraju <stallamr@netapp.com>
Reviewed by:	gallatin, hselasky
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D27179
This commit is contained in:
Mark Johnston 2020-11-11 18:00:06 +00:00
parent 20f02659d6
commit 54bf96fb4f

View File

@ -1781,7 +1781,7 @@ iflib_txsd_free(if_ctx_t ctx, iflib_txq_t txq, int i)
bus_dmamap_unload(txq->ift_tso_buf_tag,
txq->ift_sds.ifsd_tso_map[i]);
}
m_free(*mp);
m_freem(*mp);
DBG_COUNTER_INC(tx_frees);
*mp = NULL;
}
@ -3660,7 +3660,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx)
DBG_COUNTER_INC(txq_drain_flushing);
for (i = 0; i < avail; i++) {
if (__predict_true(r->items[(cidx + i) & (r->size-1)] != (void *)txq))
m_free(r->items[(cidx + i) & (r->size-1)]);
m_freem(r->items[(cidx + i) & (r->size-1)]);
r->items[(cidx + i) & (r->size-1)] = NULL;
}
return (avail);