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_ti.c
          +++ new/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_ti.c
↓ open down ↓ 32 lines elided ↑ open up ↑
  33   33  
  34   34  /* CM rc recycle task args structure definition */
  35   35  typedef struct ibcm_taskq_recycle_arg_s {
  36   36          ibt_channel_hdl_t       rc_chan;
  37   37          ibt_cep_flags_t         control;
  38   38          uint8_t                 hca_port_num;
  39   39          ibt_recycle_handler_t   func;
  40   40          void                    *arg;
  41   41  } ibcm_taskq_recycle_arg_t;
  42   42  
  43      -_NOTE(READ_ONLY_DATA(ibcm_taskq_recycle_arg_s))
  44      -
  45   43  static ibt_status_t     ibcm_init_reply_addr(ibcm_hca_info_t *hcap,
  46   44      ibcm_mad_addr_t *reply_addr, ibt_chan_open_args_t *chan_args,
  47   45      ibt_chan_open_flags_t flags, ib_time_t *cm_pkt_lt, ib_lid_t prim_slid);
  48   46  static void             ibcm_process_abort_via_taskq(void *args);
  49   47  static ibt_status_t     ibcm_process_rc_recycle_ret(void *recycle_arg);
  50   48  static ibt_status_t     ibcm_process_join_mcg(void *taskq_arg);
  51   49  static void             ibcm_process_async_join_mcg(void *tq_arg);
  52   50  
  53   51  ibt_status_t ibcm_get_node_rec(ibmf_saa_handle_t, sa_node_record_t *,
  54   52      uint64_t c_mask, void *, size_t *);
↓ open down ↓ 16 lines elided ↑ open up ↑
  71   69   *              is greater than IB_MTU_1K.
  72   70   *      0       Do not override, use pi_path_mtu by default.
  73   71   */
  74   72  int     ibcm_override_path_mtu = 1;
  75   73  
  76   74  #ifdef DEBUG
  77   75  static void     ibcm_print_reply_addr(ibt_channel_hdl_t channel,
  78   76                      ibcm_mad_addr_t *cm_reply_addr);
  79   77  #endif
  80   78  
  81      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibcm_port_info_s::{port_ibmf_hdl}))
  82      -
  83      -/* access is controlled between ibcm_sm.c and ibcm_ti.c by CVs */
  84      -_NOTE(SCHEME_PROTECTS_DATA("Serialized access by CV", {ibt_rc_returns_t
  85      -    ibt_ud_returns_t ibt_ap_returns_t ibt_ar_t}))
  86      -
  87   79  /*
  88      - * Typically, clients initialize these args in one api call, and use in
  89      - * another api
  90      - */
  91      -_NOTE(SCHEME_PROTECTS_DATA("Expected usage of ibtl api by client",
  92      -    {ibt_path_info_s ibt_cep_path_s ibt_adds_vect_s ibt_mcg_info_s ib_gid_s
  93      -    ibt_ud_dest_attr_s ibt_ud_dest_s ibt_srv_data_s ibt_redirect_info_s}))
  94      -
  95      -/*
  96   80   * ibt_open_rc_channel()
  97   81   *      ibt_open_rc_channel opens a communication channel on the specified
  98   82   *      channel to the specified service. For connection service type qp's
  99   83   *      the CM initiates the CEP to establish the connection and transitions
 100   84   *      the QP/EEC to the "Ready to send" State modifying the QP/EEC's
 101   85   *      attributes as necessary.
 102   86   *      The implementation of this function assumes that alt path is different
 103   87   *      from primary path. It is assumed that the Path functions ensure that.
 104   88   *
 105   89   * RETURN VALUES:
↓ open down ↓ 463 lines elided ↑ open up ↑
 569  553  
 570  554          /* CM should be seeing this for the first time */
 571  555          ASSERT(lkup_status == IBCM_LOOKUP_NEW);
 572  556  
 573  557          /* Increment the hca's resource count */
 574  558          ibcm_inc_hca_res_cnt(hcap);
 575  559  
 576  560          /* Once a resource created on hca, no need to hold the acc cnt */
 577  561          ibcm_dec_hca_acc_cnt(hcap);
 578  562  
 579      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
 580      -
 581  563          statep->timerid = 0;
 582  564          statep->local_hca_guid = hca_guid;
 583  565          statep->local_qpn = local_qpn;
 584  566          statep->stored_reply_addr.cm_qp_entry = cm_qp_entry;
 585  567          statep->prim_port = IBCM_PRIM_CEP_PATH(chan_args).cep_hca_port_num;
 586  568          statep->alt_port = IBCM_ALT_CEP_PATH(chan_args).cep_hca_port_num;
 587  569  
 588  570  
 589  571          /* Save "statep" as channel's CM private data.  */
 590  572          statep->channel = channel;
 591  573          IBCM_SET_CHAN_PRIVATE(statep->channel, statep);
 592  574  
 593  575          statep->stored_msg = ibmf_msg;
 594  576          statep->dreq_msg = ibmf_msg_dreq;
 595  577  
 596      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*req_msgp))
 597      -
 598  578          /* Start filling in the REQ MAD */
 599  579          req_msgp = (ibcm_req_msg_t *)IBCM_OUT_MSGP(statep->stored_msg);
 600  580          req_msgp->req_local_comm_id = h2b32(local_comid);
 601  581          req_msgp->req_svc_id = h2b64(chan_args->oc_path->pi_sid);
 602  582          req_msgp->req_local_ca_guid = h2b64(hca_guid);
 603  583          req_msgp->req_local_qkey = h2b32(local_qkey);   /* for EEC/RD */
 604  584  
 605  585          /* Bytes 32-35 are req_local_qpn and req_off_resp_resources */
 606  586          req_msgp->req_local_qpn_plus = h2b32(local_qpn << 8 | rdma_in);
 607  587  
↓ open down ↓ 195 lines elided ↑ open up ↑
 803  783                  IBTF_DPRINTF_L5(cmlog, "ibt_open_rc_channel: chan 0x%p "
 804  784                      "alt GID %llX:%llX", channel,
 805  785                      IBCM_ALT_ADDS_VECT(chan_args).av_dgid.gid_prefix,
 806  786                      IBCM_ALT_ADDS_VECT(chan_args).av_dgid.gid_guid);
 807  787          }
 808  788  
 809  789          len = min(chan_args->oc_priv_data_len, IBT_REQ_PRIV_DATA_SZ);
 810  790          if ((len > 0) && chan_args->oc_priv_data)
 811  791                  bcopy(chan_args->oc_priv_data, req_msgp->req_private_data, len);
 812  792  
 813      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*req_msgp))
 814      -
 815  793          /* return_data is filled up in the state machine code */
 816  794          if (ret_args != NULL) {
 817  795                  statep->open_return_data = ret_args;
 818  796          }
 819  797  
 820  798          /* initialize some statep fields here */
 821  799          statep->mode = IBCM_ACTIVE_MODE;
 822  800          statep->hcap = hcap;
 823  801  
 824  802          statep->cm_handler = chan_args->oc_cm_handler;
↓ open down ↓ 39 lines elided ↑ open up ↑
 864  842          if (flags & IBT_OCHAN_OFUV)
 865  843                  statep->is_this_ofuv_chan = B_TRUE;
 866  844  
 867  845          IBCM_OUT_HDRP(statep->stored_msg)->AttributeID =
 868  846              h2b16(IBCM_INCOMING_REQ + IBCM_ATTR_BASE_ID);
 869  847  
 870  848          IBCM_OUT_HDRP(statep->stored_msg)->TransactionID =
 871  849              h2b64(ibcm_generate_tranid(IBCM_INCOMING_REQ, statep->local_comid,
 872  850              0));
 873  851  
 874      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*statep))
 875      -
 876  852          ibtl_cm_chan_is_opening(channel);
 877  853  
 878  854          ibcm_open_enqueue(statep);
 879  855  
 880  856          mutex_enter(&statep->state_mutex);
 881  857  
 882  858          if (mode == IBT_BLOCKING) {
 883  859  
 884  860                  /* wait for REQ/REP/RTU */
 885  861                  while (statep->open_done != B_TRUE) {
↓ open down ↓ 47 lines elided ↑ open up ↑
 933  909      ibt_chan_open_args_t *chan_args, ibt_chan_open_flags_t flags,
 934  910      ib_time_t *cm_pkt_lt, ib_lid_t prim_slid)
 935  911  {
 936  912          ibt_adds_vect_t *cm_adds;
 937  913          ibt_path_info_t path;
 938  914          boolean_t       cm_grh;
 939  915          ibt_status_t    status;
 940  916  
 941  917          IBTF_DPRINTF_L5(cmlog, "ibcm_init_reply_addr:");
 942  918  
 943      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*reply_addr))
 944      -
 945  919          /*
 946  920           * sending side CM lid/gid/port num are not based on any redirect
 947  921           * params. These values are set to primary RC path lid/gid/port num.
 948  922           * In the future, these values can be set based on framework policy
 949  923           * decisions ensuring reachability.
 950  924           */
 951  925          reply_addr->grh_hdr.ig_sender_gid =
 952  926              IBCM_PRIM_ADDS_VECT(chan_args).av_sgid;
 953  927          reply_addr->rcvd_addr.ia_local_lid = prim_slid;
 954  928          reply_addr->port_num = IBCM_PRIM_CEP_PATH(chan_args).cep_hca_port_num;
↓ open down ↓ 144 lines elided ↑ open up ↑
1099 1073              cm_adds->av_dgid;
1100 1074          reply_addr->grh_hdr.ig_flow_label =
1101 1075              cm_adds->av_flow & IB_GRH_FLOW_LABEL_MASK;
1102 1076          reply_addr->grh_hdr.ig_tclass =
1103 1077              (cm_grh == B_TRUE) ? cm_adds->av_tclass : 0;
1104 1078          reply_addr->grh_hdr.ig_hop_limit =
1105 1079              (cm_grh == B_TRUE) ? cm_adds->av_hop : 1;
1106 1080          reply_addr->rcvd_addr.ia_service_level =
1107 1081              cm_adds->av_srvl;
1108 1082  
1109      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*reply_addr))
1110      -
1111 1083          return (IBT_SUCCESS);
1112 1084  }
1113 1085  
1114 1086  
1115 1087  /*
1116 1088   * ibt_prime_close_rc_channel()
1117 1089   *      It allocates resources required for close channel operation, so
1118 1090   *      ibt_close_rc_channel can be called from interrupt routine.
1119 1091   *
1120 1092   * INPUTS:
↓ open down ↓ 206 lines elided ↑ open up ↑
1327 1299          (void) ibcm_close_rc_channel(statep->channel, statep, IBT_NONBLOCKING);
1328 1300  }
1329 1301  
1330 1302  static
1331 1303  ibt_status_t
1332 1304  ibcm_close_rc_channel(ibt_channel_hdl_t channel, ibcm_state_data_t *statep,
1333 1305      ibt_execution_mode_t mode)
1334 1306  {
1335 1307          ibcm_hca_info_t         *hcap;
1336 1308  
1337      -        _NOTE(LOCK_RELEASED_AS_SIDE_EFFECT(&statep->state_mutex));
1338 1309          ASSERT(MUTEX_HELD(&statep->state_mutex));
1339 1310  
1340 1311          IBTF_DPRINTF_L3(cmlog, "ibcm_close_rc_channel: chan 0x%p statep %p",
1341 1312              channel, statep);
1342 1313  
1343 1314          hcap = statep->hcap;
1344 1315  
1345 1316          /* HCA must have been in active state. If not, it's a client bug */
1346 1317          if (!IBCM_ACCESS_HCA_OK(hcap)) {
1347 1318                  IBTF_DPRINTF_L2(cmlog, "ibcm_close_rc_channel: chan 0x%p "
↓ open down ↓ 298 lines elided ↑ open up ↑
1646 1617  
1647 1618          if (retval != IBT_SUCCESS)
1648 1619                  return (retval);
1649 1620  
1650 1621          if (qp_attr.qp_info.qp_trans != IBT_RC_SRV)
1651 1622                  return (IBT_CHAN_SRV_TYPE_INVALID);
1652 1623  
1653 1624          if (qp_attr.qp_info.qp_state != IBT_STATE_ERROR)
1654 1625                  return (IBT_CHAN_STATE_INVALID);
1655 1626  
1656      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ibcm_tq_recycle_arg))
1657      -
1658 1627          ibcm_tq_recycle_arg = kmem_alloc(sizeof (ibcm_taskq_recycle_arg_t),
1659 1628              KM_SLEEP);
1660 1629  
1661 1630          ibcm_tq_recycle_arg->rc_chan            = rc_chan;
1662 1631          ibcm_tq_recycle_arg->control            = control;
1663 1632          ibcm_tq_recycle_arg->hca_port_num       = hca_port_num;
1664 1633          ibcm_tq_recycle_arg->func               = func;
1665 1634          ibcm_tq_recycle_arg->arg                = arg;
1666 1635  
1667      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*ibcm_tq_recycle_arg))
1668      -
1669 1636          IBCM_GET_CHAN_PRIVATE(rc_chan, statep);
1670 1637  
1671 1638          /*
1672 1639           * If non-blocking ie., func specified and channel has not yet completed
1673 1640           * the timewait, then schedule the work for later
1674 1641           */
1675 1642          if ((func != NULL) && (statep != NULL)) {
1676 1643                  IBCM_RELEASE_CHAN_PRIVATE(rc_chan);
1677      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(statep->recycle_arg))
1678 1644                  statep->recycle_arg = ibcm_tq_recycle_arg;
1679      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(statep->recycle_arg))
1680 1645                  return (IBT_SUCCESS);
1681 1646          }
1682 1647  
1683 1648          /*
1684 1649           * if blocking ie., func specified, and channel has not yet completed
1685 1650           * the timewait, then block until the channel completes the timewait
1686 1651           */
1687 1652          if (statep != NULL)
1688 1653                  IBCM_RELEASE_CHAN_PRIVATE(rc_chan);
1689 1654          IBCM_WAIT_CHAN_PRIVATE(rc_chan);
↓ open down ↓ 105 lines elided ↑ open up ↑
1795 1760  /*
1796 1761   * Local UD CM Handler's private data, used during ibt_request_ud_dest() in
1797 1762   * Non-Blocking mode operations.
1798 1763   */
1799 1764  typedef struct ibcm_local_handler_s {
1800 1765          ibt_cm_ud_handler_t     actual_cm_handler;
1801 1766          void                    *actual_cm_private;
1802 1767          ibt_ud_dest_t           *dest_hdl;
1803 1768  } ibcm_local_handler_t;
1804 1769  
1805      -_NOTE(READ_ONLY_DATA(ibcm_local_handler_s))
1806      -
1807 1770  /*
1808 1771   * Local UD CM Handler, used when ibt_alloc_ud_dest() is issued in
1809 1772   * NON-Blocking mode.
1810 1773   *
1811 1774   * Out here, we update the UD Destination handle with
1812 1775   * the obtained DQPN and QKey (from SIDR REP) and invokes actual client
1813 1776   * handler that was specified by the client.
1814 1777   */
1815 1778  static ibt_cm_status_t
1816 1779  ibcm_local_cm_handler(void *priv, ibt_cm_ud_event_t *event,
↓ open down ↓ 149 lines elided ↑ open up ↑
1966 1929  
1967 1930          retval = ibt_index2pkey_byguid(port.hp_hca_guid, port.hp_port,
1968 1931              attr->ud_pkey_ix, &ud_pkey);
1969 1932          if (retval != IBT_SUCCESS) {
1970 1933                  IBTF_DPRINTF_L2(cmlog, "ibcm_ud_get_dqpn: "
1971 1934                      "Failed to convert index2pkey: %d", retval);
1972 1935                  ibcm_dec_hca_acc_cnt(hcap);
1973 1936                  return (retval);
1974 1937          }
1975 1938  
1976      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(sidr_entry))
1977      -
1978 1939          /* Allocate a new request id */
1979 1940          if (ibcm_alloc_reqid(hcap, &sidr_entry.srch_req_id) == IBCM_FAILURE) {
1980 1941                  IBTF_DPRINTF_L2(cmlog, "ibcm_ud_get_dqpn: "
1981 1942                      "no req id available");
1982 1943                  ibcm_dec_hca_acc_cnt(hcap);
1983 1944                  return (IBT_INSUFF_KERNEL_RESOURCE);
1984 1945          }
1985 1946  
1986 1947          if ((hcap->hca_port_info[port.hp_port - 1].port_ibmf_hdl == NULL) &&
1987 1948              ((retval = ibcm_hca_reinit_port(hcap, port.hp_port - 1))
↓ open down ↓ 21 lines elided ↑ open up ↑
2009 1970                  ibcm_release_qp(cm_qp_entry);
2010 1971                  ibcm_dec_hca_acc_cnt(hcap);
2011 1972                  return (retval);
2012 1973          }
2013 1974  
2014 1975          sidr_entry.srch_lid = port.hp_base_lid;
2015 1976          sidr_entry.srch_gid = attr->ud_addr->av_sgid;
2016 1977          sidr_entry.srch_grh_exists = attr->ud_addr->av_send_grh;
2017 1978          sidr_entry.srch_mode = IBCM_ACTIVE_MODE;
2018 1979  
2019      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(sidr_entry))
2020      -
2021 1980          /* do various allocations needed here */
2022 1981          rw_enter(&hcap->hca_sidr_list_lock, RW_WRITER);
2023 1982  
2024 1983          (void) ibcm_find_sidr_entry(&sidr_entry, hcap, &ud_statep,
2025 1984              IBCM_FLAG_ADD);
2026 1985          rw_exit(&hcap->hca_sidr_list_lock);
2027 1986  
2028 1987          /* Increment hca's resource count */
2029 1988          ibcm_inc_hca_res_cnt(hcap);
2030 1989  
2031 1990          /* After a resource created on hca, no need to hold the acc cnt */
2032 1991          ibcm_dec_hca_acc_cnt(hcap);
2033 1992  
2034      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ud_statep))
2035      -
2036 1993          /* Initialize some ud_statep fields */
2037 1994          ud_statep->ud_stored_msg = ibmf_msg;
2038 1995          ud_statep->ud_svc_id = attr->ud_sid;
2039 1996          ud_statep->ud_pkt_life_time =
2040 1997              ibt_ib2usec(attr->ud_pkt_lt);
2041 1998          ud_statep->ud_stored_reply_addr.cm_qp_entry = cm_qp_entry;
2042 1999  
2043 2000          /* set remaining retry cnt */
2044 2001          ud_statep->ud_remaining_retry_cnt = ud_statep->ud_max_cm_retries;
2045 2002  
↓ open down ↓ 32 lines elided ↑ open up ↑
2078 2035          ud_statep->ud_stored_reply_addr.rcvd_addr.ia_service_level =
2079 2036              attr->ud_addr->av_srvl;
2080 2037  
2081 2038          /*
2082 2039           * This may be enchanced later, to use a remote qno based on past
2083 2040           * redirect rej mad responses. This would be the place to specify
2084 2041           * appropriate remote qno
2085 2042           */
2086 2043          ud_statep->ud_stored_reply_addr.rcvd_addr.ia_remote_qno = 1;
2087 2044  
2088      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sidr_req_msgp))
2089      -
2090 2045          /* Initialize the SIDR REQ message fields */
2091 2046          sidr_req_msgp =
2092 2047              (ibcm_sidr_req_msg_t *)IBCM_OUT_MSGP(ud_statep->ud_stored_msg);
2093 2048  
2094 2049          sidr_req_msgp->sidr_req_request_id = h2b32(ud_statep->ud_req_id);
2095 2050          sidr_req_msgp->sidr_req_service_id = h2b64(attr->ud_sid);
2096 2051          sidr_req_msgp->sidr_req_pkey = h2b16(ud_pkey);
2097 2052          IBCM_OUT_HDRP(ud_statep->ud_stored_msg)->AttributeID =
2098 2053              h2b16(IBCM_INCOMING_SIDR_REQ + IBCM_ATTR_BASE_ID);
2099 2054  
↓ open down ↓ 9 lines elided ↑ open up ↑
2109 2064          ud_statep->ud_timer_value = ibt_ib2usec(ibcm_max_sidr_rep_proctime) +
2110 2065              (ud_statep->ud_pkt_life_time * 2);
2111 2066  
2112 2067          IBCM_OUT_HDRP(ud_statep->ud_stored_msg)->TransactionID =
2113 2068              h2b64(ibcm_generate_tranid(IBCM_INCOMING_SIDR_REQ,
2114 2069              ud_statep->ud_req_id, 0));
2115 2070  
2116 2071          IBTF_DPRINTF_L4(cmlog, "ibcm_ud_get_dqpn: timer_value in HZ = %x",
2117 2072              ud_statep->ud_timer_value);
2118 2073  
2119      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*ud_statep))
2120      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sidr_req_msgp))
2121      -
2122 2074          ibcm_post_ud_mad(ud_statep, ud_statep->ud_stored_msg,
2123 2075              ibcm_post_sidr_req_complete, ud_statep);
2124 2076  
2125 2077          mutex_enter(&ud_statep->ud_state_mutex);
2126 2078  
2127 2079          /* Wait for SIDR_REP */
2128 2080          if (mode == IBT_BLOCKING) {
2129 2081                  IBTF_DPRINTF_L4(cmlog, "ibcm_ud_get_dqpn: blocking");
2130 2082  
2131 2083                  while (ud_statep->ud_blocking_done != B_TRUE) {
↓ open down ↓ 74 lines elided ↑ open up ↑
2206 2158                   * handle with the DQPN and QKey that are obtained from
2207 2159                   * SIDR REP, hook-up our own handler, so that we can catch
2208 2160                   * the event, and we ourselves call the actual client's
2209 2161                   * ud_cm_handler, in our handler.
2210 2162                   */
2211 2163  
2212 2164                  /* Allocate memory for local handler's private data. */
2213 2165                  local_handler_priv =
2214 2166                      kmem_alloc(sizeof (*local_handler_priv), KM_SLEEP);
2215 2167  
2216      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*local_handler_priv))
2217      -
2218 2168                  local_handler_priv->actual_cm_handler = attr->ud_cm_handler;
2219 2169                  local_handler_priv->actual_cm_private = attr->ud_cm_private;
2220 2170                  local_handler_priv->dest_hdl = ud_destp;
2221 2171  
2222      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*local_handler_priv))
2223      -
2224 2172                  attr->ud_cm_handler = ibcm_local_cm_handler;
2225 2173                  attr->ud_cm_private = local_handler_priv;
2226 2174          }
2227 2175  
2228 2176          /* In order to get DQPN and Destination QKey, perform SIDR */
2229 2177          retval = ibcm_ud_get_dqpn(attr, mode, ud_ret_args);
2230 2178          if (retval != IBT_SUCCESS) {
2231 2179                  IBTF_DPRINTF_L2(cmlog, "ibt_request_ud_dest: "
2232 2180                      "Failed to get DQPN: %d", retval);
2233 2181  
↓ open down ↓ 104 lines elided ↑ open up ↑
2338 2286          if (statep->mra_msg == NULL) {
2339 2287                  if ((status = ibcm_alloc_out_msg(
2340 2288                      statep->stored_reply_addr.ibmf_hdl, &statep->mra_msg,
2341 2289                      MAD_METHOD_SEND)) != IBT_SUCCESS) {
2342 2290                          IBTF_DPRINTF_L2(cmlog, "ibt_cm_delay: chan 0x%p"
2343 2291                              "IBMF MSG allocation failed", statep->channel);
2344 2292                          return (status);
2345 2293                  }
2346 2294          }
2347 2295  
2348      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mra_msgp))
2349      -
2350 2296          mra_msgp = (ibcm_mra_msg_t *)IBCM_OUT_MSGP(statep->mra_msg);
2351 2297          mra_msgp->mra_local_comm_id = h2b32(statep->local_comid);
2352 2298          mra_msgp->mra_remote_comm_id = h2b32(statep->remote_comid);
2353 2299  
2354 2300          /* fill in rest of MRA's fields - Message MRAed and Service Timeout */
2355 2301          if (flags == IBT_CM_DELAY_REQ) {
2356 2302                  msg_typ = IBT_CM_MRA_TYPE_REQ;
2357 2303          } else if (flags == IBT_CM_DELAY_REP) {
2358 2304                  msg_typ = IBT_CM_MRA_TYPE_REP;
2359 2305          } else if (flags == IBT_CM_DELAY_LAP) {
↓ open down ↓ 3 lines elided ↑ open up ↑
2363 2309          mra_msgp->mra_message_type_plus = msg_typ << 6;
2364 2310          mra_msgp->mra_service_timeout_plus = ibt_usec2ib(service_time) << 3;
2365 2311  
2366 2312          len = min(len, IBT_MRA_PRIV_DATA_SZ);
2367 2313          if (priv_data && (len > 0))
2368 2314                  bcopy(priv_data, mra_msgp->mra_private_data, len);
2369 2315  
2370 2316          IBCM_OUT_HDRP(statep->mra_msg)->AttributeID =
2371 2317              h2b16(IBCM_INCOMING_MRA + IBCM_ATTR_BASE_ID);
2372 2318  
2373      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mra_msgp))
2374      -
2375 2319          mutex_enter(&statep->state_mutex);
2376 2320  
2377 2321          if ((statep->mode == IBCM_ACTIVE_MODE) &&
2378 2322              (statep->state == IBCM_STATE_REP_RCVD)) {
2379 2323                  statep->state = IBCM_STATE_MRA_REP_SENT;
2380 2324          } else if (statep->mode == IBCM_PASSIVE_MODE) {
2381 2325                  if (statep->state == IBCM_STATE_REQ_RCVD) {
2382 2326                          statep->state = IBCM_STATE_MRA_SENT;
2383 2327                  } else if (statep->ap_state == IBCM_AP_STATE_LAP_RCVD) {
2384 2328                          statep->ap_state = IBCM_AP_STATE_MRA_LAP_RCVD;
↓ open down ↓ 73 lines elided ↑ open up ↑
2458 2402  ibt_status_t
2459 2403  ibt_register_service(ibt_clnt_hdl_t ibt_hdl, ibt_srv_desc_t *srv,
2460 2404      ib_svc_id_t sid, int num_sids, ibt_srv_hdl_t *srv_hdl, ib_svc_id_t *ret_sid)
2461 2405  {
2462 2406          ibcm_svc_info_t         *svcinfop;
2463 2407  
2464 2408          IBTF_DPRINTF_L2(cmlog, "ibt_register_service(%p (%s), %p, 0x%llX, %d)",
2465 2409              ibt_hdl, ibtl_cm_get_clnt_name(ibt_hdl), srv, (longlong_t)sid,
2466 2410              num_sids);
2467 2411  
2468      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*svcinfop))
2469      -
2470 2412          *srv_hdl = NULL;
2471 2413  
2472 2414          if (num_sids <= 0) {
2473 2415                  IBTF_DPRINTF_L2(cmlog, "ibt_register_service: "
2474 2416                      "Invalid number of service-ids specified (%d)", num_sids);
2475 2417                  return (IBT_INVALID_PARAM);
2476 2418          }
2477 2419  
2478 2420          if (sid == 0) {
2479 2421                  if (ret_sid == NULL)
↓ open down ↓ 29 lines elided ↑ open up ↑
2509 2451                  *ret_sid = sid;
2510 2452  
2511 2453          *srv_hdl = svcinfop;
2512 2454  
2513 2455          ibtl_cm_change_service_cnt(ibt_hdl, num_sids);
2514 2456  
2515 2457          /* If this message isn't seen, then ibt_register_service failed. */
2516 2458          IBTF_DPRINTF_L2(cmlog, "ibt_register_service: done (%p, %llX)",
2517 2459              svcinfop, sid);
2518 2460  
2519      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*svcinfop))
2520      -
2521 2461          return (IBT_SUCCESS);
2522 2462  }
2523 2463  
2524 2464  
2525 2465  static ibt_status_t
2526 2466  ibcm_write_service_record(ibmf_saa_handle_t saa_handle,
2527 2467      sa_service_record_t *srv_recp, ibmf_saa_access_type_t saa_type)
2528 2468  {
2529 2469          int     rval;
2530 2470          int     retry;
↓ open down ↓ 91 lines elided ↑ open up ↑
2622 2562  
2623 2563                          IBCM_DUMP_SERVICE_REC(srv_resp);
2624 2564  
2625 2565                          /*
2626 2566                           * Remove the Service Record Entry from SA.
2627 2567                           *
2628 2568                           * Get ServiceID info from Response Buf, other
2629 2569                           * attributes are already filled-in.
2630 2570                           */
2631 2571  
2632      -                         _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(srec->ServiceID))
2633      -
2634 2572                          srec->ServiceID = srv_resp->ServiceID;
2635 2573  
2636      -                         _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(srec->ServiceID))
2637      -
2638 2574                          (void) ibcm_write_service_record(saa_handle, srec,
2639 2575                              IBMF_SAA_DELETE);
2640 2576                  }
2641 2577  
2642 2578                  /* Deallocate the memory for results_p. */
2643 2579                  kmem_free(results_p, length);
2644 2580          }
2645 2581  }
2646 2582  
2647 2583  
↓ open down ↓ 42 lines elided ↑ open up ↑
2690 2626          ibmf_saa_handle_t       saa_handle;
2691 2627          sa_service_record_t     srv_rec;
2692 2628          uint16_t                pkey_ix;
2693 2629  
2694 2630          if (sb_hdl_p != NULL)
2695 2631                  *sb_hdl_p = NULL;       /* return value for error cases */
2696 2632  
2697 2633          IBTF_DPRINTF_L2(cmlog, "ibt_bind_service: srv_hdl %p, gid (%llX:%llX)",
2698 2634              srv_hdl, (longlong_t)gid.gid_prefix, (longlong_t)gid.gid_guid);
2699 2635  
2700      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sbindp))
2701      -
2702 2636          /* Call ibtl_cm_get_hca_port to get the port number and the HCA GUID. */
2703 2637          if ((status = ibtl_cm_get_hca_port(gid, 0, &port)) != IBT_SUCCESS) {
2704 2638                  IBTF_DPRINTF_L2(cmlog, "ibt_bind_service: "
2705 2639                      "ibtl_cm_get_hca_port failed: %d", status);
2706 2640                  return (status);
2707 2641          }
2708 2642          IBTF_DPRINTF_L4(cmlog, "ibt_bind_service: Port:%d HCA GUID:%llX",
2709 2643              port.hp_port, port.hp_hca_guid);
2710 2644  
2711 2645          hcap = ibcm_find_hca_entry(port.hp_hca_guid);
↓ open down ↓ 173 lines elided ↑ open up ↑
2885 2819          ibcm_inc_hca_svc_cnt(hcap);
2886 2820          ibcm_dec_hca_acc_cnt(hcap);
2887 2821  
2888 2822          /* If this message isn't seen then ibt_bind_service failed */
2889 2823          IBTF_DPRINTF_L2(cmlog, "ibt_bind_service: DONE (%p, %llX:%llX)",
2890 2824              srv_hdl, gid.gid_prefix, gid.gid_guid);
2891 2825  
2892 2826          if (sb_hdl_p != NULL)
2893 2827                  *sb_hdl_p = sbindp;
2894 2828  
2895      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sbindp))
2896      -
2897 2829          return (IBT_SUCCESS);
2898 2830  }
2899 2831  
2900 2832  ibt_status_t
2901 2833  ibt_unbind_service(ibt_srv_hdl_t srv_hdl, ibt_sbind_hdl_t sbindp)
2902 2834  {
2903 2835          ib_svc_id_t     sid, end_sid;
2904 2836          ibt_status_t    rval;
2905 2837          ibcm_hca_info_t *hcap;
2906 2838          ibcm_svc_bind_t *sbp, **sbpp;
↓ open down ↓ 152 lines elided ↑ open up ↑
3059 2991                  IBTF_DPRINTF_L2(cmlog, "ibt_deregister_service:"
3060 2992                      " srv_hdl %p still has bindings", srv_hdl);
3061 2993                  mutex_exit(&ibcm_svc_info_lock);
3062 2994                  return (IBT_CM_SERVICE_BUSY);
3063 2995          }
3064 2996          svc.sid = srv_hdl->svc_id;
3065 2997          svc.num_sids = 1;
3066 2998          IBTF_DPRINTF_L3(cmlog, "ibt_deregister_service: SID 0x%llX, numsids %d",
3067 2999              srv_hdl->svc_id, srv_hdl->svc_num_sids);
3068 3000  
3069      -#ifdef __lock_lint
3070      -        ibcm_svc_compare(NULL, NULL);
3071      -#endif
3072 3001          svcp = avl_find(&ibcm_svc_avl_tree, &svc, NULL);
3073 3002          if (svcp != srv_hdl) {
3074 3003                  mutex_exit(&ibcm_svc_info_lock);
3075 3004                  IBTF_DPRINTF_L2(cmlog, "ibt_deregister_service(): "
3076 3005                      "srv_hdl %p not found", srv_hdl);
3077 3006                  return (IBT_INVALID_PARAM);
3078 3007          }
3079 3008          avl_remove(&ibcm_svc_avl_tree, svcp);
3080 3009  
3081 3010          /* wait for active REQ/SREQ handling to be done */
↓ open down ↓ 922 lines elided ↑ open up ↑
4004 3933                  IBTF_DPRINTF_L2(cmlog, "ibt_cm_proceed : chan 0x%p Failed as "
4005 3934                      "client returned non-DEFER status from cm handler",
4006 3935                      statep->channel);
4007 3936                  return (IBT_CHAN_STATE_INVALID);
4008 3937          }
4009 3938  
4010 3939          ASSERT(statep->clnt_proceed == IBCM_UNBLOCK);
4011 3940          statep->clnt_proceed = IBCM_FAIL;
4012 3941          mutex_exit(&statep->state_mutex);
4013 3942  
4014      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*proceed_targs))
4015      -
4016 3943          /* the state machine processing is done in a separate thread */
4017 3944  
4018 3945          /* proceed_targs is freed in ibcm_proceed_via_taskq */
4019 3946          proceed_targs = kmem_alloc(sizeof (ibcm_proceed_targs_t),
4020 3947              KM_SLEEP);
4021 3948  
4022 3949          proceed_targs->event  = event;
4023 3950          proceed_targs->status = status;
4024 3951          proceed_targs->priv_data_len = priv_data_len;
4025 3952  
4026 3953          bcopy(priv_data, proceed_targs->priv_data, priv_data_len);
4027 3954  
4028 3955          proceed_targs->tst.rc.statep = statep;
4029 3956          bcopy(cm_event_data, &proceed_targs->tst.rc.rc_cm_event_data,
4030 3957              sizeof (ibt_cm_proceed_reply_t));
4031 3958  
4032      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*proceed_targs))
4033      -
4034 3959          (void) taskq_dispatch(ibcm_taskq, ibcm_proceed_via_taskq,
4035 3960              proceed_targs, TQ_SLEEP);
4036 3961  
4037 3962          return (IBT_SUCCESS);
4038 3963  }
4039 3964  
4040 3965  /*
4041 3966   * Function:
4042 3967   *      ibcm_proceed_via_taskq
4043 3968   *
↓ open down ↓ 125 lines elided ↑ open up ↑
4169 4094                  mutex_exit(&ud_statep->ud_state_mutex);
4170 4095                  IBTF_DPRINTF_L2(cmlog, "ibt_cm_ud_proceed : Failed as client "
4171 4096                      "returned non-DEFER status from cm handler");
4172 4097                  return (IBT_INVALID_PARAM);
4173 4098          }
4174 4099  
4175 4100          ASSERT(ud_statep->ud_clnt_proceed == IBCM_UNBLOCK);
4176 4101          ud_statep->ud_clnt_proceed = IBCM_FAIL;
4177 4102          mutex_exit(&ud_statep->ud_state_mutex);
4178 4103  
4179      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*proceed_targs))
4180      -
4181 4104          /* the state machine processing is done in a separate thread */
4182 4105  
4183 4106          /* proceed_targs is freed in ibcm_proceed_via_taskq */
4184 4107          proceed_targs = kmem_zalloc(sizeof (ibcm_proceed_targs_t),
4185 4108              KM_SLEEP);
4186 4109  
4187 4110          proceed_targs->status = status;
4188 4111          proceed_targs->priv_data_len = priv_data_len;
4189 4112  
4190 4113          bcopy(priv_data, proceed_targs->priv_data, priv_data_len);
↓ open down ↓ 4 lines elided ↑ open up ↑
4195 4118                  proceed_targs->tst.ud.ud_qpn = qp_attr.qp_qpn;
4196 4119          }
4197 4120  
4198 4121          proceed_targs->tst.ud.ud_statep = ud_statep;
4199 4122  
4200 4123          /* copy redirect info based on status */
4201 4124          if (status == IBT_CM_REDIRECT)
4202 4125                  bcopy(redirect_infop, &proceed_targs->tst.ud.ud_redirect_info,
4203 4126                      sizeof (ibt_redirect_info_t));
4204 4127  
4205      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*proceed_targs))
4206      -
4207 4128          (void) taskq_dispatch(ibcm_taskq, ibcm_ud_proceed_via_taskq,
4208 4129              proceed_targs, TQ_SLEEP);
4209 4130  
4210 4131          return (IBT_SUCCESS);
4211 4132  }
4212 4133  
4213 4134  /*
4214 4135   * Function:
4215 4136   *      ibcm_ud_proceed_via_taskq
4216 4137   *
↓ open down ↓ 220 lines elided ↑ open up ↑
4437 4358          }
4438 4359  
4439 4360          mutex_exit(&statep->state_mutex);
4440 4361  
4441 4362          /* No more failure returns below */
4442 4363  
4443 4364          /* Allocate MAD for LAP */
4444 4365          IBTF_DPRINTF_L5(cmlog, "ibt_set_alt_path:"
4445 4366              " statep's mad addr = 0x%p", IBCM_OUT_HDRP(statep->lapr_msg));
4446 4367  
4447      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*lap_msgp))
4448      -
4449 4368          lap_msgp = (ibcm_lap_msg_t *)IBCM_OUT_MSGP(statep->lapr_msg);
4450 4369  
4451 4370          lap_msgp->lap_alt_l_port_lid = h2b16(alternate_slid);
4452 4371          lap_msgp->lap_alt_r_port_lid =
4453 4372              h2b16(alt_path->ap_alt_cep_path.cep_adds_vect.av_dlid);
4454 4373  
4455 4374          /* Fill in remote port gid */
4456 4375          lap_msgp->lap_alt_r_port_gid.gid_prefix =
4457 4376              h2b64(alt_path->ap_alt_cep_path.cep_adds_vect.av_dgid.gid_prefix);
4458 4377          lap_msgp->lap_alt_r_port_gid.gid_guid =
↓ open down ↓ 31 lines elided ↑ open up ↑
4490 4409          lap_msgp->lap_remote_qpn_eecn_plus =
4491 4410              h2b32((statep->remote_qpn << 8) |
4492 4411              ibt_usec2ib(ibcm_remote_response_time) << 3);
4493 4412  
4494 4413          len = min(priv_data_len, IBT_LAP_PRIV_DATA_SZ);
4495 4414          if ((len > 0) && priv_data) {
4496 4415                  bcopy(priv_data, lap_msgp->lap_private_data, len);
4497 4416          }
4498 4417  
4499 4418          /* only rc_alt_pkt_lt and ap_return_data fields are initialized */
4500      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*statep))
4501      -
4502 4419          statep->rc_alt_pkt_lt = ibt_ib2usec(alt_path->ap_alt_pkt_lt);
4503 4420  
4504 4421          /* return_data is filled up in the state machine code */
4505 4422          statep->ap_return_data = ret_args;
4506 4423  
4507      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*statep))
4508      -
4509 4424          IBCM_OUT_HDRP(statep->lapr_msg)->AttributeID =
4510 4425              h2b16(IBCM_INCOMING_LAP + IBCM_ATTR_BASE_ID);
4511 4426  
4512 4427          IBCM_OUT_HDRP(statep->lapr_msg)->TransactionID =
4513 4428              h2b64(ibcm_generate_tranid(IBCM_INCOMING_LAP, statep->local_comid,
4514 4429              0));
4515 4430          IBTF_DPRINTF_L3(cmlog, "ibt_set_alt_path: statep %p, tid %llx",
4516 4431              statep, IBCM_OUT_HDRP(statep->lapr_msg)->TransactionID);
4517 4432  
4518      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*lap_msgp))
4519      -
4520 4433          /* Send LAP */
4521 4434          ibcm_post_rc_mad(statep, statep->lapr_msg, ibcm_post_lap_complete,
4522 4435              statep);
4523 4436  
4524 4437          mutex_enter(&statep->state_mutex);
4525 4438  
4526 4439          if (mode == IBT_BLOCKING) {
4527 4440                  IBTF_DPRINTF_L4(cmlog, "ibt_set_alt_path: blocking");
4528 4441  
4529 4442                  /* wait for APR */
↓ open down ↓ 130 lines elided ↑ open up ↑
4660 4573          ib_gid_t                ml_sgid;
4661 4574          ib_gid_t                ml_mgid;
4662 4575          ib_pkey_t               ml_pkey;
4663 4576          ib_qkey_t               ml_qkey;
4664 4577          uint_t                  ml_refcnt;
4665 4578          uint8_t                 ml_jstate;
4666 4579  } ibcm_mcg_list_t;
4667 4580  
4668 4581  ibcm_mcg_list_t *ibcm_mcglist = NULL;
4669 4582  
4670      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_mcglist_lock, ibcm_mcg_list_s))
4671      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_mcglist_lock, ibcm_mcglist))
4672      -
4673 4583  typedef struct ibcm_join_mcg_tqarg_s {
4674 4584          ib_gid_t                rgid;
4675 4585          ibt_mcg_attr_t          mcg_attr;
4676 4586          ibt_mcg_info_t          *mcg_infop;
4677 4587          ibt_mcg_handler_t       func;
4678 4588          void                    *arg;
4679 4589  } ibcm_join_mcg_tqarg_t;
4680 4590  
4681      -_NOTE(READ_ONLY_DATA(ibcm_join_mcg_tqarg_s))
4682      -
4683 4591  void
4684 4592  ibcm_add_incr_mcg_entry(sa_mcmember_record_t *mcg_req,
4685 4593      sa_mcmember_record_t *mcg_resp)
4686 4594  {
4687 4595          ibcm_mcg_list_t *new = NULL;
4688 4596          ibcm_mcg_list_t *head = NULL;
4689 4597  
4690 4598          IBTF_DPRINTF_L3(cmlog, "ibcm_add_incr_mcg_entry: MGID %llX:%llX"
4691 4599              "\n SGID %llX:%llX, JState %X)", mcg_req->MGID.gid_prefix,
4692 4600              mcg_req->MGID.gid_guid, mcg_req->PortGID.gid_prefix,
↓ open down ↓ 176 lines elided ↑ open up ↑
4869 4777          if (mcg_attr->mc_join_state == 0) {
4870 4778                  IBTF_DPRINTF_L2(cmlog, "ibt_join_mcg: JoinState not specified");
4871 4779                  return (IBT_INVALID_PARAM);
4872 4780          }
4873 4781  
4874 4782          if (mcg_info_p == NULL) {
4875 4783                  IBTF_DPRINTF_L2(cmlog, "ibt_join_mcg: mcg_info_p is NULL");
4876 4784                  return (IBT_INVALID_PARAM);
4877 4785          }
4878 4786  
4879      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mcg_tq))
4880      -
4881 4787          mcg_tq = kmem_alloc(sizeof (ibcm_join_mcg_tqarg_t), flag);
4882 4788          if (mcg_tq == NULL) {
4883 4789                  IBTF_DPRINTF_L2(cmlog, "ibt_join_mcg: "
4884 4790                      "Unable to allocate memory for local usage.");
4885 4791                  return (IBT_INSUFF_KERNEL_RESOURCE);
4886 4792          }
4887 4793  
4888 4794          mcg_tq->rgid = rgid;
4889 4795          bcopy(mcg_attr, &mcg_tq->mcg_attr, sizeof (ibt_mcg_attr_t));
4890 4796          mcg_tq->mcg_infop = mcg_info_p;
4891 4797          mcg_tq->func = func;
4892 4798          mcg_tq->arg = arg;
4893 4799  
4894      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mcg_tq))
4895      -
4896 4800          if (func != NULL) {     /* Non-Blocking */
4897 4801                  IBTF_DPRINTF_L3(cmlog, "ibt_join_mcg: Non-Blocking Call");
4898 4802                  if (taskq_dispatch(ibcm_taskq, ibcm_process_async_join_mcg,
4899 4803                      mcg_tq, TQ_NOSLEEP) == 0) {
4900 4804                          IBTF_DPRINTF_L2(cmlog, "ibt_join_mcg: Failed to "
4901 4805                              "Dispatch the TaskQ");
4902 4806                          kmem_free(mcg_tq, sizeof (ibcm_join_mcg_tqarg_t));
4903 4807                          return (IBT_INSUFF_KERNEL_RESOURCE);
4904 4808                  } else
4905 4809                          return (IBT_SUCCESS);
↓ open down ↓ 916 lines elided ↑ open up ↑
5822 5726                          }
5823 5727  
5824 5728                          num_rec = len/sizeof (sa_node_record_t);
5825 5729                          nr_resp = (sa_node_record_t *)(uchar_t *)res_p;
5826 5730  
5827 5731                          /* Validate the returned number of records. */
5828 5732                          if ((nr_resp != NULL) && (num_rec > 0)) {
5829 5733  
5830 5734                                  IBCM_DUMP_NODE_REC(nr_resp);
5831 5735  
5832      -                                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(
5833      -                                    *node_info_p))
5834      -
5835 5736                                  node_info_p->n_sys_img_guid =
5836 5737                                      nr_resp->NodeInfo.SystemImageGUID;
5837 5738                                  node_info_p->n_node_guid =
5838 5739                                      nr_resp->NodeInfo.NodeGUID;
5839 5740                                  node_info_p->n_port_guid =
5840 5741                                      nr_resp->NodeInfo.PortGUID;
5841 5742                                  node_info_p->n_dev_id =
5842 5743                                      nr_resp->NodeInfo.DeviceID;
5843 5744                                  node_info_p->n_revision =
5844 5745                                      nr_resp->NodeInfo.Revision;
↓ open down ↓ 1 lines elided ↑ open up ↑
5846 5747                                      nr_resp->NodeInfo.VendorID;
5847 5748                                  node_info_p->n_num_ports =
5848 5749                                      nr_resp->NodeInfo.NumPorts;
5849 5750                                  node_info_p->n_port_num =
5850 5751                                      nr_resp->NodeInfo.LocalPortNum;
5851 5752                                  node_info_p->n_node_type =
5852 5753                                      nr_resp->NodeInfo.NodeType;
5853 5754                                  (void) strncpy(node_info_p->n_description,
5854 5755                                      (char *)&nr_resp->NodeDescription, 64);
5855 5756  
5856      -                                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(
5857      -                                    *node_info_p))
5858      -
5859 5757                                  /*
5860 5758                                   * Deallocate the memory allocated by SA for
5861 5759                                   * 'nr_resp'.
5862 5760                                   */
5863 5761                                  ibcm_dec_hca_acc_cnt(hcap);
5864 5762                                  kmem_free(nr_resp, len);
5865 5763                                  retval = IBT_SUCCESS;
5866 5764  
5867 5765                                  goto gid_to_ni_exit;
5868 5766                          } else {
↓ open down ↓ 151 lines elided ↑ open up ↑
6020 5918                          }
6021 5919  
6022 5920                          num_rec = len/sizeof (sa_node_record_t);
6023 5921                          nr_resp = (sa_node_record_t *)(uchar_t *)res_p;
6024 5922  
6025 5923                          /* Validate the returned number of records. */
6026 5924                          if ((nr_resp != NULL) && (num_rec > 0)) {
6027 5925  
6028 5926                                  IBCM_DUMP_NODE_REC(nr_resp);
6029 5927  
6030      -                                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(
6031      -                                    *node_info_p))
6032      -
6033 5928                                  node_info_p->n_sys_img_guid =
6034 5929                                      nr_resp->NodeInfo.SystemImageGUID;
6035 5930                                  node_info_p->n_node_guid =
6036 5931                                      nr_resp->NodeInfo.NodeGUID;
6037 5932                                  node_info_p->n_port_guid =
6038 5933                                      nr_resp->NodeInfo.PortGUID;
6039 5934                                  node_info_p->n_dev_id =
6040 5935                                      nr_resp->NodeInfo.DeviceID;
6041 5936                                  node_info_p->n_revision =
6042 5937                                      nr_resp->NodeInfo.Revision;
↓ open down ↓ 1 lines elided ↑ open up ↑
6044 5939                                      nr_resp->NodeInfo.VendorID;
6045 5940                                  node_info_p->n_num_ports =
6046 5941                                      nr_resp->NodeInfo.NumPorts;
6047 5942                                  node_info_p->n_port_num =
6048 5943                                      nr_resp->NodeInfo.LocalPortNum;
6049 5944                                  node_info_p->n_node_type =
6050 5945                                      nr_resp->NodeInfo.NodeType;
6051 5946                                  (void) strncpy(node_info_p->n_description,
6052 5947                                      (char *)&nr_resp->NodeDescription, 64);
6053 5948  
6054      -                                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(
6055      -                                    *node_info_p))
6056      -
6057 5949                                  /*
6058 5950                                   * Deallocate the memory allocated by SA for
6059 5951                                   * 'nr_resp'.
6060 5952                                   */
6061 5953                                  ibcm_dec_hca_acc_cnt(hcap);
6062 5954                                  kmem_free(nr_resp, len);
6063 5955                                  retval = IBT_SUCCESS;
6064 5956  
6065 5957                                  goto lid_to_ni_exit;
6066 5958                          } else {
↓ open down ↓ 498 lines elided ↑ open up ↑
6565 6457                              (ipp->ip_port_gid.gid_guid ==
6566 6458                              sattr->sip_gid.gid_guid)) {
6567 6459                                  if ((sattr->sip_pkey) &&
6568 6460                                      (ipp->ip_pkey != sattr->sip_pkey))
6569 6461                                          continue;
6570 6462  
6571 6463                                  if ((sattr->sip_zoneid != ALL_ZONES) &&
6572 6464                                      (sattr->sip_zoneid != ipp->ip_zoneid))
6573 6465                                          continue;
6574 6466  
6575      -                                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*s_ip))
6576 6467                                  s_ip[j].ip_addr.family = ipp->ip_inet_family;
6577      -                                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*s_ip))
6578 6468                                  if (s_ip[j].ip_addr.family == AF_INET) {
6579 6469                                          bcopy(&ipp->ip_cm_sin.sin_addr,
6580 6470                                              &s_ip[j].ip_addr.un.ip4addr,
6581 6471                                              sizeof (in_addr_t));
6582 6472                                  } else if (s_ip[j].ip_addr.family == AF_INET6) {
6583 6473                                          bcopy(&ipp->ip_cm_sin6.sin6_addr,
6584 6474                                              &s_ip[j].ip_addr.un.ip6addr,
6585 6475                                              sizeof (in6_addr_t));
6586 6476                                          /* TBD: scope_id */
6587 6477                                  }
↓ open down ↓ 89 lines elided ↑ open up ↑
6677 6567  {
6678 6568          return ((sid & IB_SID_IPADDR_IPNUM_MASK) >> 16);
6679 6569  }
6680 6570  
6681 6571  in_port_t
6682 6572  ibt_get_ip_dst_port(ib_svc_id_t sid)
6683 6573  {
6684 6574          return (sid & IB_SID_IPADDR_PORTNUM_MASK);
6685 6575  }
6686 6576  
6687      -_NOTE(SCHEME_PROTECTS_DATA("Unshared data", ibt_ip_cm_info_t))
6688      -_NOTE(SCHEME_PROTECTS_DATA("Unshared data", ibcm_ip_pvtdata_t))
6689      -
6690 6577  ibt_status_t
6691 6578  ibt_format_ip_private_data(ibt_ip_cm_info_t *ip_cm_info,
6692 6579      ibt_priv_data_len_t priv_data_len, void *priv_data_p)
6693 6580  {
6694 6581          ibcm_ip_pvtdata_t       ip_data;
6695 6582  
6696 6583          IBTF_DPRINTF_L4(cmlog, "ibt_format_ip_private_data(%p, %d, %p)",
6697 6584              ip_cm_info, priv_data_len, priv_data_p);
6698 6585  
6699 6586          if ((ip_cm_info == NULL) || (priv_data_p == NULL) ||
↓ open down ↓ 69 lines elided ↑ open up ↑
6769 6656                      sizeof (in6_addr_t));
6770 6657          } else {
6771 6658                  IBTF_DPRINTF_L2(cmlog, "ibt_get_ip_data: ERROR: IP Addr needs"
6772 6659                      " to be either AF_INET or AF_INET6 family.");
6773 6660                  return (IBT_INVALID_PARAM);
6774 6661          }
6775 6662          IBCM_PRINT_IP("ibt_get_ip_data: src", &ip_cm_infop->src_addr);
6776 6663          IBCM_PRINT_IP("ibt_get_ip_data: dst", &ip_cm_infop->dst_addr);
6777 6664  
6778 6665          return (IBT_SUCCESS);
6779      -}
6780      -
6781      -
6782      -/* Routines for warlock */
6783      -
6784      -/* ARGSUSED */
6785      -static void
6786      -ibcm_dummy_mcg_handler(void *arg, ibt_status_t retval, ibt_mcg_info_t *minfo)
6787      -{
6788      -        ibcm_join_mcg_tqarg_t   dummy_mcg;
6789      -
6790      -        dummy_mcg.func = ibcm_dummy_mcg_handler;
6791      -
6792      -        IBTF_DPRINTF_L5(cmlog, "ibcm_dummy_mcg_handler: "
6793      -            "dummy_mcg.func %p", dummy_mcg.func);
6794      -}
6795      -
6796      -
6797      -/* ARGSUSED */
6798      -static void
6799      -ibcm_dummy_recycle_rc_handler(ibt_status_t retval, void *arg)
6800      -{
6801      -        ibcm_taskq_recycle_arg_t        dummy_rc_recycle;
6802      -
6803      -        dummy_rc_recycle.func = ibcm_dummy_recycle_rc_handler;
6804      -
6805      -        IBTF_DPRINTF_L5(cmlog, "ibcm_dummy_recycle_rc_handler: "
6806      -            "dummy_rc_recycle.func %p", dummy_rc_recycle.func);
6807      -}
6808      -
6809      -
6810      -/* ARGSUSED */
6811      -static ibt_cm_status_t
6812      -ibcm_dummy_ud_handler(void *priv, ibt_cm_ud_event_t *event,
6813      -    ibt_cm_ud_return_args_t *ret_args,
6814      -    void *priv_data, ibt_priv_data_len_t len)
6815      -{
6816      -        /*
6817      -         * Let warlock see that ibcm_local_handler_s::actual_cm_handler
6818      -         * points to this routine.
6819      -         */
6820      -        ibcm_local_handler_t    p;
6821      -        ibcm_ud_state_data_t    dummy_ud;
6822      -
6823      -        p.actual_cm_handler = ibcm_dummy_ud_handler;
6824      -        dummy_ud.ud_cm_handler = ibcm_dummy_ud_handler;
6825      -
6826      -        IBTF_DPRINTF_L5(cmlog, "ibcm_dummy_ud_handler: p.actual_cm_handler %p"
6827      -            "dummy_ud.ud_cm_handler %p", p.actual_cm_handler,
6828      -            dummy_ud.ud_cm_handler);
6829      -        /*
6830      -         * Call all routines that the client's callback routine could call.
6831      -         */
6832      -
6833      -        return (IBT_CM_ACCEPT);
6834      -}
6835      -
6836      -/* ARGSUSED */
6837      -static ibt_cm_status_t
6838      -ibcm_dummy_rc_handler(void *priv, ibt_cm_event_t *event,
6839      -    ibt_cm_return_args_t *ret_args, void *priv_data, ibt_priv_data_len_t len)
6840      -{
6841      -        ibcm_state_data_t       dummy_rc;
6842      -
6843      -        dummy_rc.cm_handler = ibcm_dummy_rc_handler;
6844      -
6845      -        IBTF_DPRINTF_L5(cmlog, "ibcm_dummy_rc_handler: "
6846      -            "dummy_ud.ud_cm_handler %p", dummy_rc.cm_handler);
6847      -        /*
6848      -         * Call all routines that the client's callback routine could call.
6849      -         */
6850      -
6851      -        return (IBT_CM_ACCEPT);
6852 6666  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX