Lines Matching defs:txp

3096 	struct txpkts *txp = &txq->txp;
3098 if ((txp->npkt > 0 || avail < eq->sidx / 2) &&
3138 struct txpkts *txp = &txq->txp;
3153 for (i = 0; i < txp->npkt; i++)
3154 m_freem(txp->mb[i]);
3155 txp->npkt = 0;
3175 txp->score = 0;
3190 if (t4_tx_coalesce == 0 && txp->npkt == 0)
3193 txp->score = 0;
3195 if (++txp->score == 0)
3196 txp->score = UINT8_MAX;
3198 txp->score = 1;
3199 if (txp->npkt > 0 || remaining > 1 ||
3200 txp->score >= t4_tx_coalesce_pkts ||
3211 MPASS(txp->npkt > 0);
3212 for (i = 0; i < txp->npkt; i++)
3213 ETHER_BPF_MTAP(ifp, txp->mb[i]);
3214 if (txp->npkt > 1) {
3215 MPASS(avail >= tx_len16_to_desc(txp->len16));
3222 tx_len16_to_desc(mbuf_len16(txp->mb[0])));
3225 txp->mb[0]);
3227 n = write_txpkt_wr(sc, txq, txp->mb[0],
3235 txp->npkt = 0; /* emptied */
3248 MPASS(txp->npkt == 0);
3253 MPASS(txp->npkt == 0);
3303 } else if (eq->pidx == eq->cidx && txp->npkt > 0 &&
3311 MPASS(txp->npkt > 0);
3312 for (i = 0; i < txp->npkt; i++)
3313 ETHER_BPF_MTAP(ifp, txp->mb[i]);
3314 if (txp->npkt > 1) {
3315 MPASS(avail >= tx_len16_to_desc(txp->len16));
3322 tx_len16_to_desc(mbuf_len16(txp->mb[0])));
3324 n = write_txpkt_vm_wr(sc, txq, txp->mb[0]);
3326 n = write_txpkt_wr(sc, txq, txp->mb[0], avail);
3331 txp->npkt = 0; /* emptied */
3338 *coalescing = txp->npkt > 0;
4600 struct txpkts *txp;
4664 txp = &txq->txp;
4665 MPASS(nitems(txp->mb) >= sc->params.max_pkts_per_eth_tx_pkts_wr);
4666 txq->txp.max_npkt = min(nitems(txp->mb),
4669 txq->txp.max_npkt--;
5687 cmp_l2hdr(struct txpkts *txp, struct mbuf *m)
5691 MPASS(txp->npkt > 0);
5694 if (txp->ethtype == be16toh(ETHERTYPE_VLAN))
5699 return (memcmp(m->m_data, &txp->ethmacdst[0], len) != 0);
5703 save_l2hdr(struct txpkts *txp, struct mbuf *m)
5707 memcpy(&txp->ethmacdst[0], mtod(m, const void *), VM_TX_L2HDR_LEN);
5714 struct txpkts *txp = &txq->txp;
5719 *send = txp->npkt > 0;
5728 if (txp->npkt > 0) {
5729 MPASS(tx_len16_to_desc(txp->len16) <= avail);
5730 MPASS(txp->npkt < txp->max_npkt);
5731 MPASS(txp->wr_type == 1); /* VF supports type 1 only */
5733 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) > avail) {
5738 if (m->m_pkthdr.len + txp->plen > 65535)
5740 if (cmp_l2hdr(txp, m))
5743 txp->len16 += txpkts1_len16();
5744 txp->plen += m->m_pkthdr.len;
5745 txp->mb[txp->npkt++] = m;
5746 if (txp->npkt == txp->max_npkt)
5749 txp->len16 = howmany(sizeof(struct fw_eth_tx_pkts_vm_wr), 16) +
5751 if (tx_len16_to_desc(txp->len16) > avail)
5753 txp->npkt = 1;
5754 txp->wr_type = 1;
5755 txp->plen = m->m_pkthdr.len;
5756 txp->mb[0] = m;
5757 save_l2hdr(txp, m);
5766 struct txpkts *txp = &txq->txp;
5774 *send = txp->npkt > 0;
5780 if (txp->npkt == 0) {
5784 txp->wr_type = 0;
5785 txp->len16 =
5789 txp->wr_type = 1;
5790 txp->len16 =
5794 if (tx_len16_to_desc(txp->len16) > avail)
5796 txp->npkt = 1;
5797 txp->plen = m->m_pkthdr.len;
5798 txp->mb[0] = m;
5800 MPASS(tx_len16_to_desc(txp->len16) <= avail);
5801 MPASS(txp->npkt < txp->max_npkt);
5803 if (m->m_pkthdr.len + txp->plen > 65535) {
5809 MPASS(txp->wr_type == 0 || txp->wr_type == 1);
5810 if (txp->wr_type == 0) {
5811 if (tx_len16_to_desc(txp->len16 +
5814 txp->len16 += txpkts0_len16(nsegs);
5818 if (tx_len16_to_desc(txp->len16 + txpkts1_len16()) >
5821 txp->len16 += txpkts1_len16();
5824 txp->plen += m->m_pkthdr.len;
5825 txp->mb[txp->npkt++] = m;
5826 if (txp->npkt == txp->max_npkt)
5833 * Write a txpkts WR for the packets in txp to the hardware descriptors, update
5842 const struct txpkts *txp = &txq->txp;
5853 MPASS(txp->npkt > 0);
5854 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16));
5858 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16));
5859 wr->plen = htobe16(txp->plen);
5860 wr->npkt = txp->npkt;
5862 wr->type = txp->wr_type;
5870 ndesc = tx_len16_to_desc(txp->len16);
5873 for (i = 0; i < txp->npkt; i++) {
5874 m = txp->mb[i];
5875 if (txp->wr_type == 0) {
5935 if (txp->wr_type == 0) {
5936 txq->txpkts0_pkts += txp->npkt;
5939 txq->txpkts1_pkts += txp->npkt;
5944 txsd->m = txp->mb[0];
5953 const struct txpkts *txp = &txq->txp;
5964 MPASS(txp->npkt > 0);
5965 MPASS(txp->wr_type == 1); /* VF supports type 1 only */
5966 MPASS(txp->mb[0] != NULL);
5967 MPASS(txp->len16 <= howmany(SGE_MAX_WR_LEN, 16));
5971 wr->equiq_to_len16 = htobe32(V_FW_WR_LEN16(txp->len16));
5973 wr->plen = htobe16(txp->plen);
5974 wr->npkt = txp->npkt;
5976 memcpy(&wr->ethmacdst[0], &txp->ethmacdst[0], 16);
5984 ndesc = tx_len16_to_desc(txp->len16);
5986 for (i = 0; i < txp->npkt; i++) {
5987 m = txp->mb[i];
6021 txq->txpkts1_pkts += txp->npkt;
6025 txsd->m = txp->mb[0];