Lines Matching full: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()
4600 struct txpkts *txp; in alloc_txq() local
4664 txp = &txq->txp; in alloc_txq()
4665 MPASS(nitems(txp->mb) >= sc->params.max_pkts_per_eth_tx_pkts_wr); in alloc_txq()
4666 txq->txp.max_npkt = min(nitems(txp->mb), in alloc_txq()
4669 txq->txp.max_npkt--; in alloc_txq()
5687 cmp_l2hdr(struct txpkts *txp, struct mbuf *m) in cmp_l2hdr() argument
5691 MPASS(txp->npkt > 0); in cmp_l2hdr()
5694 if (txp->ethtype == be16toh(ETHERTYPE_VLAN)) in cmp_l2hdr()
5699 return (memcmp(m->m_data, &txp->ethmacdst[0], len) != 0); in cmp_l2hdr()
5703 save_l2hdr(struct txpkts *txp, struct mbuf *m) in save_l2hdr() argument
5707 memcpy(&txp->ethmacdst[0], mtod(m, const void *), VM_TX_L2HDR_LEN); in save_l2hdr()
5714 struct txpkts *txp = &txq->txp; in add_to_txpkts_vf() local
5719 *send = txp->npkt > 0; in add_to_txpkts_vf()
5728 if (txp->npkt > 0) { in add_to_txpkts_vf()
5729 MPASS(tx_len16_to_desc(txp->len16) <= avail); in add_to_txpkts_vf()
5730 MPASS(txp->npkt < txp->max_npkt); in add_to_txpkts_vf()
5731 MPASS(txp->wr_type == 1); /* VF supports type 1 only */ in add_to_txpkts_vf()
5733 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) > avail) { in add_to_txpkts_vf()
5738 if (m->m_pkthdr.len + txp->plen > 65535) in add_to_txpkts_vf()
5740 if (cmp_l2hdr(txp, m)) in add_to_txpkts_vf()
5743 txp->len16 += txpkts1_len16(); in add_to_txpkts_vf()
5744 txp->plen += m->m_pkthdr.len; in add_to_txpkts_vf()
5745 txp->mb[txp->npkt++] = m; in add_to_txpkts_vf()
5746 if (txp->npkt == txp->max_npkt) in add_to_txpkts_vf()
5749 txp->len16 = howmany(sizeof(struct fw_eth_tx_pkts_vm_wr), 16) + in add_to_txpkts_vf()
5751 if (tx_len16_to_desc(txp->len16) > avail) in add_to_txpkts_vf()
5753 txp->npkt = 1; in add_to_txpkts_vf()
5754 txp->wr_type = 1; in add_to_txpkts_vf()
5755 txp->plen = m->m_pkthdr.len; in add_to_txpkts_vf()
5756 txp->mb[0] = m; in add_to_txpkts_vf()
5757 save_l2hdr(txp, m); in add_to_txpkts_vf()
5766 struct txpkts *txp = &txq->txp; in add_to_txpkts_pf() local
5774 *send = txp->npkt > 0; in add_to_txpkts_pf()
5780 if (txp->npkt == 0) { in add_to_txpkts_pf()
5784 txp->wr_type = 0; in add_to_txpkts_pf()
5785 txp->len16 = in add_to_txpkts_pf()
5789 txp->wr_type = 1; in add_to_txpkts_pf()
5790 txp->len16 = in add_to_txpkts_pf()
5794 if (tx_len16_to_desc(txp->len16) > avail) in add_to_txpkts_pf()
5796 txp->npkt = 1; in add_to_txpkts_pf()
5797 txp->plen = m->m_pkthdr.len; in add_to_txpkts_pf()
5798 txp->mb[0] = m; in add_to_txpkts_pf()
5800 MPASS(tx_len16_to_desc(txp->len16) <= avail); in add_to_txpkts_pf()
5801 MPASS(txp->npkt < txp->max_npkt); in add_to_txpkts_pf()
5803 if (m->m_pkthdr.len + txp->plen > 65535) { in add_to_txpkts_pf()
5809 MPASS(txp->wr_type == 0 || txp->wr_type == 1); in add_to_txpkts_pf()
5810 if (txp->wr_type == 0) { in add_to_txpkts_pf()
5811 if (tx_len16_to_desc(txp->len16 + in add_to_txpkts_pf()
5814 txp->len16 += txpkts0_len16(nsegs); in add_to_txpkts_pf()
5818 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) > in add_to_txpkts_pf()
5821 txp->len16 += txpkts1_len16(); in add_to_txpkts_pf()
5824 txp->plen += m->m_pkthdr.len; in add_to_txpkts_pf()
5825 txp->mb[txp->npkt++] = m; in add_to_txpkts_pf()
5826 if (txp->npkt == txp->max_npkt) in add_to_txpkts_pf()
5833 * Write a txpkts WR for the packets in txp to the hardware descriptors, update
5842 const struct txpkts *txp = &txq->txp; in write_txpkts_wr() local
5853 MPASS(txp->npkt > 0); in write_txpkts_wr()
5854 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16)); in write_txpkts_wr()
5858 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16)); in write_txpkts_wr()
5859 wr->plen = htobe16(txp->plen); in write_txpkts_wr()
5860 wr->npkt = txp->npkt; in write_txpkts_wr()
5862 wr->type = txp->wr_type; in write_txpkts_wr()
5870 ndesc = tx_len16_to_desc(txp->len16); in write_txpkts_wr()
5873 for (i = 0; i < txp->npkt; i++) { in write_txpkts_wr()
5874 m = txp->mb[i]; in write_txpkts_wr()
5875 if (txp->wr_type == 0) { in write_txpkts_wr()
5935 if (txp->wr_type == 0) { in write_txpkts_wr()
5936 txq->txpkts0_pkts += txp->npkt; in write_txpkts_wr()
5939 txq->txpkts1_pkts += txp->npkt; in write_txpkts_wr()
5944 txsd->m = txp->mb[0]; in write_txpkts_wr()
5953 const struct txpkts *txp = &txq->txp; in write_txpkts_vm_wr() local
5964 MPASS(txp->npkt > 0); in write_txpkts_vm_wr()
5965 MPASS(txp->wr_type == 1); /* VF supports type 1 only */ in write_txpkts_vm_wr()
5966 MPASS(txp->mb[0] != NULL); in write_txpkts_vm_wr()
5967 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16)); in write_txpkts_vm_wr()
5971 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16)); in write_txpkts_vm_wr()
5973 wr->plen = htobe16(txp->plen); in write_txpkts_vm_wr()
5974 wr->npkt = txp->npkt; in write_txpkts_vm_wr()
5976 memcpy(&wr->ethmacdst[0], &txp->ethmacdst[0], 16); in write_txpkts_vm_wr()
5984 ndesc = tx_len16_to_desc(txp->len16); in write_txpkts_vm_wr()
5986 for (i = 0; i < txp->npkt; i++) { in write_txpkts_vm_wr()
5987 m = txp->mb[i]; in write_txpkts_vm_wr()
6021 txq->txpkts1_pkts += txp->npkt; in write_txpkts_vm_wr()
6025 txsd->m = txp->mb[0]; in write_txpkts_vm_wr()