tx_credits
txsd->tx_credits = howmany(wrsize, 16);
KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0,
("%s: not enough credits (%d)", __func__, toep->tx_credits));
toep->tx_credits -= txsd->tx_credits;
txsd->tx_credits, toep->tx_credits, toep->txsd_pidx);
uint8_t tx_credits; /* tx WR credits (in 16B units) available */
cst->tx_credits = sc->params.eo_wr_cred;
cst->tx_total = cst->tx_credits;
(cst->tx_total - cst->tx_credits) * CST_TO_MST_QLEVEL_SCALE;
MPASS(cst->tx_credits == cst->tx_total);
if (cst->tx_credits == cst->tx_total) {
MPASS(cst->tx_credits >= ETID_FLOWC_LEN16); /* flowc is first WR. */
cst->tx_credits -= ETID_FLOWC_LEN16;
MPASS(cst->tx_credits >= ETID_FLUSH_LEN16);
cst->tx_credits -= ETID_FLUSH_LEN16;
if (next_credits > cst->tx_credits) {
cst->tx_credits -= next_credits;
MPASS(cst->tx_credits + cpl->credits == cst->tx_total);
cst->tx_credits += cpl->credits;
cst->tx_credits += cpl->credits;
MPASS(cst->tx_credits <= cst->tx_total);
if (m != NULL && cst->tx_credits >= mbuf_eo_len16(m))
int tx_credits, shove, npdu, wr_len;
tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS);
if (plen > tx_credits * 16)
max_imm = max_imm_payload(tx_credits, iso);
max_nsegs = max_dsgl_nsegs(tx_credits, iso);
KASSERT(toep->tx_credits >= credits,
toep->tx_credits, tx_credits, nsegs, max_nsegs, iso));
int tx_credits, shove, npdu, wr_len;
tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS);
if (plen > tx_credits * 16)
max_imm = max_imm_payload(tx_credits, iso);
max_nsegs = max_dsgl_nsegs(tx_credits, iso);
KASSERT(toep->tx_credits >= credits,
toep->tx_credits, tx_credits, nsegs, max_nsegs, iso));
KASSERT(toep->tx_credits >= credits,
toep->tx_credits -= credits;
if (toep->tx_credits <= SGE_MAX_WR_LEN * 5 / 4 &&
if (toep->tx_credits < MIN_OFLD_TX_CREDITS)
txsd->tx_credits = credits;
txsd->tx_credits = howmany(flowclen, 16);
KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0,
("%s: not enough credits (%d)", __func__, toep->tx_credits));
toep->tx_credits -= txsd->tx_credits;
if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0 ||
KASSERT(credits >= txsd->tx_credits,
credits -= txsd->tx_credits;
toep->tx_credits += txsd->tx_credits;
if (toep->tx_credits == toep->tx_total) {
toep->tx_credits >= toep->tx_total / 4) {
txsd->tx_credits = flowclen16;
toep->tx_credits -= txsd->tx_credits;
txsd->tx_credits = howmany(len, 16);
KASSERT(toep->tx_credits >= txsd->tx_credits &&
toep->tx_credits));
toep->tx_credits -= txsd->tx_credits;
max_imm_payload(int tx_credits, int iso)
KASSERT(tx_credits >= 0 &&
tx_credits <= MAX_OFLD_TX_CREDITS,
("%s: %d credits", __func__, tx_credits));
if (tx_credits < MIN_TX_CREDITS(iso))
if (tx_credits >= (n * EQ_ESIZE) / 16)
return (tx_credits * 16 - sizeof(struct fw_ofld_tx_data_wr) -
max_dsgl_nsegs(int tx_credits, int iso)
int sge_pair_credits = tx_credits - MIN_TX_CREDITS(iso);
KASSERT(tx_credits >= 0 &&
tx_credits <= MAX_OFLD_TX_CREDITS,
("%s: %d credits", __func__, tx_credits));
if (tx_credits < MIN_TX_CREDITS(iso))
if (credits > toep->tx_credits)
toep->tx_credits -= credits;
if (toep->tx_credits < MIN_OFLD_TX_CREDITS)
txsd->tx_credits = credits;
int tx_credits, shove, compl, sowwakeup;
tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS);
max_imm = max_imm_payload(tx_credits, 0);
max_nsegs = max_dsgl_nsegs(tx_credits, 0);
KASSERT(toep->tx_credits >= credits,
toep->tx_credits -= credits;
if (toep->tx_credits <= toep->tx_total * 3 / 8 &&
if (toep->tx_credits < MIN_OFLD_TX_CREDITS)
txsd->tx_credits = credits;
int tls_size, tx_credits, shove, sowwakeup;
tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS);
if (howmany(wr_len, 16) > tx_credits) {
tx_credits);
KASSERT(toep->tx_credits >= credits,
toep->tx_credits -= credits;
if (toep->tx_credits < MIN_OFLD_TLSTX_CREDITS(toep))
txsd->tx_credits = credits;
int tx_credits, txsd_total, len;
tx_credits = sc->params.ofldq_wr_cred;
tx_credits -= howmany(sizeof(struct cpl_abort_req), 16);
txsd_total = tx_credits /
toep->tx_total = tx_credits;
toep->tx_credits = tx_credits;
txsd->tx_credits = howmany(flowclen, 16);
KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0,
("%s: not enough credits (%d)", __func__, toep->tx_credits));
toep->tx_credits -= txsd->tx_credits;
if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0) {
toep->tid, toep->tx_credits, toep->txsd_avail);
txsd->tx_credits = flowclen16;
toep->tx_credits -= txsd->tx_credits;
uint32_t tx_credits : 6; /* firmware tx credits (unit is 16B) */
u_int tx_credits; /* tx WR credits (in 16B units) available */
tx_credits(ssk), tx_ring_posted(ssk));
min_free = MIN(tx_credits(ssk),
likely(tx_credits(ssk) > 0) &&
tx_credits(ssk) >= SDP_MIN_TX_CREDITS &&
if (tx_credits(ssk) <= SDP_MIN_TX_CREDITS &&
while (tx_credits(ssk) > SDP_MIN_TX_CREDITS &&
tx_credits(ssk) > 1) {
ssk->min_bufs = tx_credits(ssk) / 4;
ssk->min_bufs = tx_credits(ssk) / 4;
SDPSTATS_HIST_LINEAR(credits_before_update, tx_credits(ssk));
credits_before = tx_credits(ssk);
tx_credits(ssk), ntohl(h->mseq), ntohl(h->mseq_ack));
if (tx_credits(ssk) >= ssk->min_bufs && sk)
xmit_poll_force = tx_credits(ssk) < SDP_MIN_TX_CREDITS;
credits_before = tx_credits(ssk);
credits_before, tx_credits(ssk));