Lines Matching defs:txinfo

62 struct txinfo {
132 struct txinfo *txinfo, int sgl_only);
135 struct txinfo *txinfo);
136 static inline void add_seg(struct txinfo *txinfo, uint64_t ba, uint32_t len);
137 static inline int add_mblk(struct sge_txq *txq, struct txinfo *txinfo,
139 static void free_txinfo_resources(struct sge_txq *txq, struct txinfo *txinfo);
141 struct txinfo *txinfo);
144 struct txinfo *txinfo);
146 struct txpkts *txpkts, struct txinfo *txinfo);
936 struct txinfo txinfo;
955 rc = get_frame_txinfo(txq, &frame, &txinfo, coalescing);
975 add_to_txpkts(txq, &txpkts, frame, &txinfo) == 0) {
979 write_ulp_cpl_sgl(pi, txq, &txpkts, &txinfo);
996 rc = write_txpkt_wr(pi, txq, frame, &txinfo);
1005 * spend even more time freeing up everything in txinfo.
1008 free_txinfo_resources(txq, &txinfo);
2154 get_frame_txinfo(struct sge_txq *txq, mblk_t **fp, struct txinfo *txinfo,
2164 txinfo->flags = flags;
2166 mac_lso_get(m, &txinfo->mss, &flags);
2167 txinfo->flags |= flags;
2172 start: txinfo->nsegs = 0;
2173 txinfo->hdls_used = 0;
2174 txinfo->txb_used = 0;
2175 txinfo->len = 0;
2182 txinfo->len += len;
2195 mac_hcksum_set(m, NULL, NULL, NULL, NULL, txinfo->flags);
2198 if (txinfo->len <= IMM_LEN && !sgl_only)
2201 if (txinfo->len <= txq->copy_threshold &&
2202 copy_into_txb(txq, m, txinfo->len, txinfo) == 0)
2211 copy_into_txb(txq, m, len, txinfo) == 0)
2215 rc = add_mblk(txq, txinfo, m, len);
2218 (txinfo->nsegs == TX_SGL_SEGS && m->b_cont)) {
2223 free_txinfo_resources(txq, txinfo);
2227 txinfo->flags);
2236 free_txinfo_resources(txq, txinfo);
2241 ASSERT(txinfo->nsegs > 0 && txinfo->nsegs <= TX_SGL_SEGS);
2251 n = txinfo->nsegs - 1;
2252 txinfo->nflits = (3 * n) / 2 + (n & 1) + 2;
2254 txinfo->sgl.sge[n / 2].len[1] = cpu_to_be32(0);
2256 txinfo->sgl.cmd_nsge = cpu_to_be32(V_ULPTX_CMD((u32)ULP_TX_SC_DSGL) |
2257 V_ULPTX_NSGE(txinfo->nsegs));
2281 * Copies the specified # of bytes into txq's tx copy buffer and updates txinfo
2286 copy_into_txb(struct sge_txq *txq, mblk_t *m, int len, struct txinfo *txinfo)
2299 txinfo->txb_used += waste;
2309 add_seg(txinfo, txq->txb_ba + txq->txb_next, len);
2312 txinfo->txb_used += n;
2323 add_seg(struct txinfo *txinfo, uint64_t ba, uint32_t len)
2325 ASSERT(txinfo->nsegs < TX_SGL_SEGS); /* must have room */
2327 if (txinfo->nsegs != 0) {
2328 int idx = txinfo->nsegs - 1;
2329 txinfo->sgl.sge[idx / 2].len[idx & 1] = cpu_to_be32(len);
2330 txinfo->sgl.sge[idx / 2].addr[idx & 1] = cpu_to_be64(ba);
2332 txinfo->sgl.len0 = cpu_to_be32(len);
2333 txinfo->sgl.addr0 = cpu_to_be64(ba);
2335 txinfo->nsegs++;
2354 add_mblk(struct sge_txq *txq, struct txinfo *txinfo, mblk_t *m, int len)
2380 if (ccount + txinfo->nsegs > TX_SGL_SEGS) {
2385 add_seg(txinfo, cookie.dmac_laddress, cookie.dmac_size);
2388 add_seg(txinfo, cookie.dmac_laddress, cookie.dmac_size);
2394 txinfo->hdls_used++;
2400 * Releases all the txq resources used up in the specified txinfo.
2403 free_txinfo_resources(struct sge_txq *txq, struct txinfo *txinfo)
2409 n = txinfo->txb_used;
2420 for (n = txinfo->hdls_used; n > 0; n--) {
2441 struct txinfo *txinfo)
2451 flits = TXPKTS_PKT_HDR + txinfo->nflits;
2452 can_coalesce = (txinfo->flags & HW_LSO) == 0 &&
2455 txpkts->plen + txinfo->len < 65536;
2462 txpkts->plen += txinfo->len;
2465 txsd->txb_used += txinfo->txb_used;
2466 txsd->hdls_used += txinfo->hdls_used;
2484 ASSERT(txinfo->len < 65536);
2486 flits = TXPKTS_WR_HDR + txinfo->nflits;
2487 can_coalesce = (txinfo->flags & HW_LSO) == 0 &&
2500 txpkts->plen = txinfo->len;
2504 txsd->txb_used = txinfo->txb_used;
2505 txsd->hdls_used = txinfo->hdls_used;
2562 struct txinfo *txinfo)
2579 if (txinfo->flags & HW_LSO) {
2584 if (txinfo->nsegs > 0)
2585 nflits += txinfo->nflits;
2587 nflits += howmany(txinfo->len, 8);
2588 ctrl += txinfo->len;
2604 if (txinfo->flags & HW_LSO) {
2626 lso->mss = cpu_to_be16(txinfo->mss);
2628 lso->len = cpu_to_be32(txinfo->len);
2638 if (!(txinfo->flags & HCK_IPV4_HDRCKSUM))
2640 if (!(txinfo->flags & HCK_FULLCKSUM))
2649 cpl->len = cpu_to_be16(txinfo->len);
2655 txsd->txb_used = txinfo->txb_used;
2656 txsd->hdls_used = txinfo->hdls_used;
2660 txq->txb_used += txinfo->txb_used / TXB_CHUNK;
2661 txq->hdl_used += txinfo->hdls_used;
2671 if (txinfo->nsegs > 0) {
2673 copy_to_txd(eq, (void *)&txinfo->sgl, &dst, txinfo->nflits * 8);
2683 ctrl = txinfo->len;
2700 struct txpkts *txpkts, struct txinfo *txinfo)
2716 if (!(txinfo->flags & HCK_IPV4_HDRCKSUM))
2718 if (!(txinfo->flags & HCK_FULLCKSUM))
2737 sizeof (*cpl) + 8 * txinfo->nflits, 16));
2754 cpl->len = cpu_to_be16(txinfo->len);
2763 copy_to_txd(&txq->eq, (void *)&txinfo->sgl, &dst, txinfo->nflits * 8);