for (i = 0; i < LNET_PEER_HASH_SIZE; i++) {
list_for_each_entry_safe(lp, tmp, &ptable->pt_hash[i],
lp_hashlist) {
- if (ni != NULL && ni != lp->lp_ni)
+ if (ni != NULL && ni->ni_net != lp->lp_net)
continue;
list_del_init(&lp->lp_hashlist);
/* Lose hash table's ref */
for (i = 0; i < LNET_PEER_HASH_SIZE; i++) {
list_for_each_entry_safe(lp, tmp, &ptable->pt_hash[i],
lp_hashlist) {
- if (ni != lp->lp_ni)
+ if (ni->ni_net != lp->lp_net)
continue;
if (lp->lp_rtr_refcount == 0)
LASSERT(ptable->pt_number > 0);
ptable->pt_number--;
- lnet_ni_decref_locked(lp->lp_ni, lp->lp_cpt);
- lp->lp_ni = NULL;
+ lp->lp_net = NULL;
list_add(&lp->lp_hashlist, &ptable->pt_deathrow);
LASSERT(ptable->pt_zombies > 0);
return -ESHUTDOWN;
/* cpt can be LNET_LOCK_EX if it's called from router functions */
- cpt2 = cpt != LNET_LOCK_EX ? cpt : lnet_cpt_of_nid_locked(nid);
+ cpt2 = cpt != LNET_LOCK_EX ? cpt : lnet_cpt_of_nid_locked(nid, NULL);
ptable = the_lnet.ln_peer_tables[cpt2];
lp = lnet_find_peer_locked(ptable, nid);
goto out;
}
- lp->lp_ni = lnet_net2ni_locked(LNET_NIDNET(nid), cpt2);
- if (lp->lp_ni == NULL) {
- rc = -EHOSTUNREACH;
- goto out;
- }
-
+ lp->lp_net = lnet_get_net_locked(LNET_NIDNET(lp->lp_nid));
lp->lp_txcredits =
- lp->lp_mintxcredits = lp->lp_ni->ni_peertxcredits;
+ lp->lp_mintxcredits = lp->lp_net->net_tunables.lct_peer_tx_credits;
lp->lp_rtrcredits =
- lp->lp_minrtrcredits = lnet_peer_buffer_credits(lp->lp_ni);
+ lp->lp_minrtrcredits = lnet_peer_buffer_credits(lp->lp_net);
list_add_tail(&lp->lp_hashlist,
&ptable->pt_hash[lnet_nid2peerhash(nid)]);
int rc;
int cpt;
- cpt = lnet_cpt_of_nid(nid);
+ cpt = lnet_cpt_of_nid(nid, NULL);
lnet_net_lock(cpt);
rc = lnet_nid2peer_locked(&lp, nid, cpt);
CDEBUG(D_WARNING, "%-24s %4d %5s %5d %5d %5d %5d %5d %ld\n",
libcfs_nid2str(lp->lp_nid), lp->lp_refcount,
- aliveness, lp->lp_ni->ni_peertxcredits,
+ aliveness, lp->lp_net->net_tunables.lct_peer_tx_credits,
lp->lp_rtrcredits, lp->lp_minrtrcredits,
lp->lp_txcredits, lp->lp_mintxcredits, lp->lp_txqnob);
*nid = lp->lp_nid;
*refcount = lp->lp_refcount;
- *ni_peer_tx_credits = lp->lp_ni->ni_peertxcredits;
+ *ni_peer_tx_credits =
+ lp->lp_net->net_tunables.lct_peer_tx_credits;
*peer_tx_credits = lp->lp_txcredits;
*peer_rtr_credits = lp->lp_rtrcredits;
*peer_min_rtr_credits = lp->lp_mintxcredits;