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

Function iflib_completed_tx_reclaim

freebsd/net/iflib.c:3653–3683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3651}
3652
3653static __inline int
3654iflib_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
3685static struct mbuf **
3686_ring_peek_one(struct ifmp_ring *r, int cidx, int offset, int remaining)

Callers 2

iflib_txq_drainFunction · 0.85
iflib_debugnet_pollFunction · 0.85

Calls 3

iflib_tx_credits_updateFunction · 0.85
iflib_tx_desc_freeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected