Lines Matching refs:txp

3096 	struct txpkts *txp = &txq->txp;  in set_txupdate_flags()  local
3098 if ((txp->npkt > 0 || avail < eq->sidx / 2) && in set_txupdate_flags()
3138 struct txpkts *txp = &txq->txp; in eth_tx() local
3153 for (i = 0; i < txp->npkt; i++) in eth_tx()
3154 m_freem(txp->mb[i]); in eth_tx()
3155 txp->npkt = 0; in eth_tx()
3175 txp->score = 0; in eth_tx()
3190 if (t4_tx_coalesce == 0 && txp->npkt == 0) in eth_tx()
3193 txp->score = 0; in eth_tx()
3195 if (++txp->score == 0) in eth_tx()
3196 txp->score = UINT8_MAX; in eth_tx()
3198 txp->score = 1; in eth_tx()
3199 if (txp->npkt > 0 || remaining > 1 || in eth_tx()
3200 txp->score >= t4_tx_coalesce_pkts || in eth_tx()
3211 MPASS(txp->npkt > 0); in eth_tx()
3212 for (i = 0; i < txp->npkt; i++) in eth_tx()
3213 ETHER_BPF_MTAP(ifp, txp->mb[i]); in eth_tx()
3214 if (txp->npkt > 1) { in eth_tx()
3215 MPASS(avail >= tx_len16_to_desc(txp->len16)); in eth_tx()
3222 tx_len16_to_desc(mbuf_len16(txp->mb[0]))); in eth_tx()
3225 txp->mb[0]); in eth_tx()
3227 n = write_txpkt_wr(sc, txq, txp->mb[0], in eth_tx()
3235 txp->npkt = 0; /* emptied */ in eth_tx()
3248 MPASS(txp->npkt == 0); in eth_tx()
3253 MPASS(txp->npkt == 0); in eth_tx()
3303 } else if (eq->pidx == eq->cidx && txp->npkt > 0 && in eth_tx()
3311 MPASS(txp->npkt > 0); in eth_tx()
3312 for (i = 0; i < txp->npkt; i++) in eth_tx()
3313 ETHER_BPF_MTAP(ifp, txp->mb[i]); in eth_tx()
3314 if (txp->npkt > 1) { in eth_tx()
3315 MPASS(avail >= tx_len16_to_desc(txp->len16)); in eth_tx()
3322 tx_len16_to_desc(mbuf_len16(txp->mb[0]))); in eth_tx()
3324 n = write_txpkt_vm_wr(sc, txq, txp->mb[0]); in eth_tx()
3326 n = write_txpkt_wr(sc, txq, txp->mb[0], avail); in eth_tx()
3331 txp->npkt = 0; /* emptied */ in eth_tx()
3338 *coalescing = txp->npkt > 0; in eth_tx()
4602 struct txpkts *txp; in alloc_txq() local
4666 txp = &txq->txp; in alloc_txq()
4667 MPASS(nitems(txp->mb) >= sc->params.max_pkts_per_eth_tx_pkts_wr); in alloc_txq()
4668 txq->txp.max_npkt = min(nitems(txp->mb), in alloc_txq()
4671 txq->txp.max_npkt--; in alloc_txq()
5689 cmp_l2hdr(struct txpkts *txp, struct mbuf *m) in cmp_l2hdr() argument
5693 MPASS(txp->npkt > 0); in cmp_l2hdr()
5696 if (txp->ethtype == be16toh(ETHERTYPE_VLAN)) in cmp_l2hdr()
5701 return (memcmp(m->m_data, &txp->ethmacdst[0], len) != 0); in cmp_l2hdr()
5705 save_l2hdr(struct txpkts *txp, struct mbuf *m) in save_l2hdr() argument
5709 memcpy(&txp->ethmacdst[0], mtod(m, const void *), VM_TX_L2HDR_LEN); in save_l2hdr()
5716 struct txpkts *txp = &txq->txp; in add_to_txpkts_vf() local
5721 *send = txp->npkt > 0; in add_to_txpkts_vf()
5730 if (txp->npkt > 0) { in add_to_txpkts_vf()
5731 MPASS(tx_len16_to_desc(txp->len16) <= avail); in add_to_txpkts_vf()
5732 MPASS(txp->npkt < txp->max_npkt); in add_to_txpkts_vf()
5733 MPASS(txp->wr_type == 1); /* VF supports type 1 only */ in add_to_txpkts_vf()
5735 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) > avail) { in add_to_txpkts_vf()
5740 if (m->m_pkthdr.len + txp->plen > 65535) in add_to_txpkts_vf()
5742 if (cmp_l2hdr(txp, m)) in add_to_txpkts_vf()
5745 txp->len16 += txpkts1_len16(); in add_to_txpkts_vf()
5746 txp->plen += m->m_pkthdr.len; in add_to_txpkts_vf()
5747 txp->mb[txp->npkt++] = m; in add_to_txpkts_vf()
5748 if (txp->npkt == txp->max_npkt) in add_to_txpkts_vf()
5751 txp->len16 = howmany(sizeof(struct fw_eth_tx_pkts_vm_wr), 16) + in add_to_txpkts_vf()
5753 if (tx_len16_to_desc(txp->len16) > avail) in add_to_txpkts_vf()
5755 txp->npkt = 1; in add_to_txpkts_vf()
5756 txp->wr_type = 1; in add_to_txpkts_vf()
5757 txp->plen = m->m_pkthdr.len; in add_to_txpkts_vf()
5758 txp->mb[0] = m; in add_to_txpkts_vf()
5759 save_l2hdr(txp, m); in add_to_txpkts_vf()
5768 struct txpkts *txp = &txq->txp; in add_to_txpkts_pf() local
5776 *send = txp->npkt > 0; in add_to_txpkts_pf()
5782 if (txp->npkt == 0) { in add_to_txpkts_pf()
5786 txp->wr_type = 0; in add_to_txpkts_pf()
5787 txp->len16 = in add_to_txpkts_pf()
5791 txp->wr_type = 1; in add_to_txpkts_pf()
5792 txp->len16 = in add_to_txpkts_pf()
5796 if (tx_len16_to_desc(txp->len16) > avail) in add_to_txpkts_pf()
5798 txp->npkt = 1; in add_to_txpkts_pf()
5799 txp->plen = m->m_pkthdr.len; in add_to_txpkts_pf()
5800 txp->mb[0] = m; in add_to_txpkts_pf()
5802 MPASS(tx_len16_to_desc(txp->len16) <= avail); in add_to_txpkts_pf()
5803 MPASS(txp->npkt < txp->max_npkt); in add_to_txpkts_pf()
5805 if (m->m_pkthdr.len + txp->plen > 65535) { in add_to_txpkts_pf()
5811 MPASS(txp->wr_type == 0 || txp->wr_type == 1); in add_to_txpkts_pf()
5812 if (txp->wr_type == 0) { in add_to_txpkts_pf()
5813 if (tx_len16_to_desc(txp->len16 + in add_to_txpkts_pf()
5816 txp->len16 += txpkts0_len16(nsegs); in add_to_txpkts_pf()
5820 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) > in add_to_txpkts_pf()
5823 txp->len16 += txpkts1_len16(); in add_to_txpkts_pf()
5826 txp->plen += m->m_pkthdr.len; in add_to_txpkts_pf()
5827 txp->mb[txp->npkt++] = m; in add_to_txpkts_pf()
5828 if (txp->npkt == txp->max_npkt) in add_to_txpkts_pf()
5844 const struct txpkts *txp = &txq->txp; in write_txpkts_wr() local
5855 MPASS(txp->npkt > 0); in write_txpkts_wr()
5856 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16)); in write_txpkts_wr()
5860 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16)); in write_txpkts_wr()
5861 wr->plen = htobe16(txp->plen); in write_txpkts_wr()
5862 wr->npkt = txp->npkt; in write_txpkts_wr()
5864 wr->type = txp->wr_type; in write_txpkts_wr()
5872 ndesc = tx_len16_to_desc(txp->len16); in write_txpkts_wr()
5875 for (i = 0; i < txp->npkt; i++) { in write_txpkts_wr()
5876 m = txp->mb[i]; in write_txpkts_wr()
5877 if (txp->wr_type == 0) { in write_txpkts_wr()
5937 if (txp->wr_type == 0) { in write_txpkts_wr()
5938 txq->txpkts0_pkts += txp->npkt; in write_txpkts_wr()
5941 txq->txpkts1_pkts += txp->npkt; in write_txpkts_wr()
5946 txsd->m = txp->mb[0]; in write_txpkts_wr()
5955 const struct txpkts *txp = &txq->txp; in write_txpkts_vm_wr() local
5966 MPASS(txp->npkt > 0); in write_txpkts_vm_wr()
5967 MPASS(txp->wr_type == 1); /* VF supports type 1 only */ in write_txpkts_vm_wr()
5968 MPASS(txp->mb[0] != NULL); in write_txpkts_vm_wr()
5969 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16)); in write_txpkts_vm_wr()
5973 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16)); in write_txpkts_vm_wr()
5975 wr->plen = htobe16(txp->plen); in write_txpkts_vm_wr()
5976 wr->npkt = txp->npkt; in write_txpkts_vm_wr()
5978 memcpy(&wr->ethmacdst[0], &txp->ethmacdst[0], 16); in write_txpkts_vm_wr()
5986 ndesc = tx_len16_to_desc(txp->len16); in write_txpkts_vm_wr()
5988 for (i = 0; i < txp->npkt; i++) { in write_txpkts_vm_wr()
5989 m = txp->mb[i]; in write_txpkts_vm_wr()
6023 txq->txpkts1_pkts += txp->npkt; in write_txpkts_vm_wr()
6027 txsd->m = txp->mb[0]; in write_txpkts_vm_wr()