| 3838 | } |
| 3839 | |
| 3840 | static uint32_t |
| 3841 | iflib_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 | |
| 3866 | static void |
| 3867 | iflib_ifmp_purge(iflib_txq_t txq) |
nothing calls this directly
no test coverage detected