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_impl.c
          +++ new/usr/src/uts/common/io/ib/mgt/ibcm/ibcm_impl.c
↓ open down ↓ 88 lines elided ↑ open up ↑
  89   89  int                     taskq_dispatch_fail_cnt;
  90   90  
  91   91  kmutex_t                ibcm_mcglist_lock;      /* MCG list lock */
  92   92  kmutex_t                ibcm_trace_mutex;       /* Trace mutex */
  93   93  kmutex_t                ibcm_trace_print_mutex; /* Trace print mutex */
  94   94  int                     ibcm_conn_max_trcnt = IBCM_MAX_CONN_TRCNT;
  95   95  
  96   96  int                     ibcm_enable_trace = 2;  /* Trace level 4 by default */
  97   97  int                     ibcm_dtrace = 0; /* conditionally enable more dtrace */
  98   98  
  99      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_svc_info_lock, ibcm_svc_info_s::{svc_bind_list
 100      -    svc_ref_cnt svc_to_delete}))
 101      -
 102      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_svc_info_lock, ibcm_svc_bind_s::{sbind_link}))
 103      -
 104      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_trace_mutex, ibcm_conn_trace_s))
 105      -
 106      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibcm_conn_trace_s))
 107      -
 108      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_trace_print_mutex, ibcm_debug_buf))
 109      -
 110      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibcm_debug_buf))
 111      -
 112   99  /*
 113  100   * Initial state is INIT. All hca dr's return success immediately in this
 114  101   * state, without adding or deleting any hca's to CM.
 115  102   */
 116  103  ibcm_finit_state_t      ibcm_finit_state = IBCM_FINIT_INIT;
 117  104  
 118  105  /* mutex and cv to manage hca's reference and resource count(s) */
 119  106  kmutex_t                ibcm_global_hca_lock;
 120  107  kcondvar_t              ibcm_global_hca_cv;
 121  108  
 122  109  /* mutex and cv to sa session open */
 123  110  kmutex_t                ibcm_sa_open_lock;
 124  111  kcondvar_t              ibcm_sa_open_cv;
 125  112  int                     ibcm_sa_timeout_delay = 1;              /* in ticks */
 126      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_sa_open_lock,
 127      -    ibcm_port_info_s::{port_ibmf_saa_hdl port_saa_open_in_progress}))
 128  113  
 129      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibcm_port_info_s::{port_ibmf_saa_hdl}))
 130      -
 131  114  /* serialize sm notice callbacks */
 132  115  kmutex_t                ibcm_sm_notice_serialize_lock;
 133  116  
 134      -_NOTE(LOCK_ORDER(ibcm_sm_notice_serialize_lock ibcm_global_hca_lock))
 135      -
 136      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_global_hca_lock, ibcm_hca_info_s::{hca_state
 137      -    hca_svc_cnt hca_acc_cnt hca_res_cnt hca_next}))
 138      -
 139      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_global_hca_lock,
 140      -    ibcm_port_info_s::{port_ibmf_hdl}))
 141      -
 142      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_sm_notice_serialize_lock,
 143      -    ibcm_port_info_s::{port_event_status}))
 144      -
 145      -_NOTE(DATA_READABLE_WITHOUT_LOCK(ibcm_hca_info_s::{hca_state}))
 146      -_NOTE(DATA_READABLE_WITHOUT_LOCK(
 147      -    ibcm_hca_info_s::{hca_port_info.port_ibmf_hdl}))
 148      -
 149  117  /* mutex for CM's qp list management */
 150  118  kmutex_t                ibcm_qp_list_lock;
 151  119  
 152      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_qp_list_lock, ibcm_port_info_s::{port_qplist}))
 153      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_qp_list_lock, ibcm_qp_list_s))
 154      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_qp_list_lock, ibcm_qp_list_s))
 155      -
 156  120  kcondvar_t              ibcm_timeout_list_cv;
 157  121  kcondvar_t              ibcm_timeout_thread_done_cv;
 158  122  kt_did_t                ibcm_timeout_thread_did;
 159  123  ibcm_state_data_t       *ibcm_timeout_list_hdr, *ibcm_timeout_list_tail;
 160  124  ibcm_ud_state_data_t    *ibcm_ud_timeout_list_hdr, *ibcm_ud_timeout_list_tail;
 161  125  kmutex_t                ibcm_timeout_list_lock;
 162  126  uint8_t                 ibcm_timeout_list_flags = 0;
 163  127  pri_t                   ibcm_timeout_thread_pri = MINCLSYSPRI;
 164  128  
 165      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_timeout_list_lock,
 166      -    ibcm_state_data_s::timeout_next))
 167      -
 168      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_timeout_list_lock,
 169      -    ibcm_ud_state_data_s::ud_timeout_next))
 170      -
 171  129  /*
 172  130   * Flow control logic for open_rc_channel uses the following.
 173  131   */
 174  132  
 175  133  struct ibcm_open_s {
 176  134          kmutex_t                mutex;
 177  135          kcondvar_t              cv;
 178  136          uint8_t                 task_running;
 179  137          uint_t                  queued;
 180  138          uint_t                  exit_deferred;
↓ open down ↓ 169 lines elided ↑ open up ↑
 350  308          "OUTGOING_REQ_RETRY         ",
 351  309          "OUTGOING_REP_RETRY         ",
 352  310          "OUTGOING_LAP_RETRY         ",
 353  311          "OUTGOING_MRA_RETRY         ",
 354  312          "OUTGOING_DREQ_RETRY        ",
 355  313          "NEVER SEE THIS             "
 356  314  };
 357  315  
 358  316  char    ibcm_debug_buf[IBCM_DEBUG_BUF_SIZE];
 359  317  
 360      -_NOTE(SCHEME_PROTECTS_DATA("used in a localized function consistently",
 361      -    ibcm_debug_buf))
 362      -_NOTE(READ_ONLY_DATA(ibcm_taskq))
 363      -
 364      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_timeout_list_lock, ibcm_timeout_list_flags))
 365      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_timeout_list_lock, ibcm_timeout_list_hdr))
 366      -_NOTE(MUTEX_PROTECTS_DATA(ibcm_timeout_list_lock, ibcm_ud_timeout_list_hdr))
 367      -
 368  318  #ifdef DEBUG
 369  319  int             ibcm_test_mode = 0;     /* set to 1, if running tests */
 370  320  #endif
 371  321  
 372  322  
 373  323  /* Module Driver Info */
 374  324  static struct modlmisc ibcm_modlmisc = {
 375  325          &mod_miscops,
 376  326          "IB Communication Manager"
 377  327  };
↓ open down ↓ 139 lines elided ↑ open up ↑
 517  467          avl_destroy(&ibcm_svc_avl_tree);
 518  468  
 519  469          IBTF_DPRINTF_L5(cmlog, "ibcm_fini_locks: done");
 520  470  }
 521  471  
 522  472  
 523  473  /* Initialize CM's classport info */
 524  474  static void
 525  475  ibcm_init_classportinfo()
 526  476  {
 527      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_clpinfo));
 528      -
 529  477          ibcm_clpinfo.BaseVersion = IBCM_MAD_BASE_VERSION;
 530  478          ibcm_clpinfo.ClassVersion = IBCM_MAD_CLASS_VERSION;
 531  479  
 532  480          /* For now, CM supports same capabilities at all ports */
 533  481          ibcm_clpinfo.CapabilityMask =
 534  482              h2b16(IBCM_CPINFO_CAP_RC | IBCM_CPINFO_CAP_SIDR);
 535  483  
 536  484          /* Bits 0-7 are all 0 for Communication Mgmt Class */
 537  485  
 538  486          /* For now, CM has the same respvalue at all ports */
 539  487          ibcm_clpinfo.RespTimeValue_plus =
 540  488              h2b32(ibt_usec2ib(ibcm_local_processing_time) & 0x1f);
 541  489  
 542  490          /* For now, redirect fields are set to 0 */
 543  491          /* Trap fields are not applicable to CM, hence set to 0 */
 544  492  
 545      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_clpinfo));
 546  493          IBTF_DPRINTF_L5(cmlog, "ibcm_init_classportinfo: done");
 547  494  }
 548  495  
 549  496  /*
 550  497   * ibcm_init():
 551  498   *      - call ibt_attach()
 552  499   *      - create AVL trees
 553  500   *      - Attach HCA handlers that are already present before
 554  501   *      CM got loaded.
 555  502   *
↓ open down ↓ 21 lines elided ↑ open up ↑
 577  524  
 578  525          if (ibcm_ar_init() != IBCM_SUCCESS) {
 579  526                  IBTF_DPRINTF_L1(cmlog, "ibcm_init: "
 580  527                      "fatal error: ibcm_ar_init() failed");
 581  528                  ibcm_fini_ids();
 582  529                  ibcm_fini_locks();
 583  530                  return (IBCM_FAILURE);
 584  531          }
 585  532          ibcm_rc_flow_control_init();
 586  533  
 587      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_taskq))
 588  534          ibcm_taskq = system_taskq;
 589      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_taskq))
 590  535  
 591      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_timeout_list_flags))
 592      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_timeout_thread_did))
 593      -
 594  536          /* Start the timeout list processing thread */
 595  537          ibcm_timeout_list_flags = 0;
 596  538          t = thread_create(NULL, 0, ibcm_process_tlist, 0, 0, &p0, TS_RUN,
 597  539              ibcm_timeout_thread_pri);
 598  540          ibcm_timeout_thread_did = t->t_did;
 599  541  
 600      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_timeout_list_flags))
 601      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_timeout_thread_did))
 602      -
 603  542          /*
 604  543           * NOTE : if ibt_attach is done after ibcm_init_hcas, then some
 605  544           * HCA DR events may be lost. CM could call re-init hca list
 606  545           * again, but it is more complicated. Some HCA's DR's lost may
 607  546           * be HCA detach, which makes hca list re-syncing and locking more
 608  547           * complex
 609  548           */
 610  549          status = ibt_attach(&ibcm_ibt_modinfo, NULL, NULL, &ibcm_ibt_handle);
 611  550          if (status != IBT_SUCCESS) {
 612  551                  IBTF_DPRINTF_L2(cmlog, "ibcm_init(): ibt_attach failed %d",
↓ open down ↓ 105 lines elided ↑ open up ↑
 718  657                  ibcm_init_hcas();
 719  658                  /* and then enable the HCA asyncs */
 720  659                  ibcm_finit_state = IBCM_FINIT_IDLE;
 721  660                  mutex_exit(&ibcm_global_hca_lock);
 722  661                  if (ibcm_ar_init() != IBCM_SUCCESS) {
 723  662                          IBTF_DPRINTF_L1(cmlog, "ibcm_fini:ibcm_ar_init failed");
 724  663                  }
 725  664                  return (IBCM_FAILURE);
 726  665          }
 727  666  
 728      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_timeout_list_hdr))
 729      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibcm_ud_timeout_list_hdr))
 730      -
 731  667          ASSERT(ibcm_timeout_list_hdr == NULL);
 732  668          ASSERT(ibcm_ud_timeout_list_hdr == NULL);
 733  669  
 734      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_timeout_list_hdr))
 735      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibcm_ud_timeout_list_hdr))
 736      -
 737  670          /* Release any pending asyncs on ibcm_global_hca_lock */
 738  671          ibcm_finit_state = IBCM_FINIT_SUCCESS;
 739  672          mutex_exit(&ibcm_global_hca_lock);
 740  673  
 741  674          ibcm_stop_timeout_thread();
 742  675  
 743  676          ibtl_cm_set_node_info_cb(NULL);
 744  677          /*
 745  678           * Detach from IBTL. Waits until all pending asyncs are complete.
 746  679           * Above cv_broadcast wakes up any waiting hca attach/detach asyncs
↓ open down ↓ 79 lines elided ↑ open up ↑
 826  759          int                     i;
 827  760          ibt_status_t            status;
 828  761          uint8_t                 nports = 0;
 829  762          ibcm_hca_info_t         *hcap;
 830  763          ibt_hca_attr_t          hca_attrs;
 831  764  
 832  765          IBTF_DPRINTF_L3(cmlog, "ibcm_hca_attach: guid = 0x%llX", hcaguid);
 833  766  
 834  767          ASSERT(MUTEX_HELD(&ibcm_global_hca_lock));
 835  768  
 836      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*hcap))
 837      -
 838  769          status = ibt_query_hca_byguid(hcaguid, &hca_attrs);
 839  770          if (status != IBT_SUCCESS) {
 840  771                  IBTF_DPRINTF_L2(cmlog, "ibcm_hca_attach: "
 841  772                      "ibt_query_hca_byguid failed = %d", status);
 842  773                  return;
 843  774          }
 844  775          nports = hca_attrs.hca_nports;
 845  776  
 846  777          IBTF_DPRINTF_L4(cmlog, "ibcm_hca_attach: num ports = %x", nports);
 847  778  
↓ open down ↓ 48 lines elided ↑ open up ↑
 896  827              ibcm_passive_comid_node_compare,
 897  828              sizeof (ibcm_state_data_t),
 898  829              offsetof(struct ibcm_state_data_s, avl_passive_comid_link));
 899  830  
 900  831          /*
 901  832           * Mark the state of the HCA to "attach" only at the end
 902  833           * Now CM starts accepting incoming MADs and client API calls
 903  834           */
 904  835          hcap->hca_state = IBCM_HCA_ACTIVE;
 905  836  
 906      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*hcap))
 907      -
 908  837          IBTF_DPRINTF_L3(cmlog, "ibcm_hca_attach: ATTACH Done");
 909  838  }
 910  839  
 911  840  /*
 912  841   * ibcm_hca_detach():
 913  842   *      Called as an asynchronous event to notify CM of a detach of HCA.
 914  843   *      Here ibcm_hca_info_t is freed up and all fields that
 915  844   *      were initialized earlier are cleaned up
 916  845   *
 917  846   * Arguments: (WILL CHANGE BASED ON ASYNC EVENT CODE)
↓ open down ↓ 1107 lines elided ↑ open up ↑
2025 1954  
2026 1955          saa_handle = portp->port_ibmf_saa_hdl;
2027 1956          if (saa_handle != NULL) {
2028 1957                  mutex_exit(&ibcm_sa_open_lock);
2029 1958                  return;
2030 1959          }
2031 1960  
2032 1961          portp->port_saa_open_in_progress = 1;
2033 1962          mutex_exit(&ibcm_sa_open_lock);
2034 1963  
2035      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(portp->port_event_status))
2036      -
2037 1964          /* The assumption is that we're getting event notifications */
2038 1965          portp->port_event_status = IBMF_SAA_EVENT_STATUS_MASK_PRODUCER_SM;
2039 1966  
2040      -        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(portp->port_event_status))
2041      -
2042 1967          ibt_status = ibt_get_port_state_byguid(portp->port_hcap->hca_guid,
2043 1968              portp->port_num, &portp->port_sgid0, NULL);
2044 1969          if (ibt_status != IBT_SUCCESS) {
2045 1970                  IBTF_DPRINTF_L2(cmlog, "ibcm_init_saa_handle: "
2046 1971                      "ibt_get_port_state_byguid failed for guid %llX "
2047 1972                      "with status %d", portp->port_hcap->hca_guid, ibt_status);
2048 1973                  mutex_enter(&ibcm_sa_open_lock);
2049 1974                  portp->port_saa_open_in_progress = 0;
2050 1975                  cv_broadcast(&ibcm_sa_open_cv);
2051 1976                  mutex_exit(&ibcm_sa_open_lock);
↓ open down ↓ 69 lines elided ↑ open up ↑
2121 2046  ibcm_hca_init_port(ibcm_hca_info_t *hcap, uint8_t port_index)
2122 2047  {
2123 2048          int                     status;
2124 2049          ibmf_register_info_t    *ibmf_reg;
2125 2050  
2126 2051          IBTF_DPRINTF_L4(cmlog, "ibcm_hca_init_port: hcap = 0x%p port_num %d",
2127 2052              hcap, port_index + 1);
2128 2053  
2129 2054          ASSERT(MUTEX_HELD(&ibcm_global_hca_lock));
2130 2055  
2131      -        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(hcap->hca_port_info))
2132      -
2133 2056          if (hcap->hca_port_info[port_index].port_ibmf_hdl == NULL) {
2134 2057                  /* Register with IBMF */
2135 2058                  ibmf_reg = &hcap->hca_port_info[port_index].port_ibmf_reg;
2136 2059                  ibmf_reg->ir_ci_guid = hcap->hca_guid;
2137 2060                  ibmf_reg->ir_port_num = port_index + 1;
2138 2061                  ibmf_reg->ir_client_class = COMM_MGT_MANAGER_AGENT;
2139 2062  
2140 2063                  /*
2141 2064                   * register with management framework
2142 2065                   */
↓ open down ↓ 266 lines elided ↑ open up ↑
2409 2332  
2410 2333          switch (code) {
2411 2334          case IBT_PORT_CHANGE_EVENT:
2412 2335                  if ((eventp->ev_port_flags & IBT_PORT_CHANGE_SM_LID) == 0)
2413 2336                          break;
2414 2337          /* FALLTHROUGH */
2415 2338          case IBT_CLNT_REREG_EVENT:
2416 2339          case IBT_EVENT_PORT_UP:
2417 2340                  mutex_exit(&ibcm_global_hca_lock);
2418 2341                  pup = kmem_alloc(sizeof (ibcm_port_up_t), KM_SLEEP);
2419      -                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pup))
2420 2342                  pup->pup_hca_guid = eventp->ev_hca_guid;
2421 2343                  pup->pup_port = eventp->ev_port;
2422      -                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*pup))
2423 2344                  (void) taskq_dispatch(ibcm_taskq,
2424 2345                      ibcm_service_record_rewrite_task, pup, TQ_SLEEP);
2425 2346                  ibcm_path_cache_purge();
2426 2347                  return;
2427 2348  
2428 2349          case IBT_HCA_ATTACH_EVENT:
2429 2350  
2430 2351                  /* eventp->ev_hcaguid is the HCA GUID of interest */
2431 2352                  ibcm_hca_attach(eventp->ev_hca_guid);
2432 2353                  break;
↓ open down ↓ 27 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX