Lines Matching refs:tx_credits
151 txsd->tx_credits = howmany(flowclen, 16); in send_flowc_wr()
153 KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, in send_flowc_wr()
154 ("%s: not enough credits (%d)", __func__, toep->tx_credits)); in send_flowc_wr()
155 toep->tx_credits -= txsd->tx_credits; in send_flowc_wr()
196 if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0 || in update_tx_rate_limit()
218 txsd->tx_credits = flowclen16; in update_tx_rate_limit()
220 toep->tx_credits -= txsd->tx_credits; in update_tx_rate_limit()
496 max_imm_payload(int tx_credits, int iso) in max_imm_payload() argument
501 KASSERT(tx_credits >= 0 && in max_imm_payload()
502 tx_credits <= MAX_OFLD_TX_CREDITS, in max_imm_payload()
503 ("%s: %d credits", __func__, tx_credits)); in max_imm_payload()
505 if (tx_credits < MIN_TX_CREDITS(iso)) in max_imm_payload()
508 if (tx_credits >= (n * EQ_ESIZE) / 16) in max_imm_payload()
512 return (tx_credits * 16 - sizeof(struct fw_ofld_tx_data_wr) - in max_imm_payload()
518 max_dsgl_nsegs(int tx_credits, int iso) in max_dsgl_nsegs() argument
521 int sge_pair_credits = tx_credits - MIN_TX_CREDITS(iso); in max_dsgl_nsegs()
523 KASSERT(tx_credits >= 0 && in max_dsgl_nsegs()
524 tx_credits <= MAX_OFLD_TX_CREDITS, in max_dsgl_nsegs()
525 ("%s: %d credits", __func__, tx_credits)); in max_dsgl_nsegs()
527 if (tx_credits < MIN_TX_CREDITS(iso)) in max_dsgl_nsegs()
647 int tx_credits, shove, compl, sowwakeup; in t4_push_frames() local
687 tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); in t4_push_frames()
688 max_imm = max_imm_payload(tx_credits, 0); in t4_push_frames()
689 max_nsegs = max_dsgl_nsegs(tx_credits, 0); in t4_push_frames()
844 KASSERT(toep->tx_credits >= credits, in t4_push_frames()
847 toep->tx_credits -= credits; in t4_push_frames()
850 if (toep->tx_credits <= toep->tx_total * 3 / 8 && in t4_push_frames()
869 if (toep->tx_credits < MIN_OFLD_TX_CREDITS) in t4_push_frames()
874 txsd->tx_credits = credits; in t4_push_frames()
971 int tx_credits, shove, npdu, wr_len; in write_iscsi_mbuf_wr() local
978 tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); in write_iscsi_mbuf_wr()
983 if (plen > tx_credits * 16) in write_iscsi_mbuf_wr()
995 max_imm = max_imm_payload(tx_credits, iso); in write_iscsi_mbuf_wr()
996 max_nsegs = max_dsgl_nsegs(tx_credits, iso); in write_iscsi_mbuf_wr()
1101 KASSERT(toep->tx_credits >= credits, in write_iscsi_mbuf_wr()
1105 toep->tx_credits, tx_credits, nsegs, max_nsegs, iso)); in write_iscsi_mbuf_wr()
1186 KASSERT(toep->tx_credits >= credits, in t4_push_pdus()
1193 toep->tx_credits -= credits; in t4_push_pdus()
1201 if (toep->tx_credits <= SGE_MAX_WR_LEN * 5 / 4 && in t4_push_pdus()
1210 if (toep->tx_credits < MIN_OFLD_TX_CREDITS) in t4_push_pdus()
1215 txsd->tx_credits = credits; in t4_push_pdus()
1876 KASSERT(credits >= txsd->tx_credits, in do_fw4_ack()
1878 credits -= txsd->tx_credits; in do_fw4_ack()
1879 toep->tx_credits += txsd->tx_credits; in do_fw4_ack()
1891 if (toep->tx_credits == toep->tx_total) { in do_fw4_ack()
1897 toep->tx_credits >= toep->tx_total / 4) { in do_fw4_ack()
1972 txsd->tx_credits = howmany(sizeof(*req), 16); in t4_set_tcb_field()
1974 KASSERT(toep->tx_credits >= txsd->tx_credits && in t4_set_tcb_field()
1977 toep->tx_credits)); in t4_set_tcb_field()
1978 toep->tx_credits -= txsd->tx_credits; in t4_set_tcb_field()