| 3651 | } |
| 3652 | |
| 3653 | static __inline int |
| 3654 | iflib_completed_tx_reclaim(iflib_txq_t txq, int thresh) |
| 3655 | { |
| 3656 | int reclaim; |
| 3657 | if_ctx_t ctx = txq->ift_ctx; |
| 3658 | |
| 3659 | KASSERT(thresh >= 0, ("invalid threshold to reclaim")); |
| 3660 | MPASS(thresh /*+ MAX_TX_DESC(txq->ift_ctx) */ < txq->ift_size); |
| 3661 | |
| 3662 | /* |
| 3663 | * Need a rate-limiting check so that this isn't called every time |
| 3664 | */ |
| 3665 | iflib_tx_credits_update(ctx, txq); |
| 3666 | reclaim = DESC_RECLAIMABLE(txq); |
| 3667 | |
| 3668 | if (reclaim <= thresh /* + MAX_TX_DESC(txq->ift_ctx) */) { |
| 3669 | #ifdef INVARIANTS |
| 3670 | if (iflib_verbose_debug) { |
| 3671 | printf("%s processed=%ju cleaned=%ju tx_nsegments=%d reclaim=%d thresh=%d\n", __FUNCTION__, |
| 3672 | txq->ift_processed, txq->ift_cleaned, txq->ift_ctx->ifc_softc_ctx.isc_tx_nsegments, |
| 3673 | reclaim, thresh); |
| 3674 | } |
| 3675 | #endif |
| 3676 | return (0); |
| 3677 | } |
| 3678 | iflib_tx_desc_free(txq, reclaim); |
| 3679 | txq->ift_cleaned += reclaim; |
| 3680 | txq->ift_in_use -= reclaim; |
| 3681 | |
| 3682 | return (reclaim); |
| 3683 | } |
| 3684 | |
| 3685 | static struct mbuf ** |
| 3686 | _ring_peek_one(struct ifmp_ring *r, int cidx, int offset, int remaining) |
no test coverage detected