Lines Matching refs:tbufp
133 vgen_private_desc_t *tbufp; in vgen_create_tx_dring() local
147 tbufp = kmem_zalloc(ldcp->num_txds * tbufsize, KM_NOSLEEP); in vgen_create_tx_dring()
148 if (tbufp == NULL) { in vgen_create_tx_dring()
151 ldcp->tbufp = tbufp; in vgen_create_tx_dring()
152 ldcp->tbufendp = &((ldcp->tbufp)[ldcp->num_txds]); in vgen_create_tx_dring()
208 tbufp = &(ldcp->tbufp[i]); in vgen_create_tx_dring()
210 &(tbufp->memhandle)); in vgen_create_tx_dring()
212 tbufp->memhandle = 0; in vgen_create_tx_dring()
220 rv = ldc_mem_bind_handle(tbufp->memhandle, in vgen_create_tx_dring()
222 LDC_MEM_R, &(tbufp->memcookie[ci]), &ncookies); in vgen_create_tx_dring()
231 tbufp->datap = datap; in vgen_create_tx_dring()
239 rv = ldc_mem_nextcookie(tbufp->memhandle, in vgen_create_tx_dring()
240 &(tbufp->memcookie[ci])); in vgen_create_tx_dring()
246 tbufp->ncookies = ncookies; in vgen_create_tx_dring()
249 tbufp->flags = VGEN_PRIV_DESC_FREE; in vgen_create_tx_dring()
254 tbufp->descp = txdp; in vgen_create_tx_dring()
274 ldcp->next_tbufp = ldcp->tbufp; in vgen_create_tx_dring()
275 ldcp->cur_tbufp = ldcp->tbufp; in vgen_create_tx_dring()
299 vgen_private_desc_t *tbufp = ldcp->tbufp; in vgen_destroy_tx_dring() local
308 if (ldcp->tbufp != NULL) { in vgen_destroy_tx_dring()
312 tbufp = &(ldcp->tbufp[i]); in vgen_destroy_tx_dring()
314 if (tbufp->datap) { /* if bound to a ldc memhandle */ in vgen_destroy_tx_dring()
315 (void) ldc_mem_unbind_handle(tbufp->memhandle); in vgen_destroy_tx_dring()
316 tbufp->datap = NULL; in vgen_destroy_tx_dring()
318 if (tbufp->memhandle) { in vgen_destroy_tx_dring()
319 (void) ldc_mem_free_handle(tbufp->memhandle); in vgen_destroy_tx_dring()
320 tbufp->memhandle = 0; in vgen_destroy_tx_dring()
340 if (ldcp->tbufp != NULL) { in vgen_destroy_tx_dring()
341 kmem_free(ldcp->tbufp, ldcp->num_txds * tbufsize); in vgen_destroy_tx_dring()
342 ldcp->tbufp = ldcp->tbufendp = NULL; in vgen_destroy_tx_dring()
590 vgen_private_desc_t *tbufp; in vgen_dringsend() local
641 tbufp = ldcp->next_tbufp; in vgen_dringsend()
642 ntbufp = NEXTTBUF(ldcp, tbufp); in vgen_dringsend()
668 tbufp->flags = VGEN_PRIV_DESC_BUSY; in vgen_dringsend()
672 dst = tbufp->datap + VNET_IPALIGN; in vgen_dringsend()
679 tbufp->datalen = size; in vgen_dringsend()
682 txdp = tbufp->descp; in vgen_dringsend()
685 txdp->ncookies = tbufp->ncookies; in vgen_dringsend()
686 bcopy((tbufp->memcookie), (txdp->memcookie), in vgen_dringsend()
687 tbufp->ncookies * sizeof (ldc_mem_cookie_t)); in vgen_dringsend()
695 if (tbufp->flags != VGEN_PRIV_DESC_BUSY) { in vgen_dringsend()
713 rtbufp = &ldcp->tbufp[ldcp->resched_peer_txi]; in vgen_dringsend()
1287 vgen_private_desc_t *tbufp; in vgen_handle_dringdata_ack() local
1353 tbufp = &ldcp->tbufp[txi]; in vgen_handle_dringdata_ack()
1354 txdp = tbufp->descp; in vgen_handle_dringdata_ack()
1366 txi = ldcp->cur_tbufp - ldcp->tbufp; in vgen_handle_dringdata_ack()
1367 tbufp = &ldcp->tbufp[txi]; in vgen_handle_dringdata_ack()
1369 txdp = tbufp->descp; in vgen_handle_dringdata_ack()
1399 ldcp->resched_peer_txi = ldcp->cur_tbufp - ldcp->tbufp; in vgen_handle_dringdata_ack()
1552 vgen_private_desc_t *tbufp; in vgen_reclaim_dring() local
1555 tbufp = ldcp->cur_tbufp; in vgen_reclaim_dring()
1556 txdp = tbufp->descp; in vgen_reclaim_dring()
1560 (tbufp != ldcp->next_tbufp)) { in vgen_reclaim_dring()
1561 tbufp->flags = VGEN_PRIV_DESC_FREE; in vgen_reclaim_dring()
1565 tbufp = NEXTTBUF(ldcp, tbufp); in vgen_reclaim_dring()
1566 txdp = tbufp->descp; in vgen_reclaim_dring()
1571 ldcp->cur_tbufp = tbufp; in vgen_reclaim_dring()