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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_path.c
          +++ new/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_path.c
↓ open down ↓ 40 lines elided ↑ open up ↑
  41   41          uint_t          d_tag;  /* 0 = Unicast, 1 = Multicast */
  42   42  } ibcm_dest_t;
  43   43  
  44   44  /* Holds Destination information needed to fill in ibt_path_info_t. */
  45   45  typedef struct ibcm_dinfo_s {
  46   46          uint8_t         num_dest;
  47   47          ib_pkey_t       p_key;
  48   48          ibcm_dest_t     dest[1];
  49   49  } ibcm_dinfo_t;
  50   50  
  51      -_NOTE(SCHEME_PROTECTS_DATA("Temporary path storage", ibcm_dinfo_s))
  52      -_NOTE(READ_ONLY_DATA(ibt_path_attr_s))
  53      -
  54   51  typedef struct ibcm_path_tqargs_s {
  55   52          ibt_path_attr_t         attr;
  56   53          ibt_path_info_t         *paths;
  57   54          uint8_t                 *num_paths_p;
  58   55          ibt_path_handler_t      func;
  59   56          void                    *arg;
  60   57          ibt_path_flags_t        flags;
  61   58          uint8_t                 max_paths;
  62   59  } ibcm_path_tqargs_t;
  63   60  
↓ open down ↓ 376 lines elided ↑ open up ↑
 440  437          len = (attrp->pa_num_dgids * sizeof (ib_gid_t)) +
 441  438              sizeof (ibcm_path_tqargs_t);
 442  439  
 443  440          path_tq = kmem_alloc(len, sleep_flag);
 444  441          if (path_tq == NULL) {
 445  442                  IBTF_DPRINTF_L2(cmlog, "ibcm_handle_get_path: "
 446  443                      "Unable to allocate memory for local usage.");
 447  444                  return (IBT_INSUFF_KERNEL_RESOURCE);
 448  445          }
 449  446  
 450      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*path_tq))
 451      -
 452  447          bcopy(attrp, &path_tq->attr, sizeof (ibt_path_attr_t));
 453  448  
 454  449          if (attrp->pa_num_dgids) {
 455  450                  path_tq->attr.pa_dgids = (ib_gid_t *)(((uchar_t *)path_tq) +
 456  451                      sizeof (ibcm_path_tqargs_t));
 457  452  
 458  453                  bcopy(attrp->pa_dgids, path_tq->attr.pa_dgids,
 459  454                      sizeof (ib_gid_t) * attrp->pa_num_dgids);
 460  455          } else {
 461  456                  path_tq->attr.pa_dgids = NULL;
↓ open down ↓ 8 lines elided ↑ open up ↑
 470  465                      "information is requested.");
 471  466          }
 472  467  
 473  468          path_tq->flags = flags;
 474  469          path_tq->max_paths = max_paths;
 475  470          path_tq->paths = paths;
 476  471          path_tq->num_paths_p = num_path_p;
 477  472          path_tq->func = func;
 478  473          path_tq->arg = arg;
 479  474  
 480      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*path_tq))
 481      -
 482  475          if (func != NULL) {             /* Non-Blocking */
 483  476                  IBTF_DPRINTF_L3(cmlog, "ibcm_handle_get_path: Non Blocking");
 484  477                  if (taskq_dispatch(ibcm_taskq, ibcm_process_async_get_paths,
 485  478                      path_tq, TQ_NOSLEEP) == 0) {
 486  479                          IBTF_DPRINTF_L2(cmlog, "ibcm_handle_get_path: "
 487  480                              "Failed to dispatch the TaskQ");
 488  481                          kmem_free(path_tq, len);
 489  482                          return (IBT_INSUFF_KERNEL_RESOURCE);
 490  483                  } else
 491  484                          return (IBT_SUCCESS);
↓ open down ↓ 238 lines elided ↑ open up ↑
 730  723          if (p_arg->flags & IBT_PATH_PKEY)
 731  724                  dinfo->p_key = p_arg->attr.pa_pkey;
 732  725  
 733  726          for (i = 0, j = 0; i < num_dest; i++) {
 734  727                  if (i < p_arg->attr.pa_num_dgids)
 735  728                          dinfo->dest[i].d_gid = p_arg->attr.pa_dgids[i];
 736  729                  else
 737  730                          dinfo->dest[i].d_gid = d_gids_p[j++];
 738  731          }
 739  732  
 740      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*p_arg))
 741      -
 742  733          /* IBTF allocates memory for path_info in case of Async Get Paths */
 743  734          if (p_arg->paths == NULL)
 744  735                  p_arg->paths = kmem_zalloc(sizeof (ibt_path_info_t) * max_paths,
 745  736                      KM_SLEEP);
 746  737  
 747      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*p_arg))
 748      -
 749  738          /*
 750  739           * Get list of active HCA<->Port list, that matches input specified attr
 751  740           */
 752  741          IBTF_DPRINTF_L3(cmlog, "ibcm_process_get_paths: Get Paths from \n HCA "
 753  742              "(%llX:%d), SGID  %llX:%llX", p_arg->attr.pa_hca_guid,
 754  743              p_arg->attr.pa_hca_port_num, p_arg->attr.pa_sgid.gid_prefix,
 755  744              p_arg->attr.pa_sgid.gid_guid);
 756  745  
 757  746          retval = ibtl_cm_get_active_plist(&p_arg->attr, p_arg->flags, &slistp);
 758  747          if (retval != IBT_SUCCESS) {
↓ open down ↓ 28 lines elided ↑ open up ↑
 787  776                  }
 788  777  
 789  778                  saa_handle = ibcm_get_saa_handle(hcap, slistp[i].p_port_num);
 790  779                  if (saa_handle == NULL) {
 791  780                          IBTF_DPRINTF_L2(cmlog, "ibcm_process_get_paths: "
 792  781                              "SAA HDL NULL, HCA (%llX:%d) NOT ACTIVE",
 793  782                              slistp[i].p_hca_guid, slistp[i].p_port_num);
 794  783                          retval = IBT_HCA_PORT_NOT_ACTIVE;
 795  784                          goto path_error1;
 796  785                  }
 797      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*slistp))
 798  786                  slistp[i].p_saa_hdl = saa_handle;
 799      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*slistp))
 800  787          }
 801  788  
 802  789          /*
 803  790           * If Service Name or Service ID are specified, first retrieve
 804  791           * Service Records.
 805  792           */
 806  793          if ((p_arg->attr.pa_sid != 0) || ((p_arg->attr.pa_sname != NULL) &&
 807  794              (strlen(p_arg->attr.pa_sname) != 0))) {
 808  795  
 809  796                  IBTF_DPRINTF_L3(cmlog, "ibcm_process_get_paths: Get Service "
↓ open down ↓ 620 lines elided ↑ open up ↑
1430 1417          /* SGID */
1431 1418          for (i = 0; i < sgid_cnt; i++) {
1432 1419                  *gid_ptr = sl[i].p_sgid;
1433 1420  
1434 1421                  IBTF_DPRINTF_L3(cmlog, "ibcm_get_multi_pathrec: SGID[%d] = "
1435 1422                      "(%llX:%llX)", i, gid_ptr->gid_prefix, gid_ptr->gid_guid);
1436 1423  
1437 1424                  gid_ptr++;
1438 1425          }
1439 1426  
1440      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mpr_req))
1441      -
1442 1427          mpr_req->SGIDCount = sgid_cnt;
1443 1428          c_mask = SA_MPR_COMPMASK_SGIDCOUNT;
1444 1429  
1445 1430          /* DGIDs */
1446 1431          for (i = 0; i < dinfo->num_dest; i++) {
1447 1432                  if (dinfo->dest[i].d_tag == 0) {
1448 1433                          *gid_ptr = dinfo->dest[i].d_gid;
1449 1434  
1450 1435                          IBTF_DPRINTF_L3(cmlog, "ibcm_get_multi_pathrec: "
1451 1436                              "DGID[%d] = (%llX:%llX)", i, gid_ptr->gid_prefix,
↓ open down ↓ 95 lines elided ↑ open up ↑
1547 1532          /* We always get REVERSIBLE paths. */
1548 1533          mpr_req->Reversible = 1;
1549 1534          c_mask |= SA_MPR_COMPMASK_REVERSIBLE;
1550 1535  
1551 1536          if (p_arg->flags & IBT_PATH_AVAIL) {
1552 1537                  mpr_req->IndependenceSelector = 1;
1553 1538                  c_mask |= SA_MPR_COMPMASK_INDEPSEL;
1554 1539          }
1555 1540  
1556 1541          /* we will not specify how many records we want. */
1557      -
1558      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mpr_req))
1559      -
1560 1542          IBTF_DPRINTF_L3(cmlog, "ibcm_get_multi_pathrec: CMask: %llX Pkey: %X",
1561 1543              c_mask, mpr_req->P_Key);
1562 1544  
1563 1545          /* Contact SA Access to retrieve Path Records. */
1564 1546          access_args.sq_attr_id = SA_MULTIPATHRECORD_ATTRID;
1565 1547          access_args.sq_access_type = IBMF_SAA_RETRIEVE;
1566 1548          access_args.sq_component_mask = c_mask;
1567 1549          access_args.sq_template = mpr_req;
1568 1550          access_args.sq_template_length = sizeof (sa_multipath_record_t);
1569 1551          access_args.sq_callback = NULL;
↓ open down ↓ 391 lines elided ↑ open up ↑
1961 1943              prec_resp->SGID.gid_prefix, prec_resp->SGID.gid_guid,
1962 1944              prec_resp->DGID.gid_prefix, prec_resp->DGID.gid_guid);
1963 1945  
1964 1946          return (IBT_SUCCESS);
1965 1947  }
1966 1948  
1967 1949  
1968 1950  static void
1969 1951  ibcm_fill_svcinfo(sa_service_record_t *sr_resp, ibcm_dest_t *dest)
1970 1952  {
1971      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*dest))
1972      -
1973 1953          dest->d_gid = sr_resp->ServiceGID;
1974 1954          dest->d_sid = sr_resp->ServiceID;
1975 1955          ibcm_swizzle_to_srv(sr_resp->ServiceData, &dest->d_sdata);
1976 1956          dest->d_pkey = sr_resp->ServiceP_Key;
1977 1957  
1978      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*dest))
1979      -
1980 1958          IBTF_DPRINTF_L3(cmlog, "ibcm_fill_svcinfo: SID(%llX), GID(%llX:%llX)"
1981 1959              "\n\tSvcPKey 0x%X", dest->d_sid, dest->d_gid.gid_prefix,
1982 1960              dest->d_gid.gid_guid, dest->d_pkey);
1983 1961  }
1984 1962  
1985 1963  
1986 1964  static ib_gid_t
1987 1965  ibcm_saa_get_agid(ibtl_cm_port_list_t *sl, ib_gid_t *gidp, uint_t ngid)
1988 1966  {
1989 1967          int             k, l;
↓ open down ↓ 773 lines elided ↑ open up ↑
2763 2741                  }
2764 2742          }
2765 2743  
2766 2744          /* Calculate the size for multi-path records template */
2767 2745          template_len = (2 * sizeof (ib_gid_t)) + sizeof (sa_multipath_record_t);
2768 2746  
2769 2747          mpr_req = kmem_zalloc(template_len, KM_SLEEP);
2770 2748  
2771 2749          ASSERT(mpr_req != NULL);
2772 2750  
2773      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mpr_req))
2774      -
2775 2751          gid_ptr = (ib_gid_t *)(((uchar_t *)mpr_req) +
2776 2752              sizeof (sa_multipath_record_t));
2777 2753  
2778 2754          /* SGID */
2779 2755          if (new_sgid.gid_guid == 0)
2780 2756                  *gid_ptr = cur_sgid;
2781 2757          else
2782 2758                  *gid_ptr = new_sgid;
2783 2759  
2784 2760          IBTF_DPRINTF_L3(cmlog, "ibt_get_alt_path: Get Path Between "
↓ open down ↓ 94 lines elided ↑ open up ↑
2879 2855                  IBTF_DPRINTF_L2(cmlog, "ibt_get_alt_path: Idx2Pkey Failed: %d",
2880 2856                      retval);
2881 2857                  goto get_alt_path_done;
2882 2858          }
2883 2859          c_mask |= SA_MPR_COMPMASK_PKEY;
2884 2860  
2885 2861          mpr_req->Reversible = 1;        /* We always get REVERSIBLE paths. */
2886 2862          mpr_req->IndependenceSelector = 1;
2887 2863          c_mask |= SA_MPR_COMPMASK_REVERSIBLE | SA_MPR_COMPMASK_INDEPSEL;
2888 2864  
2889      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mpr_req))
2890      -
2891 2865          IBTF_DPRINTF_L3(cmlog, "ibt_get_alt_path: CMask: 0x%llX", c_mask);
2892 2866  
2893 2867          /* NOTE: We will **NOT** specify how many records we want. */
2894 2868  
2895 2869          IBTF_DPRINTF_L3(cmlog, "ibt_get_alt_path: Primary: MTU %d, PKey[%d]="
2896 2870              "0x%X\n\tSGID = %llX:%llX, DGID = %llX:%llX", prim_mtu,
2897 2871              qp_attr.qp_info.qp_transport.rc.rc_path.cep_pkey_ix, mpr_req->P_Key,
2898 2872              cur_sgid.gid_prefix, cur_sgid.gid_guid, cur_dgid.gid_prefix,
2899 2873              cur_dgid.gid_guid);
2900 2874  
↓ open down ↓ 59 lines elided ↑ open up ↑
2960 2934                                  retval = ibcm_update_cep_info(pr_resp, NULL,
2961 2935                                      &c_hp, &api_p->ap_alt_cep_path);
2962 2936                          } else {
2963 2937                                  retval = ibcm_update_cep_info(pr_resp, NULL,
2964 2938                                      &n_hp, &api_p->ap_alt_cep_path);
2965 2939                          }
2966 2940                          if (retval != IBT_SUCCESS)
2967 2941                                  continue;
2968 2942  
2969 2943                          /* Update some leftovers */
2970      -                        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*api_p))
2971      -
2972 2944                          api_p->ap_alt_pkt_lt = pr_resp->PacketLifeTime;
2973 2945  
2974      -                        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*api_p))
2975      -
2976 2946                          rec_found = 1;
2977 2947                          break;
2978 2948                  }
2979 2949                  kmem_free(results_p, length);
2980 2950          }
2981 2951  
2982 2952          if (rec_found == 0) {
2983 2953                  IBTF_DPRINTF_L3(cmlog, "ibt_get_alt_path: Alternate Path cannot"
2984 2954                      " be established");
2985 2955                  retval = IBT_PATH_RECORDS_NOT_FOUND;
↓ open down ↓ 35 lines elided ↑ open up ↑
3021 2991          ibt_status_t            retval;
3022 2992          uint_t                  len;
3023 2993  } ibcm_ip_path_tqargs_t;
3024 2994  
3025 2995  /* Holds destination information needed to fill in ibt_path_info_t. */
3026 2996  typedef struct ibcm_ip_dinfo_s {
3027 2997          uint8_t         num_dest;
3028 2998          ib_gid_t        d_gid[1];
3029 2999  } ibcm_ip_dinfo_t;
3030 3000  
3031      -_NOTE(SCHEME_PROTECTS_DATA("Temporary path storage", ibcm_ip_dinfo_s))
3032      -
3033 3001  /* Prototype Declarations. */
3034 3002  static void ibcm_process_get_ip_paths(void *tq_arg);
3035 3003  static ibt_status_t ibcm_get_ip_spr(ibcm_ip_path_tqargs_t *,
3036 3004      ibtl_cm_port_list_t *, ibcm_ip_dinfo_t *, uint8_t *, ibt_path_info_t *);
3037 3005  static ibt_status_t ibcm_get_ip_mpr(ibcm_ip_path_tqargs_t *,
3038 3006      ibtl_cm_port_list_t *, ibcm_ip_dinfo_t *dinfo,
3039 3007      uint8_t *, ibt_path_info_t *);
3040 3008  
3041 3009  /*
3042 3010   * Perform SA Access to retrieve Path Records.
↓ open down ↓ 384 lines elided ↑ open up ↑
3427 3395          /* SGID */
3428 3396          for (i = 0; i < sgid_cnt; i++) {
3429 3397                  *gid_ptr = sl[i].p_sgid;
3430 3398  
3431 3399                  IBTF_DPRINTF_L3(cmlog, "ibcm_get_ip_mpr: SGID[%d] = %llX:%llX",
3432 3400                      i, gid_ptr->gid_prefix, gid_ptr->gid_guid);
3433 3401  
3434 3402                  gid_ptr++;
3435 3403          }
3436 3404  
3437      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mpr_req))
3438      -
3439 3405          mpr_req->SGIDCount = sgid_cnt;
3440 3406          c_mask = SA_MPR_COMPMASK_SGIDCOUNT;
3441 3407  
3442 3408          /* DGIDs */
3443 3409          for (i = 0; i < dgid_cnt; i++) {
3444 3410                  *gid_ptr = dinfo->d_gid[i];
3445 3411  
3446 3412                  IBTF_DPRINTF_L3(cmlog, "ibcm_get_ip_mpr: DGID[%d] = "
3447 3413                      "%llX:%llX", i, gid_ptr->gid_prefix, gid_ptr->gid_guid);
3448 3414                  gid_ptr++;
↓ open down ↓ 87 lines elided ↑ open up ↑
3536 3502          mpr_req->Reversible = 1;
3537 3503          c_mask |= SA_MPR_COMPMASK_REVERSIBLE;
3538 3504  
3539 3505          if (p_arg->flags & IBT_PATH_AVAIL) {
3540 3506                  mpr_req->IndependenceSelector = 1;
3541 3507                  c_mask |= SA_MPR_COMPMASK_INDEPSEL;
3542 3508          }
3543 3509  
3544 3510          /* we will not specify how many records we want. */
3545 3511  
3546      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mpr_req))
3547      -
3548 3512          IBTF_DPRINTF_L3(cmlog, "ibcm_get_ip_mpr: CMask: %llX Pkey: %X",
3549 3513              c_mask, mpr_req->P_Key);
3550 3514  
3551 3515          /* Contact SA Access to retrieve Path Records. */
3552 3516          access_args.sq_attr_id = SA_MULTIPATHRECORD_ATTRID;
3553 3517          access_args.sq_access_type = IBMF_SAA_RETRIEVE;
3554 3518          access_args.sq_component_mask = c_mask;
3555 3519          access_args.sq_template = mpr_req;
3556 3520          access_args.sq_template_length = sizeof (sa_multipath_record_t);
3557 3521          access_args.sq_callback = NULL;
↓ open down ↓ 284 lines elided ↑ open up ↑
3842 3806                          if (dnum) {
3843 3807                                  dinfo->d_gid[i] = d_gids_p[0];
3844 3808                                  i++;
3845 3809                          }
3846 3810                  }
3847 3811          }
3848 3812  
3849 3813          /* "i" will get us num_dest count. */
3850 3814          dinfo->num_dest = i;
3851 3815  
3852      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*p_arg))
3853      -
3854 3816          /*
3855 3817           * IBTF allocates memory for path_info & src_ip in case of
3856 3818           * Async Get IP Paths
3857 3819           */
3858 3820          if (p_arg->func) {   /* Do these only for Async Get Paths */
3859 3821                  p_arg->paths = kmem_zalloc(sizeof (ibt_path_info_t) * max_paths,
3860 3822                      KM_SLEEP);
3861 3823                  if (p_arg->src_ip_p == NULL)
3862 3824                          p_arg->src_ip_p = kmem_zalloc(
3863 3825                              sizeof (ibt_path_ip_src_t) * max_paths, KM_SLEEP);
3864 3826          }
3865 3827  
3866      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*p_arg))
3867      -
3868 3828          IBTF_DPRINTF_L3(cmlog, "ibcm_process_get_ip_paths: HCA (%llX, %d)",
3869 3829              sl->p_hca_guid, sl->p_port_num);
3870 3830  
3871 3831          hcap = ibcm_find_hca_entry(sl->p_hca_guid);
3872 3832          if (hcap == NULL) {
3873 3833                  IBTF_DPRINTF_L2(cmlog, "ibcm_process_get_ip_paths: "
3874 3834                      "NO HCA found");
3875 3835                  retval = IBT_HCA_BUSY_DETACHING;
3876 3836                  goto ippath_error2;
3877 3837          }
↓ open down ↓ 13 lines elided ↑ open up ↑
3891 3851                  }
3892 3852  
3893 3853                  saa_handle = ibcm_get_saa_handle(hcap, sl[i].p_port_num);
3894 3854                  if (saa_handle == NULL) {
3895 3855                          IBTF_DPRINTF_L2(cmlog, "ibcm_process_get_ip_paths: "
3896 3856                              "SAA HDL NULL, HCA (%llX:%d) NOT ACTIVE",
3897 3857                              sl[i].p_hca_guid, sl[i].p_port_num);
3898 3858                          retval = IBT_HCA_PORT_NOT_ACTIVE;
3899 3859                          goto ippath_error3;
3900 3860                  }
3901      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sl))
3902 3861                  sl[i].p_saa_hdl = saa_handle;
3903      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sl))
3904 3862          }
3905 3863  
3906 3864          /* Get Path Records. */
3907 3865          retval = ibcm_saa_ip_pr(p_arg, sl, dinfo, &num_path);
3908 3866  
3909 3867  ippath_error3:
3910 3868          ibcm_dec_hca_acc_cnt(hcap);
3911 3869  
3912 3870  ippath_error2:
3913 3871          if (dinfo && len)
↓ open down ↓ 7 lines elided ↑ open up ↑
3921 3879          if ((retval != IBT_SUCCESS) && (retval != IBT_INSUFF_DATA))
3922 3880                  num_path = 0;
3923 3881  
3924 3882          if (p_arg->num_paths_p != NULL)
3925 3883                  *p_arg->num_paths_p = num_path;
3926 3884  
3927 3885          if (p_arg->func) {   /* Do these only for Async Get Paths */
3928 3886                  ibt_path_info_t *tmp_path_p;
3929 3887                  ibt_path_ip_src_t       *tmp_src_ip_p;
3930 3888  
3931      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*p_arg))
3932 3889                  p_arg->retval = retval;
3933      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*p_arg))
3934 3890  
3935 3891                  if (retval == IBT_INSUFF_DATA) {
3936 3892                          /*
3937 3893                           * We allocated earlier memory based on "max_paths",
3938 3894                           * but we got lesser path-records, so re-adjust that
3939 3895                           * buffer so that caller can free the correct memory.
3940 3896                           */
3941 3897                          tmp_path_p = kmem_alloc(
3942 3898                              sizeof (ibt_path_info_t) * num_path, KM_SLEEP);
3943 3899  
↓ open down ↓ 183 lines elided ↑ open up ↑
4127 4083  
4128 4084          len = (attrp->ipa_ndst * sizeof (ibt_ip_addr_t)) +
4129 4085              sizeof (ibcm_ip_path_tqargs_t);
4130 4086          path_tq = kmem_zalloc(len, sleep_flag);
4131 4087          if (path_tq == NULL) {
4132 4088                  IBTF_DPRINTF_L2(cmlog, "ibcm_get_ip_path: "
4133 4089                      "Unable to allocate memory for local usage.");
4134 4090                  return (IBT_INSUFF_KERNEL_RESOURCE);
4135 4091          }
4136 4092  
4137      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*path_tq))
4138 4093          bcopy(attrp, &path_tq->attr, sizeof (ibt_ip_path_attr_t));
4139 4094  
4140 4095          path_tq->attr.ipa_dst_ip = (ibt_ip_addr_t *)(((uchar_t *)path_tq) +
4141 4096              sizeof (ibcm_ip_path_tqargs_t));
4142 4097          bcopy(attrp->ipa_dst_ip, path_tq->attr.ipa_dst_ip,
4143 4098              sizeof (ibt_ip_addr_t) * attrp->ipa_ndst);
4144 4099  
4145 4100          /* Ignore IBT_PATH_AVAIL flag, if only one path is requested. */
4146 4101          if ((flags & IBT_PATH_AVAIL) && (attrp->ipa_max_paths == 1)) {
4147 4102                  flags &= ~IBT_PATH_AVAIL;
↓ open down ↓ 9 lines elided ↑ open up ↑
4157 4112          path_tq->num_paths_p = num_path_p;
4158 4113          path_tq->func = func;
4159 4114          path_tq->arg = arg;
4160 4115          path_tq->len = len;
4161 4116          path_tq->ip_done = B_FALSE;
4162 4117          if (func == NULL) {     /* Blocking */
4163 4118                  mutex_init(&path_tq->ip_lock, NULL, MUTEX_DEFAULT, NULL);
4164 4119                  cv_init(&path_tq->ip_cv, NULL, CV_DRIVER, NULL);
4165 4120          }
4166 4121  
4167      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*path_tq))
4168      -
4169 4122          sleep_flag = ((func == NULL) ? TQ_SLEEP : TQ_NOSLEEP);
4170 4123          ret = taskq_dispatch(ibcm_taskq, ibcm_process_get_ip_paths, path_tq,
4171 4124              sleep_flag);
4172 4125          if (ret == 0) {
4173 4126                  IBTF_DPRINTF_L2(cmlog, "ibcm_get_ip_path: Failed to dispatch "
4174 4127                      "the TaskQ");
4175 4128                  if (func == NULL) {             /* Blocking */
4176 4129                          cv_destroy(&path_tq->ip_cv);
4177 4130                          mutex_destroy(&path_tq->ip_lock);
4178 4131                  }
↓ open down ↓ 261 lines elided ↑ open up ↑
4440 4393                  }
4441 4394          }
4442 4395  
4443 4396          /* Calculate the size for multi-path records template */
4444 4397          template_len = (2 * sizeof (ib_gid_t)) + sizeof (sa_multipath_record_t);
4445 4398  
4446 4399          mpr_req = kmem_zalloc(template_len, KM_SLEEP);
4447 4400  
4448 4401          ASSERT(mpr_req != NULL);
4449 4402  
4450      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mpr_req))
4451      -
4452 4403          gid_ptr = (ib_gid_t *)(((uchar_t *)mpr_req) +
4453 4404              sizeof (sa_multipath_record_t));
4454 4405  
4455 4406          /* SGID */
4456 4407          if (new_sgid.gid_guid == 0)
4457 4408                  *gid_ptr = cur_sgid;
4458 4409          else
4459 4410                  *gid_ptr = new_sgid;
4460 4411  
4461 4412          IBTF_DPRINTF_L3(cmlog, "ibt_get_ip_alt_path: Get Path Between "
↓ open down ↓ 94 lines elided ↑ open up ↑
4556 4507                  IBTF_DPRINTF_L2(cmlog, "ibt_get_ip_alt_path: PKeyIdx2Pkey "
4557 4508                      "Failed: %d", retval);
4558 4509                  goto get_ip_alt_path_done;
4559 4510          }
4560 4511          c_mask |= SA_MPR_COMPMASK_PKEY;
4561 4512  
4562 4513          mpr_req->Reversible = 1;        /* We always get REVERSIBLE paths. */
4563 4514          mpr_req->IndependenceSelector = 1;
4564 4515          c_mask |= SA_MPR_COMPMASK_REVERSIBLE | SA_MPR_COMPMASK_INDEPSEL;
4565 4516  
4566      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mpr_req))
4567      -
4568 4517          IBTF_DPRINTF_L3(cmlog, "ibt_get_ip_alt_path: CMask: 0x%llX", c_mask);
4569 4518  
4570 4519          /* NOTE: We will **NOT** specify how many records we want. */
4571 4520  
4572 4521          IBTF_DPRINTF_L3(cmlog, "ibt_get_ip_alt_path: Primary: MTU %d, PKey[%d]="
4573 4522              "0x%X\n\tSGID = %llX:%llX, DGID = %llX:%llX", prim_mtu,
4574 4523              qp_attr.qp_info.qp_transport.rc.rc_path.cep_pkey_ix, mpr_req->P_Key,
4575 4524              cur_sgid.gid_prefix, cur_sgid.gid_guid, cur_dgid.gid_prefix,
4576 4525              cur_dgid.gid_guid);
4577 4526  
↓ open down ↓ 59 lines elided ↑ open up ↑
4637 4586                                  retval = ibcm_update_cep_info(pr_resp, NULL,
4638 4587                                      &c_hp, &api_p->ap_alt_cep_path);
4639 4588                          } else {
4640 4589                                  retval = ibcm_update_cep_info(pr_resp, NULL,
4641 4590                                      &n_hp, &api_p->ap_alt_cep_path);
4642 4591                          }
4643 4592                          if (retval != IBT_SUCCESS)
4644 4593                                  continue;
4645 4594  
4646 4595                          /* Update some leftovers */
4647      -                        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*api_p))
4648      -
4649 4596                          api_p->ap_alt_pkt_lt = pr_resp->PacketLifeTime;
4650 4597  
4651      -                        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*api_p))
4652      -
4653 4598                          rec_found = 1;
4654 4599                          break;
4655 4600                  }
4656 4601                  kmem_free(results_p, length);
4657 4602          }
4658 4603  
4659 4604          if (rec_found == 0) {
4660 4605                  IBTF_DPRINTF_L3(cmlog, "ibt_get_ip_alt_path: AltPath cannot"
4661 4606                      " be established");
4662 4607                  retval = IBT_PATH_RECORDS_NOT_FOUND;
↓ open down ↓ 5 lines elided ↑ open up ↑
4668 4613                  kmem_free(sgids_p, snum * sizeof (ib_gid_t));
4669 4614  
4670 4615          if ((dnum) && (dgids_p))
4671 4616                  kmem_free(dgids_p, dnum * sizeof (ib_gid_t));
4672 4617  
4673 4618          ibcm_dec_hca_acc_cnt(hcap);
4674 4619  
4675 4620          IBTF_DPRINTF_L3(cmlog, "ibt_get_ip_alt_path: Done (status %d)", retval);
4676 4621  
4677 4622          return (retval);
4678      -}
4679      -
4680      -
4681      -/* Routines for warlock */
4682      -
4683      -/* ARGSUSED */
4684      -static void
4685      -ibcm_dummy_path_handler(void *arg, ibt_status_t retval, ibt_path_info_t *paths,
4686      -    uint8_t num_path)
4687      -{
4688      -        ibcm_path_tqargs_t      dummy_path;
4689      -
4690      -        dummy_path.func = ibcm_dummy_path_handler;
4691      -
4692      -        IBTF_DPRINTF_L5(cmlog, "ibcm_dummy_path_handler: "
4693      -            "dummy_path.func %p", dummy_path.func);
4694      -}
4695      -
4696      -/* ARGSUSED */
4697      -static void
4698      -ibcm_dummy_ip_path_handler(void *arg, ibt_status_t retval,
4699      -    ibt_path_info_t *paths, uint8_t num_path, ibt_path_ip_src_t *src_ip)
4700      -{
4701      -        ibcm_ip_path_tqargs_t   dummy_path;
4702      -
4703      -        dummy_path.func = ibcm_dummy_ip_path_handler;
4704      -
4705      -        IBTF_DPRINTF_L5(cmlog, "ibcm_dummy_ip_path_handler: "
4706      -            "dummy_path.func %p", dummy_path.func);
4707 4623  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX