Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/rpc/rpcib.c
          +++ new/usr/src/uts/common/rpc/rpcib.c
↓ open down ↓ 2179 lines elided ↑ open up ↑
2180 2180          clock_t timout, cv_wait_ret;
2181 2181          rdma_stat error = RDMA_SUCCESS;
2182 2182          int     i;
2183 2183  
2184 2184          /*
2185 2185           * Wait for send to complete
2186 2186           */
2187 2187          ASSERT(wd != NULL);
2188 2188          mutex_enter(&wd->sendwait_lock);
2189 2189          if (wd->status == (uint_t)SEND_WAIT) {
2190      -                timout = drv_usectohz(SEND_WAIT_TIME * 1000000) +
     2190 +                timout = drv_sectohz(SEND_WAIT_TIME) +
2191 2191                      ddi_get_lbolt();
2192 2192  
2193 2193                  if (qp->mode == RIB_SERVER) {
2194 2194                          while ((cv_wait_ret = cv_timedwait(&wd->wait_cv,
2195 2195                              &wd->sendwait_lock, timout)) > 0 &&
2196 2196                              wd->status == (uint_t)SEND_WAIT)
2197 2197                                  ;
2198 2198                          switch (cv_wait_ret) {
2199 2199                          case -1:        /* timeout */
2200 2200                                  DTRACE_PROBE(rpcib__i__srvsendwait__timeout);
↓ open down ↓ 230 lines elided ↑ open up ↑
2431 2431          /* No cv_signal (whether send-wait or no-send-wait) */
2432 2432          ret = rib_send_and_wait(conn, cl, msgid, 1, 0, wid);
2433 2433  
2434 2434          if (ret != RDMA_SUCCESS) {
2435 2435                  rdma_done_rm(qp, rd);
2436 2436          } else {
2437 2437                  /*
2438 2438                   * Wait for RDMA_DONE from remote end
2439 2439                   */
2440 2440                  cv_wait_ret = cv_reltimedwait(&rd->rdma_done_cv,
2441      -                    &qp->rdlist_lock, drv_usectohz(REPLY_WAIT_TIME * 1000000),
     2441 +                    &qp->rdlist_lock, drv_sectohz(REPLY_WAIT_TIME),
2442 2442                      TR_CLOCK_TICK);
2443 2443  
2444 2444                  rdma_done_rm(qp, rd);
2445 2445  
2446 2446                  if (cv_wait_ret < 0) {
2447 2447                          ret = RDMA_TIMEDOUT;
2448 2448                  }
2449 2449          }
2450 2450  
2451 2451          mutex_exit(&qp->rdlist_lock);
↓ open down ↓ 227 lines elided ↑ open up ↑
2679 2679                  if (rep->xid == msgid)
2680 2680                          break;
2681 2681          }
2682 2682  
2683 2683          if (rep != NULL) {
2684 2684                  /*
2685 2685                   * If message not yet received, wait.
2686 2686                   */
2687 2687                  if (rep->status == (uint_t)REPLY_WAIT) {
2688 2688                          timout = ddi_get_lbolt() +
2689      -                            drv_usectohz(REPLY_WAIT_TIME * 1000000);
     2689 +                            drv_sectohz(REPLY_WAIT_TIME);
2690 2690  
2691 2691                          while ((cv_wait_ret = cv_timedwait_sig(&rep->wait_cv,
2692 2692                              &qp->replylist_lock, timout)) > 0 &&
2693 2693                              rep->status == (uint_t)REPLY_WAIT)
2694 2694                                  ;
2695 2695  
2696 2696                          switch (cv_wait_ret) {
2697 2697                          case -1:        /* timeout */
2698 2698                                  ret = RDMA_TIMEDOUT;
2699 2699                                  break;
↓ open down ↓ 1574 lines elided ↑ open up ↑
4274 4274                                  *conn = cn;
4275 4275                                  return (RDMA_SUCCESS);
4276 4276                          }
4277 4277                          if (cn->c_state == C_CONN_PEND) {
4278 4278                                  /*
4279 4279                                   * Hold a reference to this conn before
4280 4280                                   * we give up the lock.
4281 4281                                   */
4282 4282                                  cn->c_ref++;
4283 4283                                  timout =  ddi_get_lbolt() +
4284      -                                    drv_usectohz(CONN_WAIT_TIME * 1000000);
     4284 +                                    drv_sectohz(CONN_WAIT_TIME);
4285 4285                                  while ((cv_stat = cv_timedwait_sig(&cn->c_cv,
4286 4286                                      &cn->c_lock, timout)) > 0 &&
4287 4287                                      cn->c_state == C_CONN_PEND)
4288 4288                                          ;
4289 4289                                  if (cv_stat == 0) {
4290 4290                                          (void) rib_conn_release_locked(cn);
4291 4291                                          return (RDMA_INTR);
4292 4292                                  }
4293 4293                                  if (cv_stat < 0) {
4294 4294                                          (void) rib_conn_release_locked(cn);
↓ open down ↓ 1107 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX