Print this page
8368 remove warlock leftovers from usr/src/uts
*** 67,79 ****
#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 */
--- 67,76 ----
*** 557,568 ****
* 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;
--- 554,563 ----
*** 2210,2224 ****
/*
* 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.
--- 2205,2217 ----
*** 2604,2614 ****
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);
--- 2597,2606 ----
*** 2692,2702 ****
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
*/
--- 2684,2693 ----
*** 3486,3496 ****
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
*/
--- 3477,3486 ----
*** 3711,3721 ****
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);
--- 3701,3710 ----
*** 3727,3737 ****
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),
--- 3716,3725 ----
*** 4196,4206 ****
*/
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;
--- 4184,4193 ----
*** 4589,4599 ****
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;
--- 4576,4585 ----
*** 4657,4667 ****
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;
--- 4643,4652 ----
*** 4791,4817 ****
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;
--- 4776,4799 ----
*** 4921,4931 ****
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
--- 4903,4912 ----
*** 4976,4992 ****
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;
--- 4957,4971 ----
*** 5004,5014 ****
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);
--- 4983,4992 ----
*** 5076,5086 ****
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;
--- 5054,5063 ----
*** 5134,5144 ****
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;
--- 5111,5120 ----
*** 5365,5375 ****
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));
--- 5341,5350 ----
*** 5457,5467 ****
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;
--- 5432,5441 ----
*** 5480,5490 ****
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),
--- 5454,5463 ----
*** 5523,5533 ****
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);
--- 5496,5505 ----
*** 5615,5625 ****
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;
--- 5587,5596 ----
*** 5696,5706 ****
}
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);
--- 5667,5676 ----
*** 5791,5801 ****
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));
/*
--- 5761,5770 ----
*** 6201,6211 ****
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 *)
--- 6170,6179 ----
*** 6295,6305 ****
&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) {
--- 6263,6272 ----
*** 6423,6433 ****
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));
/*
--- 6390,6399 ----
*** 6581,6591 ****
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) {
--- 6547,6556 ----
*** 6669,6679 ****
(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
--- 6634,6643 ----
*** 6992,7002 ****
}
/*
* 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:
--- 6956,6965 ----
*** 7421,7431 ****
}
/*
* 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:
--- 7384,7393 ----
*** 7543,7553 ****
}
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;
--- 7505,7514 ----
*** 7635,7645 ****
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);
--- 7596,7605 ----
*** 7673,7683 ****
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;
--- 7633,7642 ----
*** 9081,9098 ****
* 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
*/
--- 9040,9055 ----
*** 9427,9450 ****
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;
--- 9384,9404 ----
*** 9452,9462 ****
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:
--- 9406,9415 ----
*** 9646,9656 ****
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);
}
--- 9599,9608 ----