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/hermon/hermon_cq.c
          +++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_cq.c
↓ open down ↓ 76 lines elided ↑ open up ↑
  77   77          hermon_mr_options_t     op;
  78   78          hermon_pdhdl_t          pd;
  79   79          hermon_mrhdl_t          mr;
  80   80          hermon_hw_cqe_t         *buf;
  81   81          uint64_t                value;
  82   82          uint32_t                log_cq_size, uarpg;
  83   83          uint_t                  cq_is_umap;
  84   84          uint32_t                status, flag;
  85   85          hermon_cq_sched_t       *cq_schedp;
  86   86  
  87      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cq_attr))
  88      -
  89   87          /*
  90   88           * Determine whether CQ is being allocated for userland access or
  91   89           * whether it is being allocated for kernel access.  If the CQ is
  92   90           * being allocated for userland access, then lookup the UAR
  93   91           * page number for the current process.  Note:  If this is not found
  94   92           * (e.g. if the process has not previously open()'d the Hermon driver),
  95   93           * then an error is returned.
  96   94           */
  97   95          cq_is_umap = (cq_attr->cq_flags & IBT_CQ_USER_MAP) ? 1 : 0;
  98   96          if (cq_is_umap) {
↓ open down ↓ 32 lines elided ↑ open up ↑
 131  129           * (i.e. the Hermon Completion Queue handle).  If we fail here, we must
 132  130           * undo the protection domain reference count and the previous
 133  131           * resource allocation.
 134  132           */
 135  133          status = hermon_rsrc_alloc(state, HERMON_CQHDL, 1, sleepflag, &rsrc);
 136  134          if (status != DDI_SUCCESS) {
 137  135                  status = IBT_INSUFF_RESOURCE;
 138  136                  goto cqalloc_fail2;
 139  137          }
 140  138          cq = (hermon_cqhdl_t)rsrc->hr_addr;
 141      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cq))
 142  139          cq->cq_is_umap = cq_is_umap;
 143  140          cq->cq_cqnum = cqc->hr_indx;    /* just use index, implicit in Hermon */
 144  141          cq->cq_intmod_count = 0;
 145  142          cq->cq_intmod_usec = 0;
 146  143  
 147  144          /*
 148  145           * If this will be a user-mappable CQ, then allocate an entry for
 149  146           * the "userland resources database".  This will later be added to
 150  147           * the database (after all further CQ operations are successful).
 151  148           * If we fail here, we must undo the reference counts and the
↓ open down ↓ 63 lines elided ↑ open up ↑
 215  212          } else {
 216  213                  cq->cq_cqinfo.qa_location = HERMON_QUEUE_LOCATION_NORMAL;
 217  214                  hermon_arm_cq_dbr_init(cq->cq_arm_ci_vdbr);
 218  215          }
 219  216          status = hermon_queue_alloc(state, &cq->cq_cqinfo, sleepflag);
 220  217          if (status != DDI_SUCCESS) {
 221  218                  status = IBT_INSUFF_RESOURCE;
 222  219                  goto cqalloc_fail4;
 223  220          }
 224  221          buf = (hermon_hw_cqe_t *)cq->cq_cqinfo.qa_buf_aligned;
 225      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*buf))
 226  222  
 227  223          /*
 228  224           * The ownership bit of the CQE's is set by the HW during the process
 229  225           * of transferrring ownership of the CQ (PRM 09.35c, 14.2.1, note D1
 230  226           *
 231  227           */
 232  228  
 233  229          /*
 234  230           * Register the memory for the CQ.  The memory for the CQ must
 235  231           * be registered in the Hermon TPT tables.  This gives us the LKey
↓ open down ↓ 7 lines elided ↑ open up ↑
 243  239          mr_attr.mr_flags = flag | IBT_MR_ENABLE_LOCAL_WRITE;
 244  240          op.mro_bind_type   = state->hs_cfg_profile->cp_iommu_bypass;
 245  241          op.mro_bind_dmahdl = cq->cq_cqinfo.qa_dmahdl;
 246  242          op.mro_bind_override_addr = 0;
 247  243          status = hermon_mr_register(state, pd, &mr_attr, &mr, &op,
 248  244              HERMON_CQ_CMPT);
 249  245          if (status != DDI_SUCCESS) {
 250  246                  status = IBT_INSUFF_RESOURCE;
 251  247                  goto cqalloc_fail5;
 252  248          }
 253      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr))
 254  249  
 255  250          cq->cq_erreqnum = HERMON_CQ_ERREQNUM_GET(state);
 256  251          if (cq_attr->cq_flags & IBT_CQ_HID) {
 257  252                  if (!HERMON_HID_VALID(state, cq_attr->cq_hid)) {
 258  253                          IBTF_DPRINTF_L2("CQalloc", "bad handler id 0x%x",
 259  254                              cq_attr->cq_hid);
 260  255                          status = IBT_INVALID_PARAM;
 261  256                          goto cqalloc_fail5;
 262  257                  }
 263  258                  cq->cq_eqnum = HERMON_HID_TO_EQNUM(state, cq_attr->cq_hid);
↓ open down ↓ 217 lines elided ↑ open up ↑
 481  476          }
 482  477  
 483  478          /*
 484  479           * Put NULL into the Arbel CQNum-to-CQHdl list.  This will allow any
 485  480           * in-progress events to detect that the CQ corresponding to this
 486  481           * number has been freed.
 487  482           */
 488  483          hermon_icm_set_num_to_hdl(state, HERMON_CQC, cqc->hr_indx, NULL);
 489  484  
 490  485          mutex_exit(&cq->cq_lock);
 491      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cq))
 492  486  
 493  487          /*
 494  488           * Reclaim CQC entry from hardware (using the Hermon HW2SW_CQ
 495  489           * firmware command).  If the ownership transfer fails for any reason,
 496  490           * then it is an indication that something (either in HW or SW) has
 497  491           * gone seriously wrong.
 498  492           */
 499  493          status = hermon_cmn_ownership_cmd_post(state, HW2SW_CQ, &cqc_entry,
 500  494              sizeof (hermon_hw_cqc_t), cqnum, sleepflag);
 501  495          if (status != HERMON_CMD_SUCCESS) {
↓ open down ↓ 142 lines elided ↑ open up ↑
 644  638                  new_cqinfo.qa_location = HERMON_QUEUE_LOCATION_NORMAL;
 645  639          }
 646  640          status = hermon_queue_alloc(state, &new_cqinfo, sleepflag);
 647  641          if (status != DDI_SUCCESS) {
 648  642                  /* free the resize handle */
 649  643                  kmem_free(resize_hdl, sizeof (struct hermon_sw_cq_s));
 650  644                  status = IBT_INSUFF_RESOURCE;
 651  645                  goto cqresize_fail;
 652  646          }
 653  647          buf = (hermon_hw_cqe_t *)new_cqinfo.qa_buf_aligned;
 654      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*buf))
 655  648  
 656  649          /*
 657  650           * No initialization of the cq is needed - the command will do it
 658  651           */
 659  652  
 660  653          /*
 661  654           * Register the memory for the CQ.  The memory for the CQ must
 662  655           * be registered in the Hermon TPT tables.  This gives us the LKey
 663  656           * to specify in the CQ context below.
 664  657           */
↓ open down ↓ 7 lines elided ↑ open up ↑
 672  665          op.mro_bind_override_addr = 0;
 673  666          status = hermon_mr_register(state, pd, &mr_attr, &mr, &op,
 674  667              HERMON_CQ_CMPT);
 675  668          if (status != DDI_SUCCESS) {
 676  669                  hermon_queue_free(&new_cqinfo);
 677  670                  /* free the resize handle */
 678  671                  kmem_free(resize_hdl, sizeof (struct hermon_sw_cq_s));
 679  672                  status = IBT_INSUFF_RESOURCE;
 680  673                  goto cqresize_fail;
 681  674          }
 682      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr))
 683  675  
 684  676          /*
 685  677           * Now we grab the CQ lock.  Since we will be updating the actual
 686  678           * CQ location and the producer/consumer indexes, we should hold
 687  679           * the lock.
 688  680           *
 689  681           * We do a ARBEL_NOSLEEP here (and below), though, because we are
 690  682           * holding the "cq_lock" and if we got raised to interrupt level
 691  683           * by priority inversion, we would not want to block in this routine
 692  684           * waiting for success.
↓ open down ↓ 620 lines elided ↑ open up ↑
1313 1305           * See hermon_wr.c for more details.
1314 1306           */
1315 1307          wc->wc_id = hermon_wrid_get_entry(cq, cqe);
1316 1308  
1317 1309          /*
1318 1310           * Parse the CQE opcode to determine completion type.  This will set
1319 1311           * not only the type of the completion, but also any flags that might
1320 1312           * be associated with it (e.g. whether immediate data is present).
1321 1313           */
1322 1314          flags = IBT_WC_NO_FLAGS;
1323      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->hs_fcoib_may_be_running))
1324 1315          if (HERMON_CQE_SENDRECV_GET(cq, cqe) != HERMON_COMPLETION_RECV) {
1325 1316  
1326 1317                  /* Send CQE */
1327 1318                  switch (opcode) {
1328 1319                  case HERMON_CQE_SND_RDMAWR_IMM:
1329 1320                  case HERMON_CQE_SND_RDMAWR:
1330 1321                          type = IBT_WRC_RDMAW;
1331 1322                          break;
1332 1323  
1333 1324                  case HERMON_CQE_SND_SEND_INV:
↓ open down ↓ 655 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX