Lines Matching refs:rxBuf
24 * Allocate a new rxBuf from memory. All its fields are set except
28 * A new rxBuf or NULL.
33 vmxnet3_rxbuf_t *rxBuf;
37 rxBuf = kmem_zalloc(sizeof (vmxnet3_rxbuf_t), flag);
38 if (!rxBuf) {
43 if ((err = vmxnet3_alloc_dma_mem_1(dp, &rxBuf->dma, (dp->cur_mtu + 18),
47 kmem_free(rxBuf, sizeof (vmxnet3_rxbuf_t));
52 rxBuf->freeCB.free_func = vmxnet3_put_rxbuf;
53 rxBuf->freeCB.free_arg = (caddr_t)rxBuf;
54 rxBuf->dp = dp;
58 return (rxBuf);
62 vmxnet3_free_rxbuf(vmxnet3_softc_t *dp, vmxnet3_rxbuf_t *rxBuf)
64 vmxnet3_free_dma_mem(&rxBuf->dma);
65 kmem_free(rxBuf, sizeof (vmxnet3_rxbuf_t));
78 * Return a rxBuf to the pool. The init argument, when B_TRUE, indicates
88 vmxnet3_put_rxpool_buf(vmxnet3_softc_t *dp, vmxnet3_rxbuf_t *rxBuf,
99 rxBuf->next = rxPool->listHead;
100 rxPool->listHead = rxBuf;
109 * Return a rxBuf to the pool or free it.
112 vmxnet3_put_rxbuf(vmxnet3_rxbuf_t *rxBuf)
114 vmxnet3_softc_t *dp = rxBuf->dp;
116 if (!vmxnet3_put_rxpool_buf(dp, rxBuf, B_FALSE))
117 vmxnet3_free_rxbuf(dp, rxBuf);
121 * Get an unused rxBuf from the pool.
124 * A rxBuf or NULL if there are no buffers in the pool.
130 vmxnet3_rxbuf_t *rxBuf = NULL;
134 rxBuf = rxPool->listHead;
135 rxPool->listHead = rxBuf->next;
141 return (rxBuf);
154 vmxnet3_rxbuf_t *rxBuf;
158 if ((rxBuf = vmxnet3_alloc_rxbuf(dp, B_FALSE)) == NULL) {
162 VERIFY(vmxnet3_put_rxpool_buf(dp, rxBuf, B_TRUE));
166 while ((rxBuf = vmxnet3_get_rxpool_buf(dp)) != NULL) {
167 vmxnet3_free_rxbuf(dp, rxBuf);
175 * Populate a Rx descriptor with a new rxBuf. If the pool argument is B_TRUE,
188 vmxnet3_rxbuf_t *rxBuf = NULL;
190 if (pool && (rxBuf = vmxnet3_get_rxpool_buf(dp)) == NULL) {
198 if (rxBuf == NULL && (!pool || dp->alloc_ok)) {
199 rxBuf = vmxnet3_alloc_rxbuf(dp, canSleep);
202 if (rxBuf != NULL) {
203 rxBuf->mblk = desballoc((uchar_t *)rxBuf->dma.buf,
204 rxBuf->dma.bufLen, BPRI_MED, &rxBuf->freeCB);
205 if (rxBuf->mblk == NULL) {
207 VERIFY(vmxnet3_put_rxpool_buf(dp, rxBuf,
210 vmxnet3_free_rxbuf(dp, rxBuf);
219 rxq->bufRing[idx].rxBuf = rxBuf;
220 rxDesc->rxd.addr = rxBuf->dma.bufPA;
221 rxDesc->rxd.len = rxBuf->dma.bufLen;
269 vmxnet3_free_rxbuf(dp, rxq->bufRing[cmdRing->next2fill].rxBuf);
281 vmxnet3_rxbuf_t *rxBuf;
287 while ((rxBuf = vmxnet3_get_rxpool_buf(dp)))
288 vmxnet3_free_rxbuf(dp, rxBuf);
292 rxBuf = rxq->bufRing[i].rxBuf;
293 ASSERT(rxBuf);
294 ASSERT(rxBuf->mblk);
300 freemsg(rxBuf->mblk);
357 vmxnet3_rxbuf_t *rxBuf = rxq->bufRing[rxdIdx].rxBuf;
358 mblk_t *mblk = rxBuf->mblk;
370 ASSERT(rxBuf);