Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/clients/rds/rdsib_buf.c
          +++ new/usr/src/uts/common/io/ib/clients/rds/rdsib_buf.c
↓ open down ↓ 125 lines elided ↑ open up ↑
 126  126  
 127  127          /*
 128  128           * All buffers must have been freed as all sessions are closed
 129  129           * and destroyed
 130  130           */
 131  131          ASSERT(rds_dpool.pool_nbusy == 0);
 132  132          RDS_DPRINTF2("rds_free_recv_caches", "Data Pool has "
 133  133              "pending buffers: %d", rds_dpool.pool_nbusy);
 134  134          while (rds_dpool.pool_nbusy != 0) {
 135  135                  mutex_exit(&rds_dpool.pool_lock);
 136      -                delay(drv_usectohz(1000000));
      136 +                delay(drv_sectohz(1));
 137  137                  mutex_enter(&rds_dpool.pool_lock);
 138  138          }
 139  139  
 140  140          hcap = statep->rds_hcalistp;
 141  141          while (hcap != NULL) {
 142  142                  if (hcap->hca_mrhdl != NULL) {
 143  143                          ret = ibt_deregister_mr(hcap->hca_hdl,
 144  144                              hcap->hca_mrhdl);
 145  145                          if (ret == IBT_SUCCESS) {
 146  146                                  hcap->hca_mrhdl = NULL;
↓ open down ↓ 661 lines elided ↑ open up ↑
 808  808  
 809  809          recvqp = &ep->ep_recvqp;
 810  810          mutex_enter(&recvqp->qp_lock);
 811  811          RDS_DPRINTF2("rds_is_recvq_empty", "EP(%p): QP has %d WRs",
 812  812              ep, recvqp->qp_level);
 813  813          if (wait) {
 814  814                  /* wait until the RQ is empty */
 815  815                  while (recvqp->qp_level != 0) {
 816  816                          /* wait one second and try again */
 817  817                          mutex_exit(&recvqp->qp_lock);
 818      -                        delay(drv_usectohz(1000000));
      818 +                        delay(drv_sectohz(1));
 819  819                          mutex_enter(&recvqp->qp_lock);
 820  820                  }
 821  821          } else if (recvqp->qp_level != 0) {
 822  822                          ret = B_FALSE;
 823  823          }
 824  824          mutex_exit(&recvqp->qp_lock);
 825  825  
 826  826          rpool = &ep->ep_rcvpool;
 827  827          mutex_enter(&rpool->pool_lock);
 828  828  
↓ open down ↓ 22 lines elided ↑ open up ↑
 851  851  
 852  852          /* check if all the sends completed */
 853  853          spool = &ep->ep_sndpool;
 854  854          mutex_enter(&spool->pool_lock);
 855  855          RDS_DPRINTF2("rds_is_sendq_empty", "EP(%p): "
 856  856              "Send Pool contains: %d", ep, spool->pool_nbusy);
 857  857          if (wait) {
 858  858                  while (spool->pool_nbusy != 0) {
 859  859                          if (rds_no_interrupts) {
 860  860                                  /* wait one second and try again */
 861      -                                delay(drv_usectohz(1000000));
      861 +                                delay(drv_sectohz(1));
 862  862                                  rds_poll_send_completions(ep->ep_sendcq, ep,
 863  863                                      B_TRUE);
 864  864                          } else {
 865  865                                  /* wait one second and try again */
 866  866                                  mutex_exit(&spool->pool_lock);
 867      -                                delay(drv_usectohz(1000000));
      867 +                                delay(drv_sectohz(1));
 868  868                                  mutex_enter(&spool->pool_lock);
 869  869                          }
 870  870                  }
 871  871  
 872  872                  if ((wait == 2) && (ep->ep_type == RDS_EP_TYPE_DATA)) {
 873  873                          rds_buf_t       *ackbp;
 874  874                          rds_buf_t       *prev_ackbp;
 875  875  
 876  876                          /*
 877  877                           * If the last one is acknowledged then everything
↓ open down ↓ 2 lines elided ↑ open up ↑
 880  880                          bp = spool->pool_tailp;
 881  881                          ackbp = *(rds_buf_t **)ep->ep_ack_addr;
 882  882                          prev_ackbp = ackbp;
 883  883                          RDS_DPRINTF2("rds_is_sendq_empty", "EP(%p): "
 884  884                              "Checking for acknowledgements", ep);
 885  885                          while (bp != ackbp) {
 886  886                                  RDS_DPRINTF2("rds_is_sendq_empty",
 887  887                                      "EP(%p) BP(0x%p/0x%p) last "
 888  888                                      "sent/acknowledged", ep, bp, ackbp);
 889  889                                  mutex_exit(&spool->pool_lock);
 890      -                                delay(drv_usectohz(1000000));
      890 +                                delay(drv_sectohz(1));
 891  891                                  mutex_enter(&spool->pool_lock);
 892  892  
 893  893                                  bp = spool->pool_tailp;
 894  894                                  ackbp = *(rds_buf_t **)ep->ep_ack_addr;
 895  895                                  if (ackbp == prev_ackbp) {
 896  896                                          RDS_DPRINTF2("rds_is_sendq_empty",
 897  897                                              "There has been no progress,"
 898  898                                              "give up and proceed");
 899  899                                          break;
 900  900                                  }
↓ open down ↓ 6 lines elided ↑ open up ↑
 907  907          mutex_exit(&spool->pool_lock);
 908  908  
 909  909          /* check if all the rdma acks completed */
 910  910          mutex_enter(&ep->ep_lock);
 911  911          RDS_DPRINTF2("rds_is_sendq_empty", "EP(%p): "
 912  912              "Outstanding RDMA Acks: %d", ep, ep->ep_rdmacnt);
 913  913          if (wait) {
 914  914                  while (ep->ep_rdmacnt != 0) {
 915  915                          if (rds_no_interrupts) {
 916  916                                  /* wait one second and try again */
 917      -                                delay(drv_usectohz(1000000));
      917 +                                delay(drv_sectohz(1));
 918  918                                  rds_poll_send_completions(ep->ep_sendcq, ep,
 919  919                                      B_FALSE);
 920  920                          } else {
 921  921                                  /* wait one second and try again */
 922  922                                  mutex_exit(&ep->ep_lock);
 923      -                                delay(drv_usectohz(1000000));
      923 +                                delay(drv_sectohz(1));
 924  924                                  mutex_enter(&ep->ep_lock);
 925  925                          }
 926  926                  }
 927  927          } else if (ep->ep_rdmacnt != 0) {
 928  928                          ret1 = B_FALSE;
 929  929          }
 930  930          mutex_exit(&ep->ep_lock);
 931  931  
 932  932          return (ret1);
 933  933  }
↓ open down ↓ 232 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX