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

Function iflib_txd_db_check

freebsd/net/iflib.c:3078–3106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3076 (ctx)->ifc_softc_ctx.isc_tx_nsegments)
3077
3078static inline bool
3079iflib_txd_db_check(iflib_txq_t txq, int ring)
3080{
3081 if_ctx_t ctx = txq->ift_ctx;
3082 qidx_t dbval, max;
3083
3084 max = TXQ_MAX_DB_DEFERRED(txq, txq->ift_in_use);
3085
3086 /* force || threshold exceeded || at the edge of the ring */
3087 if (ring || (txq->ift_db_pending >= max) || (TXQ_AVAIL(txq) <= MAX_TX_DESC(ctx) + 2)) {
3088
3089 /*
3090 * 'npending' is used if the card's doorbell is in terms of the number of descriptors
3091 * pending flush (BRCM). 'pidx' is used in cases where the card's doorbeel uses the
3092 * producer index explicitly (INTC).
3093 */
3094 dbval = txq->ift_npending ? txq->ift_npending : txq->ift_pidx;
3095 bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map,
3096 BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
3097 ctx->isc_txd_flush(ctx->ifc_softc, txq->ift_id, dbval);
3098
3099 /*
3100 * Absent bugs there are zero packets pending so reset pending counts to zero.
3101 */
3102 txq->ift_db_pending = txq->ift_npending = 0;
3103 return (true);
3104 }
3105 return (false);
3106}
3107
3108#ifdef PKT_DEBUG
3109static void

Callers 2

iflib_txq_drainFunction · 0.85
iflib_debugnet_transmitFunction · 0.85

Calls 1

bus_dmamap_syncFunction · 0.50

Tested by

no test coverage detected