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

@@ -67,13 +67,10 @@
 #endif /* DEBUG */
 static int daplka_dbgsize = sizeof (daplka_dbgbuf);
 static size_t daplka_dbgnext;
 static int daplka_dbginit = 0;
 static kmutex_t daplka_dbglock;
-_NOTE(MUTEX_PROTECTS_DATA(daplka_dbglock,
-    daplka_dbgbuf
-    daplka_dbgnext))
 
 static int daplka_dbg = 0x0103;
 static void daplka_console(const char *, ...);
 static void daplka_debug(const char *, ...);
 static int daplka_apm = 0x1;                    /* default enable */

@@ -557,12 +554,10 @@
  * shared MR avl tree
  */
 static avl_tree_t daplka_shared_mr_tree;
 static kmutex_t daplka_shared_mr_lock;
 static int daplka_shared_mr_cmp(const void *, const void *);
-_NOTE(MUTEX_PROTECTS_DATA(daplka_shared_mr_lock,
-    daplka_shared_mr_tree))
 
 /*
  * default kmem flags used by this driver
  */
 static int daplka_km_flags = KM_SLEEP;

@@ -2210,15 +2205,13 @@
         /*
          * calculate checksum value of hello message and
          * put hello message in networking byte order
          */
         dp = (DAPL_PRIVATE *)priv_data;
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*dp))
         dp->hello_msg.hi_port = htons(dp->hello_msg.hi_port);
         dp->hello_msg.hi_checksum = 0;
         dp->hello_msg.hi_checksum = htons(daplka_hellomsg_cksum(dp));
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*dp))
 
         if (args.epc_timeout > 0) {
                 /*
                  * increment refcnt before passing reference to
                  * timer_info_alloc.

@@ -2604,11 +2597,10 @@
                 DERR("evd_create: invalid flags 0x%x\n", args.evd_flags);
                 return (EINVAL);
         }
 
         evd_rp = kmem_zalloc(sizeof (daplka_evd_resource_t), daplka_km_flags);
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*evd_rp))
         DAPLKA_RS_INIT(evd_rp, DAPL_TYPE_EVD,
             DAPLKA_RS_RNUM(ia_rp), daplka_evd_destroy);
 
         mutex_init(&evd_rp->evd_lock, NULL, MUTEX_DRIVER, NULL);
         cv_init(&evd_rp->evd_cv, NULL, CV_DRIVER, NULL);

@@ -2692,11 +2684,10 @@
         if (retval != 0) {
                 DERR("evd_ceate: cannot insert evd %d\n", retval);
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*evd_rp))
 
         /*
          * If this evd handles async events need to add to the IA resource
          * async evd list
          */

@@ -3486,11 +3477,10 @@
         daplka_evd_resource_t   *evd_rp = (daplka_evd_resource_t *)gen_rp;
         ibt_status_t            status;
         daplka_evd_event_t      *evt;
         ibt_priv_data_len_t     len;
 
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*evd_rp))
         D3("evd_destroy: entering, evd_rp 0x%p, rnum %d\n",
             evd_rp, DAPLKA_RS_RNUM(evd_rp));
         /*
          * free CQ
          */

@@ -3711,11 +3701,10 @@
         cno_rp = kmem_zalloc(sizeof (*cno_rp), daplka_km_flags);
         if (cno_rp == NULL) {
                 DERR("cno_alloc: cannot allocate cno resource\n");
                 return (ENOMEM);
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cno_rp))
         DAPLKA_RS_INIT(cno_rp, DAPL_TYPE_CNO,
             DAPLKA_RS_RNUM(ia_rp), daplka_cno_destroy);
 
         mutex_init(&cno_rp->cno_lock, NULL, MUTEX_DRIVER, NULL);
         cv_init(&cno_rp->cno_cv, NULL, CV_DRIVER, NULL);

@@ -3727,11 +3716,10 @@
         if (retval != 0) {
                 DERR("cno_alloc: cannot insert cno resource\n");
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*cno_rp))
 
         /* return hkey to library */
         args.cno_hkey = cno_hkey;
 
         retval = ddi_copyout(&args, (void *)arg, sizeof (dapl_cno_alloc_t),

@@ -4196,11 +4184,10 @@
  */
 typedef struct daplka_sp_match_s {
         uint64_t                spm_conn_qual;
         daplka_sp_resource_t    *spm_sp_rp;
 } daplka_sp_match_t;
-_NOTE(SCHEME_PROTECTS_DATA("daplka", daplka_sp_match_s::spm_sp_rp))
 
 static int
 daplka_sp_match(void *objp, void *arg)
 {
         daplka_sp_resource_t    *sp_rp = (daplka_sp_resource_t *)objp;

@@ -4589,11 +4576,10 @@
         mr_rp = kmem_zalloc(sizeof (daplka_mr_resource_t), daplka_km_flags);
         if (mr_rp == NULL) {
                 DERR("mr_register: cannot allocate mr resource\n");
                 return (ENOMEM);
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
         DAPLKA_RS_INIT(mr_rp, DAPL_TYPE_MR,
             DAPLKA_RS_RNUM(ia_rp), daplka_mr_destroy);
 
         mutex_init(&mr_rp->mr_lock, NULL, MUTEX_DRIVER, NULL);
         mr_rp->mr_hca = ia_rp->ia_hca;

@@ -4657,11 +4643,10 @@
         if (retval != 0) {
                 DERR("mr_register: cannot insert mr resource into mr_htbl\n");
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mr_rp))
 
         args.mr_lkey = mr_rp->mr_desc.md_lkey;
         args.mr_rkey = mr_rp->mr_desc.md_rkey;
         args.mr_hkey = mr_hkey;
 

@@ -4791,27 +4776,24 @@
                 if (smrp == NULL) {
                         retval = ENOMEM;
                         mutex_exit(&daplka_shared_mr_lock);
                         goto cleanup;
                 }
-                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*smrp))
                 smrp->smr_refcnt = 1;
                 smrp->smr_cookie = args.mrs_shm_cookie;
                 smrp->smr_state = DAPLKA_SMR_TRANSITIONING;
                 smrp->smr_mr_list = NULL;
                 cv_init(&smrp->smr_cv, NULL, CV_DRIVER, NULL);
                 avl_insert(&daplka_shared_mr_tree, smrp, where);
-                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*smrp))
         }
         mutex_exit(&daplka_shared_mr_lock);
 
         mr_rp = kmem_zalloc(sizeof (daplka_mr_resource_t), daplka_km_flags);
         if (mr_rp == NULL) {
                 DERR("mr_register_shared: cannot allocate mr resource\n");
                 goto cleanup;
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
         DAPLKA_RS_INIT(mr_rp, DAPL_TYPE_MR,
             DAPLKA_RS_RNUM(ia_rp), daplka_mr_destroy);
 
         mutex_init(&mr_rp->mr_lock, NULL, MUTEX_DRIVER, NULL);
         mr_rp->mr_hca = ia_rp->ia_hca;

@@ -4921,11 +4903,10 @@
         if (retval != 0) {
                 DERR("mr_register_shared: cannot insert mr resource\n");
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mr_rp))
 
         /*
          * at this point, there are two references to our mr resource.
          * one is kept in ia_mr_htbl. the other is kept in the list
          * within this shared mr object (smrp). when we deregister this

@@ -4976,17 +4957,15 @@
                 smrp->smr_refcnt--;
 
                 if (smrp->smr_refcnt == 0) {
                         DERR("mr_register_shared: freeing smrp 0x%p\n", smrp);
                         avl_remove(&daplka_shared_mr_tree, smrp);
-                        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*smrp))
                         if (smrp->smr_mr_list != NULL) {
                                 /*
                                  * the refcnt is 0. if there is anything
                                  * left on the list, it must be ours.
                                  */
-                                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
                                 ASSERT(smrp->smr_mr_list == mr_rp);
                                 DAPLKA_RS_UNREF(mr_rp);
                                 smrp->smr_mr_list = NULL;
                                 ASSERT(mr_rp->mr_shared_mr == smrp);
                                 mr_rp->mr_shared_mr = NULL;

@@ -5004,11 +4983,10 @@
                                 daplka_mr_resource_t    **mpp;
 
                                 /*
                                  * search and remove mr_rp from smr_mr_list
                                  */
-                                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
                                 mpp = &smrp->smr_mr_list;
                                 while (*mpp != NULL) {
                                         if (*mpp == mr_rp) {
                                                 *mpp = (*mpp)->mr_next;
                                                 DAPLKA_RS_UNREF(mr_rp);

@@ -5076,11 +5054,10 @@
         if (mr_rp == NULL) {
                 DERR("mr_register_lmr: cannot allocate mr resource\n");
                 retval = ENOMEM;
                 goto cleanup;
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
         DAPLKA_RS_INIT(mr_rp, DAPL_TYPE_MR,
             DAPLKA_RS_RNUM(ia_rp), daplka_mr_destroy);
 
         mutex_init(&mr_rp->mr_lock, NULL, MUTEX_DRIVER, NULL);
         mr_rp->mr_hca = ia_rp->ia_hca;

@@ -5134,11 +5111,10 @@
         if (retval != 0) {
                 DERR("mr_register: cannot insert mr resource into mr_htbl\n");
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mr_rp))
 
         args.mrl_lkey = mr_rp->mr_desc.md_lkey;
         args.mrl_rkey = mr_rp->mr_desc.md_rkey;
         args.mrl_hkey = mr_hkey;
 

@@ -5365,11 +5341,10 @@
 daplka_mr_destroy(daplka_resource_t *gen_rp)
 {
         daplka_mr_resource_t    *mr_rp = (daplka_mr_resource_t *)gen_rp;
         ibt_status_t            status;
 
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
         ASSERT(DAPLKA_RS_REFCNT(mr_rp) == 0);
         ASSERT(mr_rp->mr_shared_mr == NULL);
         D3("mr_destroy: entering, mr_rp 0x%p, rnum %d\n",
             mr_rp, DAPLKA_RS_RNUM(mr_rp));
 

@@ -5457,11 +5432,10 @@
         pd_rp = kmem_zalloc(sizeof (*pd_rp), daplka_km_flags);
         if (pd_rp == NULL) {
                 DERR("pd_alloc: cannot allocate pd resource\n");
                 return (ENOMEM);
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pd_rp))
         DAPLKA_RS_INIT(pd_rp, DAPL_TYPE_PD,
             DAPLKA_RS_RNUM(ia_rp), daplka_pd_destroy);
 
         pd_rp->pd_hca = ia_rp->ia_hca;
         pd_rp->pd_hca_hdl = ia_rp->ia_hca_hdl;

@@ -5480,11 +5454,10 @@
         if (retval != 0) {
                 DERR("pd_alloc: cannot insert pd resource into pd_htbl\n");
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*pd_rp))
 
         /* return hkey to library */
         args.pda_hkey = pd_hkey;
 
         retval = ddi_copyout(&args, (void *)arg, sizeof (dapl_pd_alloc_t),

@@ -5523,11 +5496,10 @@
 daplka_pd_destroy(daplka_resource_t *gen_rp)
 {
         daplka_pd_resource_t *pd_rp = (daplka_pd_resource_t *)gen_rp;
         ibt_status_t status;
 
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pd_rp))
         ASSERT(DAPLKA_RS_REFCNT(pd_rp) == 0);
         D3("pd_destroy: entering, pd_rp %p, rnum %d\n",
             pd_rp, DAPLKA_RS_RNUM(pd_rp));
 
         ASSERT(DAPLKA_RS_TYPE(pd_rp) == DAPL_TYPE_PD);

@@ -5615,11 +5587,10 @@
         mw_rp = kmem_zalloc(sizeof (daplka_mw_resource_t), daplka_km_flags);
         if (mw_rp == NULL) {
                 DERR("mw_alloc: cannot allocate mw resource\n");
                 return (ENOMEM);
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mw_rp))
         DAPLKA_RS_INIT(mw_rp, DAPL_TYPE_MW,
             DAPLKA_RS_RNUM(ia_rp), daplka_mw_destroy);
 
         mutex_init(&mw_rp->mw_lock, NULL, MUTEX_DRIVER, NULL);
         mw_rp->mw_hca = ia_rp->ia_hca;

@@ -5696,11 +5667,10 @@
                 }
                 mutex_exit(&ia_rp->ia_lock);
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mw_rp))
 
         D3("mw_alloc: ibt_alloc_mw mw_hdl(%p) mw_rkey(0x%llx)\n",
             mw_rp->mw_hdl, (longlong_t)mw_rkey);
 
         mutex_enter(&ia_rp->ia_lock);

@@ -5791,11 +5761,10 @@
 daplka_mw_destroy(daplka_resource_t *gen_rp)
 {
         daplka_mw_resource_t    *mw_rp = (daplka_mw_resource_t *)gen_rp;
         ibt_status_t            status;
 
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mw_rp))
         ASSERT(DAPLKA_RS_REFCNT(mw_rp) == 0);
         D3("mw_destroy: entering, mw_rp 0x%p, rnum %d\n",
             mw_rp, DAPLKA_RS_RNUM(mw_rp));
 
         /*

@@ -6201,11 +6170,10 @@
         sp_rp = kmem_zalloc(sizeof (*sp_rp), daplka_km_flags);
         if (sp_rp == NULL) {
                 DERR("service_register: cannot allocate sp resource\n");
                 return (ENOMEM);
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sp_rp))
         DAPLKA_RS_INIT(sp_rp, DAPL_TYPE_SP,
             DAPLKA_RS_RNUM(ia_rp), daplka_sp_destroy);
 
         /* check if evd exists */
         evd_rp = (daplka_evd_resource_t *)

@@ -6295,11 +6263,10 @@
             &sp_rp->sp_global_hkey, (void *)sp_rp);
         if (retval != 0) {
                 DERR("service_register: cannot insert sp resource\n");
                 goto cleanup;
         }
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sp_rp))
 
         /* insert into per-IA sp hash table */
         retval = daplka_hash_insert(&ia_rp->ia_sp_htbl,
             &sp_hkey, (void *)sp_rp);
         if (retval != 0) {

@@ -6423,11 +6390,10 @@
 daplka_sp_destroy(daplka_resource_t *gen_rp)
 {
         daplka_sp_resource_t *sp_rp = (daplka_sp_resource_t *)gen_rp;
         ibt_status_t status;
 
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sp_rp))
         ASSERT(DAPLKA_RS_REFCNT(sp_rp) == 0);
         D3("sp_destroy: entering, sp_rp %p, rnum %d\n",
             sp_rp, DAPLKA_RS_RNUM(sp_rp));
 
         /*

@@ -6581,11 +6547,10 @@
         if (bkl_index == spp->sp_backlog_size) {
                 DERR("service_req: connection pending exceeded %d limit\n",
                     spp->sp_backlog_size);
                 return (IBT_CM_NO_RESOURCE);
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*conn))
 
         /*
          * save data for cr_handoff
          */
         if (pr_data != NULL && pr_len > 0) {

@@ -6669,11 +6634,10 @@
             (longlong_t)cr_ev->ee_cmev.ec_cm_psep_cookie);
 
         daplka_evd_wakeup(spp->sp_evd_res,
             &spp->sp_evd_res->evd_cr_events, cr_ev);
 
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*conn))
         return (IBT_CM_DEFER);
 
 cleanup:;
         /*
          * free the cr event

@@ -6992,11 +6956,10 @@
         }
         /*
          * default is not to return priv data
          */
         if (ret_args != NULL) {
-                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ret_args))
                 ret_args->cm_ret_len = 0;
         }
 
         switch (event->cm_type) {
         case IBT_CM_EVENT_REQ_RCV:

@@ -7421,11 +7384,10 @@
         }
         /*
          * default is not to return priv data
          */
         if (ret_args != NULL) {
-                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ret_args))
                 ret_args->cm_ret_len = 0;
         }
 
         switch (event->cm_type) {
         case IBT_CM_EVENT_REQ_RCV:

@@ -7543,11 +7505,10 @@
         }
         sgid = pinfop->p_sgid_tbl[0];
         ibt_free_portinfo(pinfop, size);
 
         ia_rp = kmem_zalloc(sizeof (daplka_ia_resource_t), daplka_km_flags);
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ia_rp))
         DAPLKA_RS_INIT(ia_rp, DAPL_TYPE_IA, rnum, daplka_ia_destroy);
 
         mutex_init(&ia_rp->ia_lock, NULL, MUTEX_DRIVER, NULL);
         cv_init(&ia_rp->ia_cv, NULL, CV_DRIVER, NULL);
         ia_rp->ia_hca_hdl = hca_hdl;

@@ -7635,11 +7596,10 @@
         if (retval != 0) {
                 DERR("ia_create: cannot insert resource\n");
                 goto cleanup;
         }
         inserted = B_TRUE;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*ia_rp))
 
         args.ia_resnum = rnum;
         retval = copyout(&args, (void *)arg, sizeof (dapl_ia_create_t));
         if (retval != 0) {
                 DERR("ia_create: copyout error %d\n", retval);

@@ -7673,11 +7633,10 @@
         daplka_ia_resource_t    *ia_rp = (daplka_ia_resource_t *)gen_rp;
         daplka_async_evd_hkey_t *hkp;
         int                     cnt;
         ibt_ar_t                ar_s;
 
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ia_rp))
         D3("ia_destroy: entering, ia_rp 0x%p\n", ia_rp);
 
         /* deregister Address Record */
         if (ia_rp->ia_ar_registered) {
                 ar_s.ar_gid = ia_rp->ia_hca_sgid;

@@ -9081,18 +9040,16 @@
  * initializes the global resource table
  */
 static void
 daplka_resource_init(void)
 {
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(daplka_resource))
         rw_init(&daplka_resource.daplka_rct_lock, NULL, RW_DRIVER, NULL);
         daplka_resource.daplka_rc_len = 0;
         daplka_resource.daplka_rc_sz = 0;
         daplka_resource.daplka_rc_cnt = 0;
         daplka_resource.daplka_rc_flag = 0;
         daplka_resource.daplka_rc_root = NULL;
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(daplka_resource))
 }
 
 /*
  * destroys the global resource table
  */

@@ -9427,24 +9384,21 @@
 
         if ((nbuckets & ~(nbuckets - 1)) != nbuckets) {
                 DERR("hash_create: nbuckets not power of 2\n");
                 return (EINVAL);
         }
-        _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*htblp))
 
         htblp->ht_buckets =
             kmem_zalloc(sizeof (daplka_hash_bucket_t) * nbuckets,
             daplka_km_flags);
         if (htblp->ht_buckets == NULL) {
                 DERR("hash_create: cannot allocate buckets\n");
                 return (ENOMEM);
         }
         for (i = 0; i < nbuckets; i++) {
-                _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(htblp->ht_buckets[i]))
                 htblp->ht_buckets[i].hb_count = 0;
                 htblp->ht_buckets[i].hb_entries = NULL;
-                _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(htblp->ht_buckets[i]))
         }
         rw_init(&htblp->ht_table_lock, NULL, RW_DRIVER, NULL);
         mutex_init(&htblp->ht_key_lock, NULL, MUTEX_DRIVER, NULL);
 
         htblp->ht_count = 0;

@@ -9452,11 +9406,10 @@
         htblp->ht_nbuckets = nbuckets;
         htblp->ht_free_func = free_func;
         htblp->ht_lookup_func = lookup_func;
         htblp->ht_initialized = B_TRUE;
         D3("hash_create: done, buckets = %d\n", nbuckets);
-        _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*htblp))
         return (0);
 }
 
 /*
  * daplka_hash_insert:

@@ -9646,11 +9599,10 @@
         daplka_hash_bucket_t *hbp;
         uint32_t bucket, retval = 0;
 
         ASSERT(lockmode == RW_WRITER || lockmode == RW_READER);
 
-        /* needed for warlock */
         if (lockmode == RW_WRITER) {
                 rw_enter(&htblp->ht_table_lock, RW_WRITER);
         } else {
                 rw_enter(&htblp->ht_table_lock, RW_READER);
         }