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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_sli4.c
          +++ new/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_sli4.c
↓ open down ↓ 1983 lines elided ↑ open up ↑
1984 1984  
1985 1985                          if (sbp->node == NULL) {
1986 1986                                  /* Set node to base node by default */
1987 1987                                  iocbq->node = (void *)&port->node_base;
1988 1988                                  sbp->node = (void *)&port->node_base;
1989 1989                          }
1990 1990  
1991 1991                          sbp->pkt_flags |= PACKET_IN_CHIPQ;
1992 1992                          mutex_exit(&sbp->mtx);
1993 1993  
1994      -                        atomic_add_32(&hba->io_active, 1);
     1994 +                        atomic_inc_32(&hba->io_active);
1995 1995                          sbp->xrip->flag |= EMLXS_XRI_PENDING_IO;
1996 1996                  }
1997 1997  
1998 1998  
1999 1999                  /* Free the local iocb if there is no sbp tracking it */
2000 2000                  if (sbp) {
2001 2001  #ifdef SFCT_SUPPORT
2002 2002  #ifdef FCT_IO_TRACE
2003 2003                          if (sbp->fct_cmd) {
2004 2004                                  emlxs_fct_io_trace(port, sbp->fct_cmd,
↓ open down ↓ 1857 lines elided ↑ open up ↑
3862 3862  
3863 3863  #ifdef SFCT_SUPPORT
3864 3864  #ifdef FCT_IO_TRACE
3865 3865                  if (sbp->fct_cmd) {
3866 3866                          emlxs_fct_io_trace(port, sbp->fct_cmd,
3867 3867                              EMLXS_FCT_IOCB_COMPLETE);
3868 3868                  }
3869 3869  #endif /* FCT_IO_TRACE */
3870 3870  #endif /* SFCT_SUPPORT */
3871 3871  
3872      -                atomic_add_32(&hba->io_active, -1);
     3872 +                atomic_dec_32(&hba->io_active);
3873 3873  
3874 3874                  /* Copy entry to sbp's iocbq */
3875 3875                  iocbq = &sbp->iocbq;
3876 3876                  emlxs_CQE_to_IOCB(hba, &cqe, sbp);
3877 3877  
3878 3878                  iocbq->next = NULL;
3879 3879  
3880 3880                  /* Exchange is no longer busy on-chip, free it */
3881 3881                  emlxs_sli4_free_xri(hba, sbp, sbp->xrip, 1);
3882 3882  
↓ open down ↓ 73 lines elided ↑ open up ↑
3956 3956          emlxs_buf_t *cmd_sbp;
3957 3957  #endif /* SFCT_SUPPORT */
3958 3958  
3959 3959          request_tag = cqe->RequestTag;
3960 3960  
3961 3961          /* 1 to 1 mapping between CQ and channel */
3962 3962          cp = cq->channelp;
3963 3963  
3964 3964          mutex_enter(&EMLXS_FCTAB_LOCK);
3965 3965          sbp = hba->fc_table[request_tag];
3966      -        atomic_add_32(&hba->io_active, -1);
     3966 +        atomic_dec_32(&hba->io_active);
3967 3967  
3968 3968          if (sbp == STALE_PACKET) {
3969 3969                  cp->hbaCmplCmd_sbp++;
3970 3970                  mutex_exit(&EMLXS_FCTAB_LOCK);
3971 3971                  EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_sli_detail_msg,
3972 3972                      "CQ ENTRY: Stale sbp. tag=%x. Dropping...", request_tag);
3973 3973                  return;
3974 3974          }
3975 3975  
3976 3976          if (!sbp || !(sbp->xrip)) {
↓ open down ↓ 2863 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX