Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

*** 3130,3140 **** mutex_enter(&tx->lock); /* check to see if the slots are really there */ avail = tx->mask - (tx->req - tx->done); if (unlikely(avail <= MYRI10GE_MAX_SEND_DESC_TSO)) { ! atomic_add_32(&tx->stall, 1); mutex_exit(&tx->lock); return (EBUSY); } /* copy */ --- 3130,3140 ---- mutex_enter(&tx->lock); /* check to see if the slots are really there */ avail = tx->mask - (tx->req - tx->done); if (unlikely(avail <= MYRI10GE_MAX_SEND_DESC_TSO)) { ! atomic_inc_32(&tx->stall); mutex_exit(&tx->lock); return (EBUSY); } /* copy */
*** 3371,3381 **** * message to fit. */ if (avail < max_segs) { err = EBUSY; ! atomic_add_32(&tx->stall_early, 1); goto stall; } /* find out how long the frame is and how many segments it is */ count = 0; --- 3371,3381 ---- * message to fit. */ if (avail < max_segs) { err = EBUSY; ! atomic_inc_32(&tx->stall_early); goto stall; } /* find out how long the frame is and how many segments it is */ count = 0;
*** 3636,3646 **** mutex_exit(&tx->lock); return (DDI_SUCCESS); late_stall: try_pullup = 0; ! atomic_add_32(&tx->stall_late, 1); abort_with_handles: /* unbind and free handles from previous mblks */ for (i = 0; i < count; i++) { bp = tx_info[i].m; --- 3636,3646 ---- mutex_exit(&tx->lock); return (DDI_SUCCESS); late_stall: try_pullup = 0; ! atomic_inc_32(&tx->stall_late); abort_with_handles: /* unbind and free handles from previous mblks */ for (i = 0; i < count; i++) { bp = tx_info[i].m;
*** 3669,3679 **** } stall: if (err != 0) { if (err == EBUSY) { ! atomic_add_32(&tx->stall, 1); } else { MYRI10GE_ATOMIC_SLICE_STAT_INC(xmit_err); } } return (err); --- 3669,3679 ---- } stall: if (err != 0) { if (err == EBUSY) { ! atomic_inc_32(&tx->stall); } else { MYRI10GE_ATOMIC_SLICE_STAT_INC(xmit_err); } } return (err);