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_srq.c
          +++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_srq.c
↓ open down ↓ 66 lines elided ↑ open up ↑
  67   67          hermon_mr_options_t     mr_op;
  68   68          hermon_mrhdl_t          mr;
  69   69          uint64_t                value, srq_desc_off;
  70   70          uint32_t                log_srq_size;
  71   71          uint32_t                uarpg;
  72   72          uint_t                  srq_is_umap;
  73   73          int                     flag, status;
  74   74          uint_t                  max_sgl;
  75   75          uint_t                  wqesz;
  76   76          uint_t                  srq_wr_sz;
  77      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sizes))
  78   77  
  79   78          /*
  80   79           * options-->wq_location used to be for location, now explicitly
  81   80           * LOCATION_NORMAL
  82   81           */
  83   82  
  84   83          /*
  85   84           * Extract the necessary info from the hermon_srq_info_t structure
  86   85           */
  87   86          real_sizes = srqinfo->srqi_real_sizes;
↓ open down ↓ 35 lines elided ↑ open up ↑
 123  122          }
 124  123  
 125  124          /* Allocate the SRQ Handle entry */
 126  125          status = hermon_rsrc_alloc(state, HERMON_SRQHDL, 1, sleepflag, &rsrc);
 127  126          if (status != DDI_SUCCESS) {
 128  127                  status = IBT_INSUFF_RESOURCE;
 129  128                  goto srqalloc_fail2;
 130  129          }
 131  130  
 132  131          srq = (hermon_srqhdl_t)rsrc->hr_addr;
 133      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*srq))
 134  132  
 135  133          bzero(srq, sizeof (struct hermon_sw_srq_s));
 136  134          /* Calculate the SRQ number */
 137  135  
 138  136          /* just use the index, implicit in Hermon */
 139  137          srq->srq_srqnum = srqc->hr_indx;
 140  138  
 141  139          /*
 142  140           * If this will be a user-mappable SRQ, then allocate an entry for
 143  141           * the "userland resources database".  This will later be added to
↓ open down ↓ 105 lines elided ↑ open up ↑
 249  247                  srq->srq_wqinfo.qa_location = HERMON_QUEUE_LOCATION_USERLAND;
 250  248          } else {
 251  249                  srq->srq_wqinfo.qa_location = HERMON_QUEUE_LOCATION_NORMAL;
 252  250          }
 253  251          status = hermon_queue_alloc(state, &srq->srq_wqinfo, sleepflag);
 254  252          if (status != DDI_SUCCESS) {
 255  253                  status = IBT_INSUFF_RESOURCE;
 256  254                  goto srqalloc_fail4a;
 257  255          }
 258  256          buf = (uint32_t *)srq->srq_wqinfo.qa_buf_aligned;
 259      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*buf))
 260  257  
 261  258          /*
 262  259           * Register the memory for the SRQ work queues.  The memory for the SRQ
 263  260           * must be registered in the Hermon cMPT tables.  This gives us the LKey
 264  261           * to specify in the SRQ context later.  Note: If the work queue is to
 265  262           * be allocated from DDR memory, then only a "bypass" mapping is
 266  263           * appropriate.  And if the SRQ memory is user-mappable, then we force
 267  264           * DDI_DMA_CONSISTENT mapping.  Also, in order to meet the alignment
 268  265           * restriction, we pass the "mro_bind_override_addr" flag in the call
 269  266           * to hermon_mr_register().  This guarantees that the resulting IB vaddr
↓ open down ↓ 9 lines elided ↑ open up ↑
 279  276          mr_attr.mr_flags = flag | IBT_MR_ENABLE_LOCAL_WRITE;
 280  277          mr_op.mro_bind_type   = state->hs_cfg_profile->cp_iommu_bypass;
 281  278          mr_op.mro_bind_dmahdl = srq->srq_wqinfo.qa_dmahdl;
 282  279          mr_op.mro_bind_override_addr = 1;
 283  280          status = hermon_mr_register(state, pd, &mr_attr, &mr,
 284  281              &mr_op, HERMON_SRQ_CMPT);
 285  282          if (status != DDI_SUCCESS) {
 286  283                  status = IBT_INSUFF_RESOURCE;
 287  284                  goto srqalloc_fail5;
 288  285          }
 289      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr))
 290  286  
 291  287          /*
 292  288           * Calculate the offset between the kernel virtual address space
 293  289           * and the IB virtual address space.  This will be used when
 294  290           * posting work requests to properly initialize each WQE.
 295  291           */
 296  292          srq_desc_off = (uint64_t)(uintptr_t)srq->srq_wqinfo.qa_buf_aligned -
 297  293              (uint64_t)mr->mr_bindinfo.bi_addr;
 298  294  
 299  295          srq->srq_wq_wqhdr = hermon_wrid_wqhdr_create(1 << log_srq_size);
↓ open down ↓ 213 lines elided ↑ open up ↑
 513  509          }
 514  510  
 515  511          /*
 516  512           * Put NULL into the Hermon SRQNum-to-SRQHdl list.  This will allow any
 517  513           * in-progress events to detect that the SRQ corresponding to this
 518  514           * number has been freed.
 519  515           */
 520  516          hermon_icm_set_num_to_hdl(state, HERMON_SRQC, srqc->hr_indx, NULL);
 521  517  
 522  518          mutex_exit(&srq->srq_lock);
 523      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*srq));
 524  519  
 525  520          /*
 526  521           * Reclaim SRQC entry from hardware (using the Hermon HW2SW_SRQ
 527  522           * firmware command).  If the ownership transfer fails for any reason,
 528  523           * then it is an indication that something (either in HW or SW) has
 529  524           * gone seriously wrong.
 530  525           */
 531  526          status = hermon_cmn_ownership_cmd_post(state, HW2SW_SRQ, &srqc_entry,
 532  527              sizeof (hermon_hw_srqc_t), srqnum, sleepflag);
 533  528          if (status != HERMON_CMD_SUCCESS) {
↓ open down ↓ 123 lines elided ↑ open up ↑
 657  652                  new_srqinfo.qa_location = HERMON_QUEUE_LOCATION_USERLAND;
 658  653          } else {
 659  654                  new_srqinfo.qa_location = HERMON_QUEUE_LOCATION_NORMAL;
 660  655          }
 661  656          status = hermon_queue_alloc(state, &new_srqinfo, sleepflag);
 662  657          if (status != DDI_SUCCESS) {
 663  658                  status = IBT_INSUFF_RESOURCE;
 664  659                  goto srqmodify_fail;
 665  660          }
 666  661          buf = (uint32_t *)new_srqinfo.qa_buf_aligned;
 667      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*buf))
 668  662  
 669  663          /*
 670  664           * Allocate the memory for the new WRE list.  This will be used later
 671  665           * when we resize the wridlist based on the new SRQ size.
 672  666           */
 673  667          wre_new = kmem_zalloc((1 << log_srq_size) * sizeof (uint64_t),
 674  668              sleepflag);
 675  669          if (wre_new == NULL) {
 676  670                  status = IBT_INSUFF_RESOURCE;
 677  671                  goto srqmodify_fail;
 678  672          }
 679  673  
 680  674          /*
 681  675           * Fill in the "bind" struct.  This struct provides the majority
 682  676           * of the information that will be used to distinguish between an
 683  677           * "addr" binding (as is the case here) and a "buf" binding (see
 684  678           * below).  The "bind" struct is later passed to hermon_mr_mem_bind()
 685  679           * which does most of the "heavy lifting" for the Hermon memory
 686  680           * registration routines.
 687  681           */
 688      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(bind))
 689  682          bzero(&bind, sizeof (hermon_bind_info_t));
 690  683          bind.bi_type  = HERMON_BINDHDL_VADDR;
 691  684          bind.bi_addr  = (uint64_t)(uintptr_t)buf;
 692  685          bind.bi_len   = new_srqinfo.qa_size;
 693  686          bind.bi_as    = NULL;
 694  687          bind.bi_flags = sleepflag == HERMON_SLEEP ? IBT_MR_SLEEP :
 695  688              IBT_MR_NOSLEEP | IBT_MR_ENABLE_LOCAL_WRITE;
 696  689          bind.bi_bypass = state->hs_cfg_profile->cp_iommu_bypass;
 697  690  
 698  691          status = hermon_mr_mtt_bind(state, &bind, new_srqinfo.qa_dmahdl, &mtt,
↓ open down ↓ 299 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX