Print this page
8368 remove warlock leftovers from usr/src/uts

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c
          +++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_qp.c
↓ open down ↓ 82 lines elided ↑ open up ↑
  83   83          uint32_t                sq_size, rq_size;
  84   84          uint32_t                sq_wqe_size, rq_wqe_size;
  85   85          uint32_t                max_rdb, max_sgl, uarpg;
  86   86          uint_t                  wq_location, dma_xfer_mode, qp_is_umap;
  87   87          uint_t                  qp_srq_en;
  88   88          int                     status, flag;
  89   89          char                    *errormsg;
  90   90  
  91   91          TAVOR_TNF_ENTER(tavor_qp_alloc);
  92   92  
  93      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*attr_p, *queuesz_p))
  94      -
  95   93          /*
  96   94           * Check the "options" flag.  Currently this flag tells the driver
  97   95           * whether or not the QP's work queues should be come from normal
  98   96           * system memory or whether they should be allocated from DDR memory.
  99   97           */
 100   98          if (op == NULL) {
 101   99                  wq_location = TAVOR_QUEUE_LOCATION_NORMAL;
 102  100          } else {
 103  101                  wq_location = op->qpo_wq_loc;
 104  102          }
↓ open down ↓ 138 lines elided ↑ open up ↑
 243  241           * (i.e. the Tavor Queue Pair handle).  If we fail here, we must
 244  242           * undo the reference counts and the previous resource allocation.
 245  243           */
 246  244          status = tavor_rsrc_alloc(state, TAVOR_QPHDL, 1, sleepflag, &rsrc);
 247  245          if (status != DDI_SUCCESS) {
 248  246                  /* Set "status" and "errormsg" and goto failure */
 249  247                  TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed QP handle");
 250  248                  goto qpalloc_fail4;
 251  249          }
 252  250          qp = (tavor_qphdl_t)rsrc->tr_addr;
 253      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*qp))
 254  251  
 255  252          /*
 256  253           * Calculate the QP number from QPC index.  This routine handles
 257  254           * all of the operations necessary to keep track of used, unused,
 258  255           * and released QP numbers.
 259  256           */
 260  257          status = tavor_qp_create_qpn(state, qp, qpc);
 261  258          if (status != DDI_SUCCESS) {
 262  259                  /* Set "status" and "errormsg" and goto failure */
 263  260                  TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed QPN create");
↓ open down ↓ 514 lines elided ↑ open up ↑
 778  775           * pair (i.e. the Tavor Queue Pair handle).  If we fail here, we
 779  776           * must undo the reference counts and the previous resource allocation.
 780  777           */
 781  778          status = tavor_rsrc_alloc(state, TAVOR_QPHDL, 1, sleepflag, &rsrc);
 782  779          if (status != DDI_SUCCESS) {
 783  780                  /* Set "status" and "errormsg" and goto failure */
 784  781                  TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed QP handle");
 785  782                  goto spec_qpalloc_fail4;
 786  783          }
 787  784          qp = (tavor_qphdl_t)rsrc->tr_addr;
 788      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*qp))
 789  785  
 790  786          /*
 791  787           * Actual QP number is a combination of the index of the QPC and
 792  788           * the port number.  This is because the special QP contexts must
 793  789           * be allocated two-at-a-time.
 794  790           */
 795  791          qp->qp_qpnum = qpc->tr_indx + port;
 796  792  
 797  793          /*
 798  794           * Calculate the appropriate size for the work queues.
↓ open down ↓ 372 lines elided ↑ open up ↑
1171 1167  
1172 1168          /*
1173 1169           * Drop the QP lock
1174 1170           *    At this point the lock is no longer necessary.  We cannot
1175 1171           *    protect from multiple simultaneous calls to free the same QP.
1176 1172           *    In addition, since the QP lock is contained in the QP "software
1177 1173           *    handle" resource, which we will free (see below), it is
1178 1174           *    important that we have no further references to that memory.
1179 1175           */
1180 1176          mutex_exit(&qp->qp_lock);
1181      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*qp))
1182 1177  
1183 1178          /*
1184 1179           * Free the QP resources
1185 1180           *    Start by deregistering and freeing the memory for work queues.
1186 1181           *    Next free any previously allocated context information
1187 1182           *    (depending on QP type)
1188 1183           *    Finally, decrement the necessary reference counts.
1189 1184           * If this fails for any reason, then it is an indication that
1190 1185           * something (either in HW or SW) has gone seriously wrong.  So we
1191 1186           * print a warning message and return.
↓ open down ↓ 367 lines elided ↑ open up ↑
1559 1554                   * Allocate and initialize a QPN entry, then insert
1560 1555                   * it into the AVL tree.
1561 1556                   */
1562 1557                  entry = (tavor_qpn_entry_t *)kmem_zalloc(
1563 1558                      sizeof (tavor_qpn_entry_t), KM_NOSLEEP);
1564 1559                  if (entry == NULL) {
1565 1560                          mutex_exit(&state->ts_qpn_avl_lock);
1566 1561                          TAVOR_TNF_EXIT(tavor_qp_create_qpn);
1567 1562                          return (DDI_FAILURE);
1568 1563                  }
1569      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*entry))
1570 1564  
1571 1565                  entry->qpn_indx    = qpc->tr_indx;
1572 1566                  entry->qpn_refcnt  = 0;
1573 1567                  entry->qpn_counter = 0;
1574 1568  
1575 1569                  avl_insert(&state->ts_qpn_avl, entry, where);
1576 1570          }
1577 1571  
1578 1572          /*
1579 1573           * Make the AVL tree entry point to the QP context resource that
↓ open down ↓ 497 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX