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_utils.c
          +++ new/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_utils.c
↓ open down ↓ 35 lines elided ↑ open up ↑
  36   36  
  37   37  #include <sys/ib/mgt/ibcm/ibcm_impl.h>
  38   38  #include <sys/ddi.h>
  39   39  
  40   40  
  41   41  /* statics */
  42   42  static vmem_t           *ibcm_local_sid_arena;
  43   43  static vmem_t           *ibcm_ip_sid_arena;
  44   44  static ib_svc_id_t      ibcm_local_sid_seed;
  45   45  static ib_com_id_t      ibcm_local_cid_seed;
  46      -_NOTE(READ_ONLY_DATA({ibcm_local_sid_arena ibcm_local_sid_seed
  47      -    ibcm_ip_sid_arena ibcm_local_cid_seed}))
  48   46  static void             ibcm_delete_state_from_avl(ibcm_state_data_t *statep);
  49   47  static void             ibcm_init_conn_trace(ibcm_state_data_t *statep);
  50   48  static void             ibcm_fini_conn_trace(ibcm_state_data_t *statep);
  51   49  static void             ibcm_dump_conn_trbuf(void *statep, char *line_prefix,
  52   50                              char *buf, int buf_size);
  53   51  extern ibt_status_t     ibcm_get_node_rec(ibmf_saa_handle_t, sa_node_record_t *,
  54   52                              uint64_t c_mask, void *, size_t *);
  55   53  
  56   54  /*
  57   55   * ibcm_lookup_msg:
↓ open down ↓ 107 lines elided ↑ open up ↑
 165  163  
 166  164                  return (IBCM_LOOKUP_FAIL);
 167  165          }
 168  166  
 169  167          if ((event_type == IBCM_INCOMING_REQ) ||
 170  168              (event_type == IBCM_OUTGOING_REQ)) {
 171  169  
 172  170                  /* fill in the new ibcm_state_data */
 173  171                  sp = *rstatep;
 174  172  
 175      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sp))
 176      -
 177  173                  /* initialize statep */
 178  174                  mutex_init(&sp->state_mutex, NULL, MUTEX_DEFAULT, NULL);
 179  175                  cv_init(&sp->block_client_cv, NULL, CV_DRIVER, NULL);
 180  176                  cv_init(&sp->block_mad_cv, NULL, CV_DRIVER, NULL);
 181  177  
 182  178                  sp->hcap = hcap;
 183  179                  IBCM_REF_CNT_INCR(sp);
 184  180                  sp->local_comid = comid;
 185  181  
 186  182                  if (ibcm_enable_trace != 0)
 187  183                          ibcm_init_conn_trace(sp);
 188  184  
 189  185                  if (event_type == IBCM_INCOMING_REQ) {  /* Passive side */
 190  186                          sp->state = IBCM_STATE_REQ_RCVD;
 191  187                          sp->clnt_proceed = IBCM_BLOCK;
 192  188                          sp->close_nocb_state = IBCM_UNBLOCK;
 193  189                          sp->remote_hca_guid = remote_hca_guid;
 194  190                          sp->remote_qpn = remote_qpn;
 195      -
 196  191                  } else if (event_type == IBCM_OUTGOING_REQ) { /* Active side */
 197  192                          sp->close_nocb_state = IBCM_UNBLOCK;
 198  193                          sp->state = IBCM_STATE_IDLE;
 199  194                  }
 200      -
 201      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sp))
 202      -
 203  195          } else {
 204  196                  sp = *rstatep;  /* for incoming REQ/REP STALE only */
 205  197          }
 206  198  
 207  199          if ((event_type == IBCM_INCOMING_REQ) ||
 208  200              (event_type == IBCM_INCOMING_REP_STALE)) {
 209  201  
 210  202                  /* First, insert a new "sp" into "hca_passive_tree" @ "where" */
 211  203                  avl_insert(&(hcap->hca_passive_tree), (void *)sp, where);
 212  204  
↓ open down ↓ 426 lines elided ↑ open up ↑
 639  631  ibcm_ud_state_data_t *
 640  632  ibcm_add_sidr_entry(ibcm_sidr_srch_t *srch_param, ibcm_hca_info_t *hcap)
 641  633  {
 642  634          ibcm_ud_state_data_t    *ud_statep;
 643  635  
 644  636          IBTF_DPRINTF_L5(cmlog, "ibcm_add_sidr_entry: lid=%x, guid=%llX, "
 645  637              "grh = %x req_id = %x", srch_param->srch_lid,
 646  638              srch_param->srch_gid.gid_guid, srch_param->srch_grh_exists,
 647  639              srch_param->srch_req_id);
 648  640  
 649      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ud_statep))
 650      -
 651  641          /* didn't find the entry - so create new */
 652  642          ud_statep = kmem_zalloc(sizeof (ibcm_ud_state_data_t), KM_SLEEP);
 653  643  
 654  644          mutex_init(&ud_statep->ud_state_mutex, NULL, MUTEX_DEFAULT, NULL);
 655  645          cv_init(&ud_statep->ud_block_client_cv, NULL, CV_DRIVER, NULL);
 656  646  
 657  647          /* Initialize some ud_statep fields */
 658  648          mutex_enter(&ud_statep->ud_state_mutex);
 659  649          ud_statep->ud_hcap              = hcap;
 660  650          ud_statep->ud_req_id            = srch_param->srch_req_id;
↓ open down ↓ 2 lines elided ↑ open up ↑
 663  653          ud_statep->ud_sidr_req_lid      = srch_param->srch_lid;
 664  654          ud_statep->ud_sidr_req_gid      = srch_param->srch_gid;
 665  655          ud_statep->ud_mode              = srch_param->srch_mode;
 666  656          ud_statep->ud_max_cm_retries    = ibcm_max_retries;
 667  657          mutex_exit(&ud_statep->ud_state_mutex);
 668  658  
 669  659          /* Update the list */
 670  660          ud_statep->ud_nextp = hcap->hca_sidr_list;
 671  661          hcap->hca_sidr_list = ud_statep;
 672  662  
 673      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*ud_statep))
 674      -
 675  663          return (ud_statep);
 676  664  }
 677  665  
 678  666  
 679  667  /*
 680  668   * ibcm_delete_ud_state_data:
 681  669   *      Deletes a given state structure
 682  670   *
 683  671   * Arguments are:-
 684  672   *      statep  - statep to be deleted
↓ open down ↓ 132 lines elided ↑ open up ↑
 817  805   *      NONE
 818  806   *
 819  807   * Return Values:       ibcm_status_t
 820  808   */
 821  809  
 822  810  ibcm_status_t
 823  811  ibcm_init_ids(void)
 824  812  {
 825  813          timespec_t tv;
 826  814  
 827      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_local_sid_arena))
 828      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_ip_sid_arena))
 829      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_local_sid_seed))
 830      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_local_cid_seed))
 831      -
 832  815          ibcm_local_sid_arena = vmem_create("ibcm_local_sid",
 833  816              (void *)IBCM_INITIAL_SID, IBCM_MAX_LOCAL_SIDS, 1, NULL, NULL, NULL,
 834  817              0, VM_SLEEP | VMC_IDENTIFIER);
 835  818  
 836  819          if (!ibcm_local_sid_arena)
 837  820                  return (IBCM_FAILURE);
 838  821  
 839  822          ibcm_ip_sid_arena = vmem_create("ibcm_ip_sid", (void *)IBCM_INITIAL_SID,
 840  823              IBCM_MAX_IP_SIDS, 1, NULL, NULL, NULL, 0,
 841  824              VM_SLEEP | VMC_IDENTIFIER);
↓ open down ↓ 1 lines elided ↑ open up ↑
 843  826          if (!ibcm_ip_sid_arena)
 844  827                  return (IBCM_FAILURE);
 845  828  
 846  829          /* create a random starting value for local service ids */
 847  830          gethrestime(&tv);
 848  831          ibcm_local_sid_seed = ((uint64_t)tv.tv_sec << 20) & 0x007FFFFFFFF00000;
 849  832          ASSERT((ibcm_local_sid_seed & IB_SID_AGN_MASK) == 0);
 850  833          ibcm_local_sid_seed |= IB_SID_AGN_LOCAL;
 851  834  
 852  835          ibcm_local_cid_seed = (ib_com_id_t)tv.tv_sec;
 853      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_local_sid_arena))
 854      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_local_sid_seed))
 855      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_ip_sid_arena))
 856      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_local_cid_seed))
 857  836  
 858  837          return (IBCM_SUCCESS);
 859  838  }
 860  839  
 861  840  
 862  841  /*
 863  842   * ibcm_init_hca_ids:
 864  843   *      Create the vmem arenas for the various hca level ids
 865  844   *
 866  845   * Arguments are:-
↓ open down ↓ 363 lines elided ↑ open up ↑
1230 1209   *      Pointer to ibcm_svc_info_t, if created, otherwise NULL.
1231 1210   */
1232 1211  ibcm_svc_info_t *
1233 1212  ibcm_create_svc_entry(ib_svc_id_t sid, int num_sids)
1234 1213  {
1235 1214          ibcm_svc_info_t *svcp;
1236 1215          ibcm_svc_info_t *svcinfop;
1237 1216          ibcm_svc_lookup_t svc;
1238 1217          avl_index_t where = 0;
1239 1218  
1240      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*svcinfop))
1241      -
1242 1219          /* assume success, and avoid kmem while holding the writer lock */
1243 1220          svcinfop = kmem_zalloc(sizeof (*svcinfop), KM_SLEEP);
1244 1221          svcinfop->svc_id = sid;
1245 1222          svcinfop->svc_num_sids = num_sids;
1246 1223  
1247 1224          svc.sid = sid;
1248 1225          svc.num_sids = num_sids;
1249 1226  
1250 1227          mutex_enter(&ibcm_svc_info_lock);
1251      -#ifdef __lock_lint
1252      -        ibcm_svc_compare(NULL, NULL);
1253      -#endif
1254 1228          svcp = avl_find(&ibcm_svc_avl_tree, &svc, &where);
1255 1229          if (svcp != NULL) {     /* overlab exists */
1256 1230                  mutex_exit(&ibcm_svc_info_lock);
1257 1231                  kmem_free(svcinfop, sizeof (*svcinfop));
1258 1232                  return (NULL);
1259 1233          }
1260 1234          avl_insert(&ibcm_svc_avl_tree, (void *)svcinfop, where);
1261 1235          mutex_exit(&ibcm_svc_info_lock);
1262 1236  
1263      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*svcinfop))
1264      -
1265 1237          return (svcinfop);
1266 1238  }
1267 1239  
1268 1240  /*
1269 1241   * ibcm_find_svc_entry:
1270 1242   *      Finds a ibcm_svc_info_t entry into the CM's global table.
1271 1243   *      The search done here assumes the list is sorted by SID.
1272 1244   *
1273 1245   * Arguments are:
1274 1246   *      sid             - Service ID to look up
↓ open down ↓ 6 lines elided ↑ open up ↑
1281 1253  {
1282 1254          ibcm_svc_info_t *svcp;
1283 1255          ibcm_svc_lookup_t svc;
1284 1256  
1285 1257          IBTF_DPRINTF_L3(cmlog, "ibcm_find_svc_entry: finding SID 0x%llX", sid);
1286 1258  
1287 1259          ASSERT(MUTEX_HELD(&ibcm_svc_info_lock));
1288 1260  
1289 1261          svc.sid = sid;
1290 1262          svc.num_sids = 1;
1291      -#ifdef __lock_lint
1292      -        ibcm_svc_compare(NULL, NULL);
1293      -#endif
1294 1263          svcp = avl_find(&ibcm_svc_avl_tree, &svc, NULL);
1295 1264          if (svcp != NULL) {
1296 1265                  IBTF_DPRINTF_L3(cmlog, "ibcm_find_svc_entry: "
1297 1266                      "found SID = 0x%llX", sid);
1298 1267                  return (svcp);  /* found it */
1299 1268          }
1300 1269          IBTF_DPRINTF_L3(cmlog, "ibcm_find_svc_entry: SID %llX not found", sid);
1301 1270          return (NULL);
1302 1271  }
1303 1272  
↓ open down ↓ 66 lines elided ↑ open up ↑
1370 1339                  return (IBCM_SUCCESS);
1371 1340  }
1372 1341  
1373 1342  ibcm_qp_list_t *
1374 1343  ibcm_find_qp(ibcm_hca_info_t *hcap, int port_no, ib_pkey_t pkey)
1375 1344  {
1376 1345          ibcm_qp_list_t          *entry;
1377 1346          ibmf_qp_handle_t        ibmf_qp;
1378 1347          int                     ibmf_status;
1379 1348  
1380      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*entry))
1381      -
1382 1349          mutex_enter(&ibcm_qp_list_lock);
1383 1350  
1384 1351          /*
1385 1352           * CM currently does not track port up and down status. If tracking of
1386 1353           * " port status" is added in the future, then CM could be optimized to
1387 1354           * re-use other ports on hcap, if the port associated with the above
1388 1355           * port_no is down. But, the issue of "reachability" needs to be
1389 1356           * handled, before selecting an alternative port different from above.
1390 1357           */
1391 1358          entry = hcap->hca_port_info[port_no-1].port_qplist;
↓ open down ↓ 42 lines elided ↑ open up ↑
1434 1401          ibmf_status = ibmf_setup_async_cb(
1435 1402              hcap->hca_port_info[port_no-1].port_ibmf_hdl, ibmf_qp,
1436 1403              ibcm_recv_cb, entry, 0);
1437 1404  
1438 1405          ASSERT(ibmf_status == IBMF_SUCCESS);
1439 1406  
1440 1407  #ifdef  DEBUG
1441 1408          ibcm_query_qp(hcap->hca_port_info[port_no-1].port_ibmf_hdl, ibmf_qp);
1442 1409  #endif
1443 1410  
1444      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*entry))
1445      -
1446 1411          return (entry);
1447 1412  }
1448 1413  
1449 1414  void
1450 1415  ibcm_release_qp(ibcm_qp_list_t *cm_qp_entry)
1451 1416  {
1452 1417          mutex_enter(&ibcm_qp_list_lock);
1453 1418          --cm_qp_entry->qp_ref_cnt;
1454 1419          ASSERT(cm_qp_entry->qp_ref_cnt >= 0);
1455 1420          mutex_exit(&ibcm_qp_list_lock);
↓ open down ↓ 118 lines elided ↑ open up ↑
1574 1539  
1575 1540  /* Trace related functions */
1576 1541  
1577 1542  void
1578 1543  ibcm_init_conn_trace(ibcm_state_data_t *sp)
1579 1544  {
1580 1545          IBTF_DPRINTF_L5(cmlog, "ibcm_init_conn_trace: statep %p", sp);
1581 1546  
1582 1547          /* Initialize trace related fields */
1583 1548  
1584      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sp->conn_trace))
1585 1549          sp->conn_trace = kmem_zalloc(sizeof (ibcm_conn_trace_t), KM_SLEEP);
1586 1550          if ((ibcm_enable_trace & 1) == 0)
1587 1551                  sp->conn_trace->conn_base_tm = gethrtime();
1588 1552          sp->conn_trace->conn_allocated_trcnt = ibcm_conn_max_trcnt;
1589 1553          sp->conn_trace->conn_trace_events =
1590 1554              kmem_zalloc(sp->conn_trace->conn_allocated_trcnt, KM_SLEEP);
1591 1555          sp->conn_trace->conn_trace_event_times =
1592 1556              kmem_zalloc(sp->conn_trace->conn_allocated_trcnt *
1593 1557              sizeof (tm_diff_type), KM_SLEEP);
1594      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sp->conn_trace))
1595 1558  }
1596 1559  
1597 1560  void
1598 1561  ibcm_fini_conn_trace(ibcm_state_data_t *statep)
1599 1562  {
1600 1563          IBTF_DPRINTF_L5(cmlog, "ibcm_fini_conn_trace: statep %p tracep %p",
1601 1564              statep, statep->conn_trace);
1602 1565  
1603 1566          /* free the trace data */
1604 1567          if (statep->conn_trace) {
↓ open down ↓ 381 lines elided ↑ open up ↑
1986 1949                  ibcm_dec_hca_acc_cnt(hcap);
1987 1950                  return (IBT_FAILURE);
1988 1951          }
1989 1952  
1990 1953          num_rec = len/sizeof (sa_node_record_t);
1991 1954          nr_resp = (sa_node_record_t *)(uchar_t *)res_p;
1992 1955  
1993 1956          if ((nr_resp != NULL) && (num_rec > 0)) {
1994 1957                  IBCM_DUMP_NODE_REC(nr_resp);
1995 1958  
1996      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(
1997      -                    *node_info_p))
1998      -
1999 1959                  node_info_p->n_sys_img_guid =
2000 1960                      nr_resp->NodeInfo.SystemImageGUID;
2001 1961                  node_info_p->n_node_guid =
2002 1962                      nr_resp->NodeInfo.NodeGUID;
2003 1963                  node_info_p->n_port_guid =
2004 1964                      nr_resp->NodeInfo.PortGUID;
2005 1965                  node_info_p->n_dev_id =
2006 1966                      nr_resp->NodeInfo.DeviceID;
2007 1967                  node_info_p->n_revision =
2008 1968                      nr_resp->NodeInfo.Revision;
2009 1969                  node_info_p->n_vendor_id =
2010 1970                      nr_resp->NodeInfo.VendorID;
2011 1971                  node_info_p->n_num_ports =
2012 1972                      nr_resp->NodeInfo.NumPorts;
2013 1973                  node_info_p->n_port_num =
2014 1974                      nr_resp->NodeInfo.LocalPortNum;
2015 1975                  node_info_p->n_node_type =
2016 1976                      nr_resp->NodeInfo.NodeType;
2017 1977                  (void) strncpy(node_info_p->n_description,
2018 1978                      (char *)&nr_resp->NodeDescription, 64);
2019      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(
2020      -                    *node_info_p))
2021 1979  
2022      -
2023 1980                  kmem_free(nr_resp, len);
2024 1981          }
2025 1982          ibcm_dec_hca_acc_cnt(hcap);
2026 1983          return (IBT_SUCCESS);
2027 1984  }
2028 1985  
2029 1986  /*
2030 1987   * ibcm_ibmf_analyze_error:
2031 1988   *      Checks IBMF status and determines appropriate ibt status.
2032 1989   *
↓ open down ↓ 47 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX