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_misc.c
          +++ new/usr/src/uts/common/io/ib/adapters/tavor/tavor_misc.c
↓ open down ↓ 117 lines elided ↑ open up ↑
 118  118           * (i.e. the Tavor Address Handle struct).  If we fail here, we must
 119  119           * undo the previous resource allocation.
 120  120           */
 121  121          status = tavor_rsrc_alloc(state, TAVOR_AHHDL, 1, sleepflag, &rsrc);
 122  122          if (status != DDI_SUCCESS) {
 123  123                  /* Set "status" and "errormsg" and goto failure */
 124  124                  TAVOR_TNF_FAIL(IBT_INSUFF_RESOURCE, "failed AH handler");
 125  125                  goto ahalloc_fail1;
 126  126          }
 127  127          ah = (tavor_ahhdl_t)rsrc->tr_addr;
 128      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ah))
 129  128  
 130  129          /* Increment the reference count on the protection domain (PD) */
 131  130          tavor_pd_refcnt_inc(pd);
 132  131  
 133  132          /*
 134  133           * Fill in the UDAV entry.  Note: We are only filling in a temporary
 135  134           * copy here, which we will later copy into the actual entry in
 136  135           * Tavor DDR memory.  This starts be zeroing out the temporary copy
 137  136           * and then calling tavor_set_addr_path() to fill in the common
 138  137           * portions that can be pulled from the "ibt_adds_vect_t" passed in
↓ open down ↓ 118 lines elided ↑ open up ↑
 257  256           * struct.  This is necessary here because the resource for the
 258  257           * AH is going to be freed up as part of this operation.
 259  258           */
 260  259          ah    = *ahhdl;
 261  260          mutex_enter(&ah->ah_lock);
 262  261          udav  = ah->ah_udavrsrcp;
 263  262          rsrc  = ah->ah_rsrcp;
 264  263          pd    = ah->ah_pdhdl;
 265  264          mr    = ah->ah_mrhdl;
 266  265          mutex_exit(&ah->ah_lock);
 267      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ah))
 268  266  
 269  267          /*
 270  268           * Deregister the memory for the UDAV.  If this fails for any reason,
 271  269           * then it is an indication that something (either in HW or SW) has
 272  270           * gone seriously wrong.  So we print a warning message and return
 273  271           * failure.
 274  272           */
 275  273          status = tavor_mr_deregister(state, &mr, TAVOR_MR_DEREG_ALL,
 276  274              sleepflag);
 277  275          if (status != DDI_SUCCESS) {
↓ open down ↓ 41 lines elided ↑ open up ↑
 319  317  {
 320  318          tavor_hw_udav_t         udav_entry;
 321  319          tavor_rsrc_t            *udav;
 322  320          uint64_t                data;
 323  321          uint32_t                size;
 324  322          int                     i;
 325  323  
 326  324          TAVOR_TNF_ENTER(tavor_ah_query);
 327  325  
 328  326          mutex_enter(&ah->ah_lock);
 329      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*attr_p))
 330  327  
 331  328          /*
 332  329           * Pull all the necessary information from the Tavor Address Handle
 333  330           * structure
 334  331           */
 335  332          udav    = ah->ah_udavrsrcp;
 336  333          *pd     = ah->ah_pdhdl;
 337  334  
 338  335          /*
 339  336           * Copy the UDAV entry into the temporary copy.  Here we copy all
↓ open down ↓ 170 lines elided ↑ open up ↑
 510  507  /* ARGSUSED */
 511  508  static void
 512  509  tavor_udav_sync(tavor_ahhdl_t ah, tavor_hw_udav_t *udav, uint_t flag)
 513  510  {
 514  511          ddi_dma_handle_t        dmahdl;
 515  512          off_t                   offset;
 516  513          int                     status;
 517  514  
 518  515          TAVOR_TNF_ENTER(tavor_udav_sync);
 519  516  
 520      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ah))
 521      -
 522  517          /* Determine if AH needs to be synced or not */
 523  518          if (ah->ah_sync == 0) {
 524  519                  TAVOR_TNF_EXIT(tavor_udav_sync);
 525  520                  return;
 526  521          }
 527  522  
 528  523          /* Get the DMA handle from AH handle */
 529  524          dmahdl = ah->ah_mrhdl->mr_bindinfo.bi_dmahdl;
 530  525  
 531  526          /* Calculate offset into address handle */
↓ open down ↓ 1193 lines elided ↑ open up ↑
1725 1720           * is necessary is for software to initialize the PD reference count
1726 1721           * (to zero) and return success.
1727 1722           */
1728 1723          status = tavor_rsrc_alloc(state, TAVOR_PDHDL, 1, sleepflag, &rsrc);
1729 1724          if (status != DDI_SUCCESS) {
1730 1725                  TNF_PROBE_0(tavor_pd_alloc_rsrcalloc_fail, TAVOR_TNF_ERROR, "");
1731 1726                  TAVOR_TNF_EXIT(tavor_pd_alloc);
1732 1727                  return (IBT_INSUFF_RESOURCE);
1733 1728          }
1734 1729          pd = (tavor_pdhdl_t)rsrc->tr_addr;
1735      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pd))
1736 1730  
1737 1731          pd->pd_refcnt = 0;
1738 1732          *pdhdl = pd;
1739 1733  
1740 1734          TAVOR_TNF_EXIT(tavor_pd_alloc);
1741 1735          return (DDI_SUCCESS);
1742 1736  }
1743 1737  
1744 1738  
1745 1739  /*
↓ open down ↓ 7 lines elided ↑ open up ↑
1753 1747          tavor_pdhdl_t   pd;
1754 1748  
1755 1749          TAVOR_TNF_ENTER(tavor_pd_free);
1756 1750  
1757 1751          /*
1758 1752           * Pull all the necessary information from the Tavor Protection Domain
1759 1753           * handle.  This is necessary here because the resource for the
1760 1754           * PD is going to be freed up as part of this operation.
1761 1755           */
1762 1756          pd   = *pdhdl;
1763      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pd))
1764 1757          rsrc = pd->pd_rsrcp;
1765 1758  
1766 1759          /*
1767 1760           * Check the PD reference count.  If the reference count is non-zero,
1768 1761           * then it means that this protection domain is still referenced by
1769 1762           * some memory region, queue pair, address handle, or other IB object
1770 1763           * If it is non-zero, then return an error.  Otherwise, free the
1771 1764           * Tavor resource and return success.
1772 1765           */
1773 1766          if (pd->pd_refcnt != 0) {
↓ open down ↓ 57 lines elided ↑ open up ↑
1831 1824  {
1832 1825          sm_portinfo_t           portinfo;
1833 1826          sm_guidinfo_t           guidinfo;
1834 1827          sm_pkey_table_t         pkeytable;
1835 1828          ib_gid_t                *sgid;
1836 1829          uint_t                  sgid_max, pkey_max, tbl_size;
1837 1830          int                     i, j, indx, status;
1838 1831  
1839 1832          TAVOR_TNF_ENTER(tavor_port_query);
1840 1833  
1841      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pi))
1842      -
1843 1834          /* Validate that specified port number is legal */
1844 1835          if (!tavor_portnum_is_valid(state, port)) {
1845 1836                  TNF_PROBE_1(tavor_port_query_inv_portnum_fail,
1846 1837                      TAVOR_TNF_ERROR, "", tnf_uint, port, port);
1847 1838                  TAVOR_TNF_EXIT(tavor_port_query);
1848 1839                  return (IBT_HCA_PORT_INVALID);
1849 1840          }
1850 1841  
1851 1842          /*
1852 1843           * We use the Tavor MAD_IFC command to post a GetPortInfo MAD
↓ open down ↓ 74 lines elided ↑ open up ↑
1927 1918                              TAVOR_TNF_ERROR, "", tnf_uint, cmd_status, status);
1928 1919                          TAVOR_TNF_EXIT(tavor_port_query);
1929 1920                          return (ibc_get_ci_failure(0));
1930 1921                  }
1931 1922  
1932 1923                  /* Figure out how many of the entries are valid */
1933 1924                  sgid_max = min((pi->p_sgid_tbl_sz - i), 8);
1934 1925                  for (j = 0; j < sgid_max; j++) {
1935 1926                          indx = (i + j);
1936 1927                          sgid = &pi->p_sgid_tbl[indx];
1937      -                        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sgid))
1938 1928                          sgid->gid_prefix = portinfo.GidPrefix;
1939 1929                          sgid->gid_guid   = guidinfo.GUIDBlocks[j];
1940 1930                  }
1941 1931          }
1942 1932  
1943 1933          /*
1944 1934           * Fill in the PKey table.  Just as for the GID tables above, the
1945 1935           * only access to the Tavor PKey tables is through the firmware's
1946 1936           * MAD_IFC interface.  We post as many GetPKeyTable MADs as necessary
1947 1937           * to read in the entire contents of the PKey table (for the specified
↓ open down ↓ 143 lines elided ↑ open up ↑
2091 2081   * an additional flag to indicate which type is being filled.
2092 2082   */
2093 2083  int
2094 2084  tavor_set_addr_path(tavor_state_t *state, ibt_adds_vect_t *av,
2095 2085      tavor_hw_addr_path_t *path, uint_t type, tavor_qphdl_t qp)
2096 2086  {
2097 2087          uint_t          gidtbl_sz;
2098 2088  
2099 2089          TAVOR_TNF_ENTER(tavor_set_addr_path);
2100 2090  
2101      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*av))
2102      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*path))
2103      -
2104 2091          path->ml_path   = av->av_src_path;
2105 2092          path->rlid      = av->av_dlid;
2106 2093          path->sl        = av->av_srvl;
2107 2094  
2108 2095          /* Port number only valid (in "av_port_num") if this is a UDAV */
2109 2096          if (type == TAVOR_ADDRPATH_UDAV) {
2110 2097                  path->portnum = av->av_port_num;
2111 2098          }
2112 2099  
2113 2100          /*
↓ open down ↓ 31 lines elided ↑ open up ↑
2145 2132                              TAVOR_TNF_ERROR, "", tnf_uint, srate, av->av_srate);
2146 2133                          TAVOR_TNF_EXIT(tavor_set_addr_path);
2147 2134                          return (IBT_STATIC_RATE_INVALID);
2148 2135                  }
2149 2136          }
2150 2137  
2151 2138          /*
2152 2139           * If this is a QP operation save asoft copy.
2153 2140           */
2154 2141          if (qp) {
2155      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(qp->qp_save_srate))
2156 2142                  qp->qp_save_srate = av->av_srate;
2157 2143          }
2158 2144  
2159 2145          /* If "grh" flag is set, then check for valid SGID index too */
2160 2146          gidtbl_sz = (1 << state->ts_devlim.log_max_gid);
2161 2147          if ((av->av_send_grh) && (av->av_sgid_ix > gidtbl_sz)) {
2162 2148                  TNF_PROBE_1(tavor_set_addr_path_inv_sgid_ix_fail,
2163 2149                      TAVOR_TNF_ERROR, "", tnf_uint, sgid_ix, av->av_sgid_ix);
2164 2150                  TAVOR_TNF_EXIT(tavor_set_addr_path);
2165 2151                  return (IBT_SGID_INVALID);
↓ open down ↓ 56 lines elided ↑ open up ↑
2222 2208   * structures are similar, common fields can be read in here.  But because
2223 2209   * they are slightly different, we pass an additional flag to indicate which
2224 2210   * type is being read.
2225 2211   */
2226 2212  void
2227 2213  tavor_get_addr_path(tavor_state_t *state, tavor_hw_addr_path_t *path,
2228 2214      ibt_adds_vect_t *av, uint_t type, tavor_qphdl_t qp)
2229 2215  {
2230 2216          uint_t          gidtbl_sz;
2231 2217  
2232      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*path))
2233      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*av))
2234      -
2235 2218          av->av_src_path = path->ml_path;
2236 2219          av->av_port_num = path->portnum;
2237 2220          av->av_dlid     = path->rlid;
2238 2221          av->av_srvl     = path->sl;
2239 2222  
2240 2223          /*
2241 2224           * Set "av_ipd" value from max_stat_rate.
2242 2225           */
2243 2226          if (qp) {
2244 2227                  /*
2245 2228                   * If a QP operation use the soft copy
2246 2229                   */
2247      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(qp->qp_save_srate))
2248 2230                  av->av_srate = qp->qp_save_srate;
2249 2231          } else {
2250 2232                  /*
2251 2233                   * The stat_rate_sup is used to decide how the srate value is
2252 2234                   * set and
2253 2235                   * if it is zero, the driver uses the old interface.
2254 2236                   */
2255 2237                  if (state->ts_devlim.stat_rate_sup) {
2256 2238                          if (path->max_stat_rate == 0) {
2257 2239                                  av->av_srate = IBT_SRATE_20; /* 4x@DDR rate */
↓ open down ↓ 86 lines elided ↑ open up ↑
2344 2326      uint_t sleepflag)
2345 2327  {
2346 2328          ddi_dma_attr_t          dma_attr;
2347 2329          int                     (*callback)(caddr_t);
2348 2330          uint64_t                realsize, alloc_mask;
2349 2331          uint_t                  dma_xfer_mode, type;
2350 2332          int                     flag, status;
2351 2333  
2352 2334          TAVOR_TNF_ENTER(tavor_queue_alloc);
2353 2335  
2354      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*qa_info))
2355      -
2356 2336          /* Set the callback flag appropriately */
2357 2337          callback = (sleepflag == TAVOR_SLEEP) ? DDI_DMA_SLEEP :
2358 2338              DDI_DMA_DONTWAIT;
2359 2339  
2360 2340          /*
2361 2341           * Initialize many of the default DMA attributes.  Then set additional
2362 2342           * alignment restrictions as necessary for the queue memory.  Also
2363 2343           * respect the configured value for IOMMU bypass
2364 2344           */
2365 2345          tavor_dma_attr_init(&dma_attr);
↓ open down ↓ 134 lines elided ↑ open up ↑
2500 2480  
2501 2481  /*
2502 2482   * tavor_queue_free()
2503 2483   *    Context: Can be called from interrupt or base context.
2504 2484   */
2505 2485  void
2506 2486  tavor_queue_free(tavor_state_t *state, tavor_qalloc_info_t *qa_info)
2507 2487  {
2508 2488          TAVOR_TNF_ENTER(tavor_queue_free);
2509 2489  
2510      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*qa_info))
2511      -
2512 2490          /*
2513 2491           * Depending on how (i.e. from where) we allocated the memory for
2514 2492           * this queue, we choose the appropriate method for releasing the
2515 2493           * resources.
2516 2494           */
2517 2495          if (qa_info->qa_location == TAVOR_QUEUE_LOCATION_NORMAL) {
2518 2496  
2519 2497                  ddi_dma_mem_free(&qa_info->qa_acchdl);
2520 2498  
2521 2499          } else if (qa_info->qa_location == TAVOR_QUEUE_LOCATION_USERLAND) {
↓ open down ↓ 13 lines elided ↑ open up ↑
2535 2513  }
2536 2514  
2537 2515  
2538 2516  /*
2539 2517   * tavor_dmaattr_get()
2540 2518   *    Context: Can be called from interrupt or base context.
2541 2519   */
2542 2520  void
2543 2521  tavor_dma_attr_init(ddi_dma_attr_t *dma_attr)
2544 2522  {
2545      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*dma_attr))
2546      -
2547 2523          dma_attr->dma_attr_version      = DMA_ATTR_V0;
2548 2524          dma_attr->dma_attr_addr_lo      = 0;
2549 2525          dma_attr->dma_attr_addr_hi      = 0xFFFFFFFFFFFFFFFFull;
2550 2526          dma_attr->dma_attr_count_max    = 0xFFFFFFFFFFFFFFFFull;
2551 2527          dma_attr->dma_attr_align        = 1;
2552 2528          dma_attr->dma_attr_burstsizes   = 0x3FF;
2553 2529          dma_attr->dma_attr_minxfer      = 1;
2554 2530          dma_attr->dma_attr_maxxfer      = 0xFFFFFFFFFFFFFFFFull;
2555 2531          dma_attr->dma_attr_seg          = 0xFFFFFFFFFFFFFFFFull;
2556 2532          dma_attr->dma_attr_sgllen       = 0x7FFFFFFF;
2557 2533          dma_attr->dma_attr_granular     = 1;
2558 2534          dma_attr->dma_attr_flags        = 0;
2559 2535  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX