MCPcopy Create free account
hub / github.com/F-Stack/f-stack / iflib_txq_drain_free

Function iflib_txq_drain_free

freebsd/net/iflib.c:3840–3864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3838}
3839
3840static uint32_t
3841iflib_txq_drain_free(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx)
3842{
3843 int i, avail;
3844 struct mbuf **mp;
3845 iflib_txq_t txq;
3846
3847 txq = r->cookie;
3848
3849 txq->ift_qstatus = IFLIB_QUEUE_IDLE;
3850 CALLOUT_LOCK(txq);
3851 callout_stop(&txq->ift_timer);
3852 CALLOUT_UNLOCK(txq);
3853
3854 avail = IDXDIFF(pidx, cidx, r->size);
3855 for (i = 0; i < avail; i++) {
3856 mp = _ring_peek_one(r, cidx, i, avail - i);
3857 if (__predict_false(*mp == (struct mbuf *)txq))
3858 continue;
3859 m_freem(*mp);
3860 DBG_COUNTER_INC(tx_frees);
3861 }
3862 MPASS(ifmp_ring_is_stalled(r) == 0);
3863 return (avail);
3864}
3865
3866static void
3867iflib_ifmp_purge(iflib_txq_t txq)

Callers

nothing calls this directly

Calls 3

_ring_peek_oneFunction · 0.85
ifmp_ring_is_stalledFunction · 0.85
m_freemFunction · 0.50

Tested by

no test coverage detected