txinfo
uint32_t info, info2, txinfo;
txinfo = LE_32(epctx.xec_txinfo);
mdb_printf("Average TRB Length: %d\n", XHCI_EPCTX_AVG_TRB_LEN(txinfo));
mdb_printf("Max ESIT: %d\n", XHCI_EPCTX_GET_MAX_ESIT_PAYLOAD(txinfo));
add_to_txpkts(txq, &txpkts, frame, &txinfo) == 0) {
write_ulp_cpl_sgl(pi, txq, &txpkts, &txinfo);
rc = write_txpkt_wr(pi, txq, frame, &txinfo);
free_txinfo_resources(txq, &txinfo);
txq->txbytes += txinfo.len;
struct txinfo *txinfo, int sgl_only);
struct txinfo *txinfo);
static inline void add_seg(struct txinfo *txinfo, uint64_t ba, uint32_t len);
static inline int add_mblk(struct sge_txq *txq, struct txinfo *txinfo,
static void free_txinfo_resources(struct sge_txq *txq, struct txinfo *txinfo);
struct txinfo *txinfo);
struct txinfo *txinfo);
struct txpkts *txpkts, struct txinfo *txinfo);
get_frame_txinfo(struct sge_txq *txq, mblk_t **fp, struct txinfo *txinfo,
txinfo->flags = (flags & HCK_TX_FLAGS);
mac_lso_get(m, &txinfo->mss, &flags);
txinfo->flags |= (flags & HW_LSO_FLAGS);
if (txinfo->flags != 0) {
mac_ether_offload_info(m, &txinfo->meoi);
bzero(&txinfo->meoi, sizeof (txinfo->meoi));
start: txinfo->nsegs = 0;
txinfo->hdls_used = 0;
txinfo->txb_used = 0;
txinfo->len = 0;
txinfo->len += len;
mac_hcksum_set(m, 0, 0, 0, 0, txinfo->flags);
if (txinfo->len <= IMM_LEN && !sgl_only)
if (txinfo->len <= txq->copy_threshold &&
copy_into_txb(txq, m, txinfo->len, txinfo) == 0) {
(rc = copy_into_txb(txq, m, len, txinfo)) != 0) {
rc = add_mblk(txq, txinfo, m, len);
(txinfo->nsegs == TX_SGL_SEGS && m->b_cont)) {
free_txinfo_resources(txq, txinfo);
mac_hcksum_set(m, 0, 0, 0, 0, txinfo->flags);
free_txinfo_resources(txq, txinfo);
ASSERT(txinfo->nsegs > 0 && txinfo->nsegs <= TX_SGL_SEGS);
n = txinfo->nsegs - 1;
txinfo->nflits = (3 * n) / 2 + (n & 1) + 2;
txinfo->sgl.sge[n / 2].len[1] = cpu_to_be32(0);
txinfo->sgl.cmd_nsge = cpu_to_be32(V_ULPTX_CMD((u32)ULP_TX_SC_DSGL) |
V_ULPTX_NSGE(txinfo->nsegs));
copy_into_txb(struct sge_txq *txq, mblk_t *m, int len, struct txinfo *txinfo)
txinfo->txb_used += waste;
add_seg(txinfo, txq->txb_ba + txq->txb_next, len);
txinfo->txb_used += n;
add_seg(struct txinfo *txinfo, uint64_t ba, uint32_t len)
ASSERT(txinfo->nsegs < TX_SGL_SEGS); /* must have room */
if (txinfo->nsegs != 0) {
int idx = txinfo->nsegs - 1;
txinfo->sgl.sge[idx / 2].len[idx & 1] = cpu_to_be32(len);
txinfo->sgl.sge[idx / 2].addr[idx & 1] = cpu_to_be64(ba);
txinfo->sgl.len0 = cpu_to_be32(len);
txinfo->sgl.addr0 = cpu_to_be64(ba);
txinfo->nsegs++;
add_mblk(struct sge_txq *txq, struct txinfo *txinfo, mblk_t *m, int len)
if (ccount + txinfo->nsegs > TX_SGL_SEGS) {
add_seg(txinfo, cookie.dmac_laddress, cookie.dmac_size);
add_seg(txinfo, cookie.dmac_laddress, cookie.dmac_size);
txinfo->hdls_used++;
free_txinfo_resources(struct sge_txq *txq, struct txinfo *txinfo)
n = txinfo->txb_used;
for (n = txinfo->hdls_used; n > 0; n--) {
struct txinfo *txinfo)
flits = TXPKTS_PKT_HDR + txinfo->nflits;
can_coalesce = (txinfo->flags & HW_LSO) == 0 &&
txpkts->plen + txinfo->len < 65536;
txpkts->plen += txinfo->len;
txsd->txb_used += txinfo->txb_used;
txsd->hdls_used += txinfo->hdls_used;
ASSERT(txinfo->len < 65536);
flits = TXPKTS_WR_HDR + txinfo->nflits;
can_coalesce = (txinfo->flags & HW_LSO) == 0 &&
txpkts->plen = txinfo->len;
txsd->txb_used = txinfo->txb_used;
txsd->hdls_used = txinfo->hdls_used;
csum_to_ctrl(const struct txinfo *txinfo, uint32_t chip_version,
const mac_ether_offload_info_t *meoi = &txinfo->meoi;
const uint32_t tx_flags = txinfo->flags;
struct txinfo *txinfo)
const mac_ether_offload_info_t *meoi = &txinfo->meoi;
if (txinfo->flags & HW_LSO) {
if (txinfo->nsegs > 0)
nflits += txinfo->nflits;
nflits += howmany(txinfo->len, 8);
ctrl += txinfo->len;
if (txinfo->flags & HW_LSO &&
lso->mss = cpu_to_be16(txinfo->mss);
lso->len = cpu_to_be32(txinfo->len);
lso->len = cpu_to_be32(V_LSO_T5_XFER_SIZE(txinfo->len));
switch (csum_to_ctrl(txinfo,
cpl->len = cpu_to_be16(txinfo->len);
txsd->txb_used = txinfo->txb_used;
txsd->hdls_used = txinfo->hdls_used;
txq->txb_used += txinfo->txb_used / TXB_CHUNK;
txq->hdl_used += txinfo->hdls_used;
if (txinfo->nsegs > 0) {
copy_to_txd(eq, (void *)&txinfo->sgl, &dst, txinfo->nflits * 8);
ctrl = txinfo->len;
struct txpkts *txpkts, struct txinfo *txinfo)
switch (csum_to_ctrl(txinfo,
sizeof (*cpl) + 8 * txinfo->nflits, 16));
cpl->len = cpu_to_be16(txinfo->len);
copy_to_txd(&txq->eq, (void *)&txinfo->sgl, &dst, txinfo->nflits * 8);
struct txinfo txinfo;
rc = get_frame_txinfo(txq, &frame, &txinfo, coalescing);