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


1163         mac_lso_get(mp, &mss, &lsoflags);
1164 
1165         if (lsoflags & HW_LSO) {
1166                 xge_assert((mss != 0) && (mss <= XGE_HAL_DEFAULT_MTU));
1167                 xge_hal_fifo_dtr_mss_set(dtr, mss);
1168         }
1169 
1170         mac_hcksum_get(mp, NULL, NULL, NULL, NULL, &hckflags);
1171         if (hckflags & HCK_IPV4_HDRCKSUM) {
1172                 xge_hal_fifo_dtr_cksum_set_bits(dtr,
1173                     XGE_HAL_TXD_TX_CKO_IPV4_EN);
1174         }
1175         if (hckflags & HCK_FULLCKSUM) {
1176                 xge_hal_fifo_dtr_cksum_set_bits(dtr, XGE_HAL_TXD_TX_CKO_TCP_EN |
1177                     XGE_HAL_TXD_TX_CKO_UDP_EN);
1178         }
1179 
1180         xge_hal_fifo_dtr_post(ring->channelh, dtr);
1181 
1182         /* Update per-ring tx statistics */
1183         atomic_add_64(&ring->tx_pkts, 1);
1184         atomic_add_64(&ring->tx_bytes, sent_bytes);
1185 
1186         return (NULL);
1187 
1188 _exit_cleanup:
1189         /*
1190          * Could not successfully transmit but have changed the message,
1191          * so just free it and return NULL
1192          */
1193         for (i = 0; i < handle_cnt; i++) {
1194                 (void) ddi_dma_unbind_handle(txd_priv->dma_handles[i]);
1195                 ddi_dma_free_handle(&txd_priv->dma_handles[i]);
1196                 txd_priv->dma_handles[i] = 0;
1197         }
1198 
1199         xge_hal_fifo_dtr_free(ring->channelh, dtr);
1200 
1201         freemsg(mp);
1202         return (NULL);
1203 




1163         mac_lso_get(mp, &mss, &lsoflags);
1164 
1165         if (lsoflags & HW_LSO) {
1166                 xge_assert((mss != 0) && (mss <= XGE_HAL_DEFAULT_MTU));
1167                 xge_hal_fifo_dtr_mss_set(dtr, mss);
1168         }
1169 
1170         mac_hcksum_get(mp, NULL, NULL, NULL, NULL, &hckflags);
1171         if (hckflags & HCK_IPV4_HDRCKSUM) {
1172                 xge_hal_fifo_dtr_cksum_set_bits(dtr,
1173                     XGE_HAL_TXD_TX_CKO_IPV4_EN);
1174         }
1175         if (hckflags & HCK_FULLCKSUM) {
1176                 xge_hal_fifo_dtr_cksum_set_bits(dtr, XGE_HAL_TXD_TX_CKO_TCP_EN |
1177                     XGE_HAL_TXD_TX_CKO_UDP_EN);
1178         }
1179 
1180         xge_hal_fifo_dtr_post(ring->channelh, dtr);
1181 
1182         /* Update per-ring tx statistics */
1183         atomic_inc_64(&ring->tx_pkts);
1184         atomic_add_64(&ring->tx_bytes, sent_bytes);
1185 
1186         return (NULL);
1187 
1188 _exit_cleanup:
1189         /*
1190          * Could not successfully transmit but have changed the message,
1191          * so just free it and return NULL
1192          */
1193         for (i = 0; i < handle_cnt; i++) {
1194                 (void) ddi_dma_unbind_handle(txd_priv->dma_handles[i]);
1195                 ddi_dma_free_handle(&txd_priv->dma_handles[i]);
1196                 txd_priv->dma_handles[i] = 0;
1197         }
1198 
1199         xge_hal_fifo_dtr_free(ring->channelh, dtr);
1200 
1201         freemsg(mp);
1202         return (NULL);
1203