Lines Matching refs:len

63 	uint32_t len;		/* Total length of frame */
110 static int alloc_dma_memory(struct adapter *sc, size_t len, int flags,
115 static int alloc_desc_ring(struct adapter *sc, size_t len, int rw,
119 static int alloc_tx_copybuffer(struct adapter *sc, size_t len,
133 static inline int fits_in_txb(struct sge_txq *txq, int len, int *waste);
134 static inline int copy_into_txb(struct sge_txq *txq, mblk_t *m, int len,
136 static inline void add_seg(struct txinfo *txinfo, uint64_t ba, uint32_t len);
138 mblk_t *m, int len);
148 int len);
848 int ndesc, len = 0;
855 len += MBLKL(m);
857 ASSERT(len > 0 && (len & 0x7) == 0);
858 ASSERT(len <= SGE_MAX_WR_LEN);
860 ndesc = howmany(len, EQ_ESIZE);
1102 size_t len;
1107 len = iq->qsize * iq->esize;
1108 rc = alloc_desc_ring(sc, len, DDI_DMA_READ, &iq->dhdl, &iq->ahdl,
1149 len = fl->qsize * RX_FL_ESIZE;
1150 rc = alloc_desc_ring(sc, len, DDI_DMA_WRITE, &fl->dhdl,
1524 size_t len;
1529 len = eq->qsize * EQ_ESIZE;
1530 rc = alloc_desc_ring(sc, len, DDI_DMA_WRITE, &eq->desc_dhdl,
1770 * len length of the block of memory to allocate.
1782 alloc_dma_memory(struct adapter *sc, size_t len, int flags,
1811 rc = ddi_dma_mem_alloc(dhdl, len, acc_attr,
1822 if (len != real_len) {
1824 "%s: len (%u) != real_len (%u)\n", len, real_len);
1866 alloc_desc_ring(struct adapter *sc, size_t len, int rw,
1873 return (alloc_dma_memory(sc, len, DDI_DMA_CONSISTENT | rw, acc_attr,
1884 alloc_tx_copybuffer(struct adapter *sc, size_t len,
1891 return (alloc_dma_memory(sc, len, DDI_DMA_STREAMING | DDI_DMA_WRITE,
2066 uint_t nbuf = 0, len, copy, n;
2083 len = G_RSPD_LEN(len_newbuf); /* pktshift + payload length */
2084 copy = (len <= fl->copy_threshold);
2086 frame.head = m = allocb(len, BPRI_HI);
2091 while (len) {
2093 n = min(len, rxb->buf_size - offset);
2115 len -= n;
2157 uint32_t flags = 0, len, n;
2175 txinfo->len = 0;
2180 len = MBLKL(m);
2181 n += (len / PAGE_SIZE) + 1;
2182 txinfo->len += len;
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)
2207 len = MBLKL(m);
2210 if (len <= txq->copy_threshold &&
2211 copy_into_txb(txq, m, len, txinfo) == 0)
2215 rc = add_mblk(txq, txinfo, m, len);
2254 txinfo->sgl.sge[n / 2].len[1] = cpu_to_be32(0);
2263 fits_in_txb(struct sge_txq *txq, int len, int *waste)
2265 if (txq->txb_avail < len)
2268 if (txq->txb_next + len <= txq->txb_size) {
2275 return (txq->txb_avail - *waste < len ? 0 : 1);
2286 copy_into_txb(struct sge_txq *txq, mblk_t *m, int len, struct txinfo *txinfo)
2292 if (!fits_in_txb(txq, len, &waste)) {
2304 for (n = 0; n < len; m = m->b_cont) {
2309 add_seg(txinfo, txq->txb_ba + txq->txb_next, len);
2311 n = roundup(len, TXB_CHUNK);
2323 add_seg(struct txinfo *txinfo, uint64_t ba, uint32_t len)
2329 txinfo->sgl.sge[idx / 2].len[idx & 1] = cpu_to_be32(len);
2332 txinfo->sgl.len0 = cpu_to_be32(len);
2354 add_mblk(struct sge_txq *txq, struct txinfo *txinfo, mblk_t *m, int len)
2369 rc = ddi_dma_addr_bind_handle(dhdl, NULL, (caddr_t)m->b_rptr, len,
2455 txpkts->plen + txinfo->len < 65536;
2462 txpkts->plen += txinfo->len;
2484 ASSERT(txinfo->len < 65536);
2500 txpkts->plen = txinfo->len;
2587 nflits += howmany(txinfo->len, 8);
2588 ctrl += txinfo->len;
2628 lso->len = cpu_to_be32(txinfo->len);
2649 cpl->len = cpu_to_be16(txinfo->len);
2683 ctrl = txinfo->len;
2736 ulpmc->len = htonl(howmany(sizeof (*ulpmc) + sizeof (*ulpsc) +
2743 ulpsc->len = cpu_to_be32(sizeof (struct cpl_tx_pkt_core));
2754 cpl->len = cpu_to_be16(txinfo->len);
2784 copy_to_txd(struct sge_eq *eq, caddr_t from, caddr_t *to, int len)
2786 if ((uintptr_t)(*to) + len <= (uintptr_t)eq->spg) {
2787 bcopy(from, *to, len);
2788 (*to) += len;
2794 portion = len - portion; /* remaining */