Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4v/io/vdc.c
          +++ new/usr/src/uts/sun4v/io/vdc.c
↓ open down ↓ 4471 lines elided ↑ open up ↑
4472 4472                           * try another server. The 'ctimeout' will report
4473 4473                           * back an error after it expires irrespective of
4474 4474                           * whether the vdisk is trying to connect to just
4475 4475                           * one or multiple servers.
4476 4476                           */
4477 4477                          ctimeout = (vdc_timeout != 0)?
4478 4478                              vdc_timeout : vdcp->curr_server->ctimeout;
4479 4479  
4480 4480                          if (ctimeout != 0 && tmid == 0) {
4481 4481                                  tmid = timeout(vdc_connection_timeout, vdcp,
4482      -                                    ctimeout * drv_usectohz(MICROSEC));
     4482 +                                    drv_sectohz(ctimeout));
4483 4483                          }
4484 4484  
4485 4485                          /* Switch to STATE_DETACH if drv is detaching */
4486 4486                          if (vdcp->lifecycle == VDC_LC_DETACHING) {
4487 4487                                  vdcp->state = VDC_STATE_DETACH;
4488 4488                                  break;
4489 4489                          }
4490 4490  
4491 4491                          /* Check if the timeout has been reached */
4492 4492                          if (vdcp->ctimeout_reached) {
↓ open down ↓ 42 lines elided ↑ open up ↑
4535 4535                          /* if channel is UP, start negotiation */
4536 4536                          if (vdcp->curr_server->ldc_state == LDC_UP) {
4537 4537                                  vdcp->state = VDC_STATE_NEGOTIATE;
4538 4538                                  break;
4539 4539                          }
4540 4540  
4541 4541                          /*
4542 4542                           * Wait for LDC_UP. If it times out and we have multiple
4543 4543                           * servers then we will retry using a different server.
4544 4544                           */
4545      -                        ldcup_timeout = ddi_get_lbolt() + (vdc_ldcup_timeout *
4546      -                            drv_usectohz(MICROSEC));
     4545 +                        ldcup_timeout = ddi_get_lbolt() + drv_sectohz(vdc_ldcup_timeout);
4547 4546                          status = cv_timedwait(&vdcp->initwait_cv, &vdcp->lock,
4548 4547                              ldcup_timeout);
4549 4548                          if (status == -1 &&
4550 4549                              vdcp->state == VDC_STATE_INIT_WAITING &&
4551 4550                              vdcp->curr_server->ldc_state != LDC_UP) {
4552 4551                                  /* timed out & still waiting */
4553 4552                                  vdcp->curr_server->svc_state =
4554 4553                                      VDC_SERVICE_FAILED;
4555 4554                                  vdc_print_svc_status(vdcp);
4556 4555                                  vdcp->state = VDC_STATE_INIT;
↓ open down ↓ 4155 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX