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_ioctl.c
          +++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_ioctl.c
↓ open down ↓ 865 lines elided ↑ open up ↑
 866  866          }
 867  867  
 868  868          /* Allocate space for temporary GID table/PKey table */
 869  869          tbl_size = (1 << state->hs_cfg_profile->cp_log_max_gidtbl);
 870  870          sgid_tbl = (ib_gid_t *)kmem_zalloc(tbl_size * sizeof (ib_gid_t),
 871  871              KM_SLEEP);
 872  872          tbl_size = (1 << state->hs_cfg_profile->cp_log_max_pkeytbl);
 873  873          pkey_tbl = (ib_pkey_t *)kmem_zalloc(tbl_size * sizeof (ib_pkey_t),
 874  874              KM_SLEEP);
 875  875  
 876      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sgid_tbl, *pkey_tbl))
 877      -
 878  876          /*
 879  877           * Setup the number of ports, then loop through all ports and
 880  878           * query properties of each.
 881  879           */
 882  880          info.ap_num_ports = (uint8_t)state->hs_cfg_profile->cp_num_ports;
 883  881          for (i = 0; i < info.ap_num_ports; i++) {
 884  882                  /*
 885  883                   * Get portstate information from the device.  If
 886  884                   * hermon_port_query() fails, leave zeroes in user
 887  885                   * struct port entry and continue.
↓ open down ↓ 56 lines elided ↑ open up ↑
 944  942  hermon_ioctl_loopback(hermon_state_t *state, intptr_t arg, int mode)
 945  943  {
 946  944          hermon_loopback_ioctl_t lb;
 947  945          hermon_loopback_state_t lstate;
 948  946          ibt_hca_portinfo_t      pi;
 949  947          uint_t                  tbl_size, loopmax, max_usec;
 950  948          ib_gid_t                *sgid_tbl;
 951  949          ib_pkey_t               *pkey_tbl;
 952  950          int                     j, iter, ret;
 953  951  
 954      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(lstate))
 955      -
 956  952          /*
 957  953           * Access to Hemron VTS ioctls is not allowed in "maintenance mode".
 958  954           */
 959  955          if (state->hs_operational_mode == HERMON_MAINTENANCE_MODE) {
 960  956                  return (EFAULT);
 961  957          }
 962  958  
 963  959          /* copyin the user struct to kernel */
 964  960  #ifdef _MULTI_DATAMODEL
 965  961          if (ddi_model_convert_from(mode & FMODELS) == DDI_MODEL_ILP32) {
↓ open down ↓ 1176 lines elided ↑ open up ↑
2142 2138  
2143 2139          /* initialize the FMA retry loop */
2144 2140          hermon_pio_init(fm_loop_cnt, fm_status, fm_test);
2145 2141  
2146 2142          /* Set handle */
2147 2143          hdl = hermon_get_pcihdl(state);
2148 2144  
2149 2145          /* Determine the bank setting from the address */
2150 2146          bank = addr & HERMON_HW_FLASH_BANK_MASK;
2151 2147  
2152      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(state->hs_fw_flashbank))
2153      -
2154 2148          /*
2155 2149           * If the bank is different from the currently set bank, we need to
2156 2150           * change it.  Also, if an 'addr' of 0 is given, this allows the
2157 2151           * capability to force the flash bank to 0.  This is useful at init
2158 2152           * time to initially set the bank value
2159 2153           */
2160 2154          if (state->hs_fw_flashbank != bank || addr == 0) {
2161 2155                  switch (state->hs_fw_cmdset) {
2162 2156                  case HERMON_FLASH_SPI_CMDSET:
2163 2157                          /* CMJ: not needed for hermon */
↓ open down ↓ 601 lines elided ↑ open up ↑
2765 2759  }
2766 2760  
2767 2761  /*
2768 2762   * hermon_loopback_free_qps
2769 2763   */
2770 2764  static void
2771 2765  hermon_loopback_free_qps(hermon_loopback_state_t *lstate)
2772 2766  {
2773 2767          int i;
2774 2768  
2775      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*lstate))
2776      -
2777 2769          if (lstate->hls_tx.hlc_qp_hdl != NULL) {
2778 2770                  (void) hermon_qp_free(lstate->hls_state,
2779 2771                      &lstate->hls_tx.hlc_qp_hdl, IBC_FREE_QP_AND_QPN, NULL,
2780 2772                      HERMON_NOSLEEP);
2781 2773          }
2782 2774          if (lstate->hls_rx.hlc_qp_hdl != NULL) {
2783 2775                  (void) hermon_qp_free(lstate->hls_state,
2784 2776                      &lstate->hls_rx.hlc_qp_hdl, IBC_FREE_QP_AND_QPN, NULL,
2785 2777                      HERMON_NOSLEEP);
2786 2778          }
↓ open down ↓ 41 lines elided ↑ open up ↑
2828 2820          }
2829 2821          bzero(lstate, sizeof (hermon_loopback_state_t));
2830 2822  }
2831 2823  
2832 2824  /*
2833 2825   * hermon_loopback_init
2834 2826   */
2835 2827  static int
2836 2828  hermon_loopback_init(hermon_state_t *state, hermon_loopback_state_t *lstate)
2837 2829  {
2838      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*lstate))
2839      -
2840 2830          lstate->hls_hca_hdl = (ibc_hca_hdl_t)state;
2841 2831          lstate->hls_status  = hermon_pd_alloc(lstate->hls_state,
2842 2832              &lstate->hls_pd_hdl, HERMON_NOSLEEP);
2843 2833          if (lstate->hls_status != IBT_SUCCESS) {
2844 2834                  lstate->hls_err = HERMON_LOOPBACK_PROT_DOMAIN_ALLOC_FAIL;
2845 2835                  return (EFAULT);
2846 2836          }
2847 2837  
2848 2838          return (0);
2849 2839  }
↓ open down ↓ 42 lines elided ↑ open up ↑
2892 2882          comm->hlc_qp_info.qp_transport.rc.rc_path_mtu = IB_MTU_1K;
2893 2883  }
2894 2884  
2895 2885  /*
2896 2886   * hermon_loopback_alloc_mem
2897 2887   */
2898 2888  static int
2899 2889  hermon_loopback_alloc_mem(hermon_loopback_state_t *lstate,
2900 2890      hermon_loopback_comm_t *comm, int sz)
2901 2891  {
2902      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*comm))
2903      -
2904 2892          /* Allocate buffer of specified size */
2905 2893          comm->hlc_buf_sz = sz;
2906 2894          comm->hlc_buf    = kmem_zalloc(sz, KM_NOSLEEP);
2907 2895          if (comm->hlc_buf == NULL) {
2908 2896                  return (EFAULT);
2909 2897          }
2910 2898  
2911 2899          /* Register the buffer as a memory region */
2912 2900          comm->hlc_memattr.mr_vaddr = (uint64_t)(uintptr_t)comm->hlc_buf;
2913 2901          comm->hlc_memattr.mr_len   = (ib_msglen_t)sz;
2914 2902          comm->hlc_memattr.mr_as    = NULL;
2915 2903          comm->hlc_memattr.mr_flags = IBT_MR_NOSLEEP |
2916 2904              IBT_MR_ENABLE_REMOTE_WRITE | IBT_MR_ENABLE_LOCAL_WRITE;
2917 2905  
2918 2906          comm->hlc_status = hermon_mr_register(lstate->hls_state,
2919 2907              lstate->hls_pd_hdl, &comm->hlc_memattr, &comm->hlc_mrhdl,
2920 2908              NULL, HERMON_MPT_DMPT);
2921 2909  
2922      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*comm->hlc_mrhdl))
2923      -
2924 2910          comm->hlc_mrdesc.md_vaddr  = comm->hlc_mrhdl->mr_bindinfo.bi_addr;
2925 2911          comm->hlc_mrdesc.md_lkey   = comm->hlc_mrhdl->mr_lkey;
2926 2912          comm->hlc_mrdesc.md_rkey   = comm->hlc_mrhdl->mr_rkey;
2927 2913          if (comm->hlc_status != IBT_SUCCESS) {
2928 2914                  return (EFAULT);
2929 2915          }
2930 2916          return (0);
2931 2917  }
2932 2918  
2933 2919  /*
2934 2920   * hermon_loopback_alloc_qps
2935 2921   */
2936 2922  static int
2937 2923  hermon_loopback_alloc_qps(hermon_loopback_state_t *lstate,
2938 2924      hermon_loopback_comm_t *comm)
2939 2925  {
2940 2926          uint32_t                i, real_size;
2941 2927          hermon_qp_info_t                qpinfo;
2942 2928  
2943      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*comm))
2944      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*lstate))
2945      -
2946 2929          /* Allocate send and recv CQs */
2947 2930          for (i = 0; i < 2; i++) {
2948 2931                  bzero(&comm->hlc_cq_attr, sizeof (ibt_cq_attr_t));
2949 2932                  comm->hlc_cq_attr.cq_size = 128;
2950 2933                  comm->hlc_status = hermon_cq_alloc(lstate->hls_state,
2951 2934                      (ibt_cq_hdl_t)NULL, &comm->hlc_cq_attr, &real_size,
2952 2935                      &comm->hlc_cqhdl[i], HERMON_NOSLEEP);
2953 2936                  if (comm->hlc_status != IBT_SUCCESS) {
2954 2937                          lstate->hls_err += i;
2955 2938                          return (EFAULT);
↓ open down ↓ 25 lines elided ↑ open up ↑
2981 2964          return (0);
2982 2965  }
2983 2966  
2984 2967  /*
2985 2968   * hermon_loopback_modify_qp
2986 2969   */
2987 2970  static int
2988 2971  hermon_loopback_modify_qp(hermon_loopback_state_t *lstate,
2989 2972      hermon_loopback_comm_t *comm, uint_t qp_num)
2990 2973  {
2991      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*comm))
2992      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*lstate))
2993      -
2994 2974          /* Modify QP to INIT */
2995 2975          hermon_loopback_init_qp_info(lstate, comm);
2996 2976          comm->hlc_qp_info.qp_state = IBT_STATE_INIT;
2997 2977          comm->hlc_status = hermon_qp_modify(lstate->hls_state, comm->hlc_qp_hdl,
2998 2978              IBT_CEP_SET_STATE, &comm->hlc_qp_info, &comm->hlc_queue_sizes);
2999 2979          if (comm->hlc_status != IBT_SUCCESS) {
3000 2980                  return (EFAULT);
3001 2981          }
3002 2982  
3003 2983          /*
↓ open down ↓ 61 lines elided ↑ open up ↑
3065 3045  
3066 3046  /*
3067 3047   * hermon_loopback_post_send
3068 3048   */
3069 3049  static int
3070 3050  hermon_loopback_post_send(hermon_loopback_state_t *lstate,
3071 3051      hermon_loopback_comm_t *tx, hermon_loopback_comm_t *rx)
3072 3052  {
3073 3053          int      ret;
3074 3054  
3075      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*tx))
3076      -
3077 3055          bzero(&tx->hlc_sgl, sizeof (ibt_wr_ds_t));
3078 3056          bzero(&tx->hlc_wr, sizeof (ibt_send_wr_t));
3079 3057  
3080 3058          /* Initialize local address for TX buffer */
3081 3059          tx->hlc_sgl.ds_va   = tx->hlc_mrdesc.md_vaddr;
3082 3060          tx->hlc_sgl.ds_key  = tx->hlc_mrdesc.md_lkey;
3083 3061          tx->hlc_sgl.ds_len  = tx->hlc_buf_sz;
3084 3062  
3085 3063          /* Initialize the remaining details of the work request */
3086 3064          tx->hlc_wr.wr_id = tx->hlc_wrid++;
↓ open down ↓ 15 lines elided ↑ open up ↑
3102 3080          return (0);
3103 3081  }
3104 3082  
3105 3083  /*
3106 3084   * hermon_loopback_poll_cq
3107 3085   */
3108 3086  static int
3109 3087  hermon_loopback_poll_cq(hermon_loopback_state_t *lstate,
3110 3088      hermon_loopback_comm_t *comm)
3111 3089  {
3112      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*comm))
3113      -
3114 3090          comm->hlc_wc.wc_status  = 0;
3115 3091          comm->hlc_num_polled    = 0;
3116 3092          comm->hlc_status = hermon_cq_poll(lstate->hls_state,
3117 3093              comm->hlc_cqhdl[0], &comm->hlc_wc, 1, &comm->hlc_num_polled);
3118 3094          if ((comm->hlc_status == IBT_SUCCESS) &&
3119 3095              (comm->hlc_wc.wc_status != IBT_WC_SUCCESS)) {
3120 3096                  comm->hlc_status = ibc_get_ci_failure(0);
3121 3097          }
3122 3098          return (comm->hlc_status);
3123 3099  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX