Lines Matching full:txp

3104 	struct txpkts *txp = &txq->txp;  in set_txupdate_flags()  local
3106 if ((txp->npkt > 0 || avail < eq->sidx / 2) && in set_txupdate_flags()
3146 struct txpkts *txp = &txq->txp; in eth_tx() local
3161 for (i = 0; i < txp->npkt; i++) in eth_tx()
3162 m_freem(txp->mb[i]); in eth_tx()
3163 txp->npkt = 0; in eth_tx()
3183 txp->score = 0; in eth_tx()
3198 if (t4_tx_coalesce == 0 && txp->npkt == 0) in eth_tx()
3201 txp->score = 0; in eth_tx()
3203 if (++txp->score == 0) in eth_tx()
3204 txp->score = UINT8_MAX; in eth_tx()
3206 txp->score = 1; in eth_tx()
3207 if (txp->npkt > 0 || remaining > 1 || in eth_tx()
3208 txp->score >= t4_tx_coalesce_pkts || in eth_tx()
3219 MPASS(txp->npkt > 0); in eth_tx()
3220 for (i = 0; i < txp->npkt; i++) in eth_tx()
3221 ETHER_BPF_MTAP(ifp, txp->mb[i]); in eth_tx()
3222 if (txp->npkt > 1) { in eth_tx()
3223 MPASS(avail >= tx_len16_to_desc(txp->len16)); in eth_tx()
3230 tx_len16_to_desc(mbuf_len16(txp->mb[0]))); in eth_tx()
3233 txp->mb[0]); in eth_tx()
3235 n = write_txpkt_wr(sc, txq, txp->mb[0], in eth_tx()
3243 txp->npkt = 0; /* emptied */ in eth_tx()
3256 MPASS(txp->npkt == 0); in eth_tx()
3261 MPASS(txp->npkt == 0); in eth_tx()
3311 } else if (eq->pidx == eq->cidx && txp->npkt > 0 && in eth_tx()
3319 MPASS(txp->npkt > 0); in eth_tx()
3320 for (i = 0; i < txp->npkt; i++) in eth_tx()
3321 ETHER_BPF_MTAP(ifp, txp->mb[i]); in eth_tx()
3322 if (txp->npkt > 1) { in eth_tx()
3323 MPASS(avail >= tx_len16_to_desc(txp->len16)); in eth_tx()
3330 tx_len16_to_desc(mbuf_len16(txp->mb[0]))); in eth_tx()
3332 n = write_txpkt_vm_wr(sc, txq, txp->mb[0]); in eth_tx()
3334 n = write_txpkt_wr(sc, txq, txp->mb[0], avail); in eth_tx()
3339 txp->npkt = 0; /* emptied */ in eth_tx()
3346 *coalescing = txp->npkt > 0; in eth_tx()
4608 struct txpkts *txp; in alloc_txq() local
4672 txp = &txq->txp; in alloc_txq()
4673 MPASS(nitems(txp->mb) >= sc->params.max_pkts_per_eth_tx_pkts_wr); in alloc_txq()
4674 txq->txp.max_npkt = min(nitems(txp->mb), in alloc_txq()
4677 txq->txp.max_npkt--; in alloc_txq()
5695 cmp_l2hdr(struct txpkts *txp, struct mbuf *m) in cmp_l2hdr() argument
5699 MPASS(txp->npkt > 0); in cmp_l2hdr()
5702 if (txp->ethtype == be16toh(ETHERTYPE_VLAN)) in cmp_l2hdr()
5707 return (memcmp(m->m_data, &txp->ethmacdst[0], len) != 0); in cmp_l2hdr()
5711 save_l2hdr(struct txpkts *txp, struct mbuf *m) in save_l2hdr() argument
5715 memcpy(&txp->ethmacdst[0], mtod(m, const void *), VM_TX_L2HDR_LEN); in save_l2hdr()
5722 struct txpkts *txp = &txq->txp; in add_to_txpkts_vf() local
5727 *send = txp->npkt > 0; in add_to_txpkts_vf()
5736 if (txp->npkt > 0) { in add_to_txpkts_vf()
5737 MPASS(tx_len16_to_desc(txp->len16) <= avail); in add_to_txpkts_vf()
5738 MPASS(txp->npkt < txp->max_npkt); in add_to_txpkts_vf()
5739 MPASS(txp->wr_type == 1); /* VF supports type 1 only */ in add_to_txpkts_vf()
5741 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) > avail) { in add_to_txpkts_vf()
5746 if (m->m_pkthdr.len + txp->plen > 65535) in add_to_txpkts_vf()
5748 if (cmp_l2hdr(txp, m)) in add_to_txpkts_vf()
5751 txp->len16 += txpkts1_len16(); in add_to_txpkts_vf()
5752 txp->plen += m->m_pkthdr.len; in add_to_txpkts_vf()
5753 txp->mb[txp->npkt++] = m; in add_to_txpkts_vf()
5754 if (txp->npkt == txp->max_npkt) in add_to_txpkts_vf()
5757 txp->len16 = howmany(sizeof(struct fw_eth_tx_pkts_vm_wr), 16) + in add_to_txpkts_vf()
5759 if (tx_len16_to_desc(txp->len16) > avail) in add_to_txpkts_vf()
5761 txp->npkt = 1; in add_to_txpkts_vf()
5762 txp->wr_type = 1; in add_to_txpkts_vf()
5763 txp->plen = m->m_pkthdr.len; in add_to_txpkts_vf()
5764 txp->mb[0] = m; in add_to_txpkts_vf()
5765 save_l2hdr(txp, m); in add_to_txpkts_vf()
5774 struct txpkts *txp = &txq->txp; in add_to_txpkts_pf() local
5782 *send = txp->npkt > 0; in add_to_txpkts_pf()
5788 if (txp->npkt == 0) { in add_to_txpkts_pf()
5792 txp->wr_type = 0; in add_to_txpkts_pf()
5793 txp->len16 = in add_to_txpkts_pf()
5797 txp->wr_type = 1; in add_to_txpkts_pf()
5798 txp->len16 = in add_to_txpkts_pf()
5802 if (tx_len16_to_desc(txp->len16) > avail) in add_to_txpkts_pf()
5804 txp->npkt = 1; in add_to_txpkts_pf()
5805 txp->plen = m->m_pkthdr.len; in add_to_txpkts_pf()
5806 txp->mb[0] = m; in add_to_txpkts_pf()
5808 MPASS(tx_len16_to_desc(txp->len16) <= avail); in add_to_txpkts_pf()
5809 MPASS(txp->npkt < txp->max_npkt); in add_to_txpkts_pf()
5811 if (m->m_pkthdr.len + txp->plen > 65535) { in add_to_txpkts_pf()
5817 MPASS(txp->wr_type == 0 || txp->wr_type == 1); in add_to_txpkts_pf()
5818 if (txp->wr_type == 0) { in add_to_txpkts_pf()
5819 if (tx_len16_to_desc(txp->len16 + in add_to_txpkts_pf()
5822 txp->len16 += txpkts0_len16(nsegs); in add_to_txpkts_pf()
5826 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) > in add_to_txpkts_pf()
5829 txp->len16 += txpkts1_len16(); in add_to_txpkts_pf()
5832 txp->plen += m->m_pkthdr.len; in add_to_txpkts_pf()
5833 txp->mb[txp->npkt++] = m; in add_to_txpkts_pf()
5834 if (txp->npkt == txp->max_npkt) in add_to_txpkts_pf()
5841 * Write a txpkts WR for the packets in txp to the hardware descriptors, update
5850 const struct txpkts *txp = &txq->txp; in write_txpkts_wr() local
5861 MPASS(txp->npkt > 0); in write_txpkts_wr()
5862 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16)); in write_txpkts_wr()
5866 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16)); in write_txpkts_wr()
5867 wr->plen = htobe16(txp->plen); in write_txpkts_wr()
5868 wr->npkt = txp->npkt; in write_txpkts_wr()
5870 wr->type = txp->wr_type; in write_txpkts_wr()
5878 ndesc = tx_len16_to_desc(txp->len16); in write_txpkts_wr()
5881 for (i = 0; i < txp->npkt; i++) { in write_txpkts_wr()
5882 m = txp->mb[i]; in write_txpkts_wr()
5883 if (txp->wr_type == 0) { in write_txpkts_wr()
5943 if (txp->wr_type == 0) { in write_txpkts_wr()
5944 txq->txpkts0_pkts += txp->npkt; in write_txpkts_wr()
5947 txq->txpkts1_pkts += txp->npkt; in write_txpkts_wr()
5952 txsd->m = txp->mb[0]; in write_txpkts_wr()
5961 const struct txpkts *txp = &txq->txp; in write_txpkts_vm_wr() local
5972 MPASS(txp->npkt > 0); in write_txpkts_vm_wr()
5973 MPASS(txp->wr_type == 1); /* VF supports type 1 only */ in write_txpkts_vm_wr()
5974 MPASS(txp->mb[0] != NULL); in write_txpkts_vm_wr()
5975 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16)); in write_txpkts_vm_wr()
5979 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16)); in write_txpkts_vm_wr()
5981 wr->plen = htobe16(txp->plen); in write_txpkts_vm_wr()
5982 wr->npkt = txp->npkt; in write_txpkts_vm_wr()
5984 memcpy(&wr->ethmacdst[0], &txp->ethmacdst[0], 16); in write_txpkts_vm_wr()
5992 ndesc = tx_len16_to_desc(txp->len16); in write_txpkts_vm_wr()
5994 for (i = 0; i < txp->npkt; i++) { in write_txpkts_vm_wr()
5995 m = txp->mb[i]; in write_txpkts_vm_wr()
6029 txq->txpkts1_pkts += txp->npkt; in write_txpkts_vm_wr()
6033 txsd->m = txp->mb[0]; in write_txpkts_vm_wr()