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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/clients/rdsv3/send.c
          +++ new/usr/src/uts/common/io/ib/clients/rdsv3/send.c
↓ open down ↓ 168 lines elided ↑ open up ↑
 169  169           * avoids blocking the caller and trading per-connection data between
 170  170           * caches per message.
 171  171           */
 172  172          if (!mutex_tryenter(&conn->c_send_lock)) {
 173  173                  RDSV3_DPRINTF4("rdsv3_send_xmit",
 174  174                      "Another thread running(conn: %p)", conn);
 175  175                  rdsv3_stats_inc(s_send_sem_contention);
 176  176                  ret = -ENOMEM;
 177  177                  goto out;
 178  178          }
 179      -        atomic_add_32(&conn->c_senders, 1);
      179 +        atomic_inc_32(&conn->c_senders);
 180  180  
 181  181          if (conn->c_trans->xmit_prepare)
 182  182                  conn->c_trans->xmit_prepare(conn);
 183  183  
 184  184          /*
 185  185           * spin trying to push headers and data down the connection until
 186  186           * the connection doesn't make forward progress.
 187  187           */
 188  188          while (--send_quota) {
 189  189                  /*
↓ open down ↓ 370 lines elided ↑ open up ↑
 560  560      struct rdsv3_rdma_op *op)
 561  561  {
 562  562          struct rdsv3_message *rm, *tmp, *found = NULL;
 563  563  
 564  564          RDSV3_DPRINTF4("rdsv3_send_get_message", "Enter(conn: %p)", conn);
 565  565  
 566  566          mutex_enter(&conn->c_lock);
 567  567  
 568  568          RDSV3_FOR_EACH_LIST_NODE_SAFE(rm, tmp, &conn->c_retrans, m_conn_item) {
 569  569                  if (rm->m_rdma_op == op) {
 570      -                        atomic_add_32(&rm->m_refcount, 1);
      570 +                        atomic_inc_32(&rm->m_refcount);
 571  571                          found = rm;
 572  572                          goto out;
 573  573                  }
 574  574          }
 575  575  
 576  576          RDSV3_FOR_EACH_LIST_NODE_SAFE(rm, tmp, &conn->c_send_queue,
 577  577              m_conn_item) {
 578  578                  if (rm->m_rdma_op == op) {
 579      -                        atomic_add_32(&rm->m_refcount, 1);
      579 +                        atomic_inc_32(&rm->m_refcount);
 580  580                          found = rm;
 581  581                          break;
 582  582                  }
 583  583          }
 584  584  
 585  585  out:
 586  586          mutex_exit(&conn->c_lock);
 587  587  
 588  588          return (found);
 589  589  }
↓ open down ↓ 610 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX