Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
*** 1298,1308 ****
txp->xt_mfn = xnb_btop(dma_cookie.dmac_laddress);
txp->xt_buflen = dma_cookie.dmac_size;
DTRACE_PROBE(txbuf_allocated);
! atomic_add_32(&xnbp->xnb_tx_buf_count, 1);
xnbp->xnb_tx_buf_outstanding++;
return (0);
failure_2:
--- 1298,1308 ----
txp->xt_mfn = xnb_btop(dma_cookie.dmac_laddress);
txp->xt_buflen = dma_cookie.dmac_size;
DTRACE_PROBE(txbuf_allocated);
! atomic_inc_32(&xnbp->xnb_tx_buf_count);
xnbp->xnb_tx_buf_outstanding++;
return (0);
failure_2:
*** 1324,1334 ****
(void) ddi_dma_unbind_handle(txp->xt_dma_handle);
ddi_dma_mem_free(&txp->xt_acc_handle);
ddi_dma_free_handle(&txp->xt_dma_handle);
! atomic_add_32(&xnbp->xnb_tx_buf_count, -1);
}
/*
* Take packets from the peer and deliver them onward.
*/
--- 1324,1334 ----
(void) ddi_dma_unbind_handle(txp->xt_dma_handle);
ddi_dma_mem_free(&txp->xt_acc_handle);
ddi_dma_free_handle(&txp->xt_dma_handle);
! atomic_dec_32(&xnbp->xnb_tx_buf_count);
}
/*
* Take packets from the peer and deliver them onward.
*/