}
int
-lnet_fail_nid(lnet_nid_t nid, unsigned int threshold)
+lnet_fail_nid(lnet_nid_t nid4, unsigned int threshold)
{
struct lnet_test_peer *tp;
struct list_head *el;
struct list_head *next;
+ struct lnet_nid nid;
LIST_HEAD(cull);
+ lnet_nid4_to_nid(nid4, &nid);
/* NB: use lnet_net_lock(0) to serialize operations on test peers */
if (threshold != 0) {
/* Adding a new entry */
tp = list_entry(el, struct lnet_test_peer, tp_list);
if (tp->tp_threshold == 0 || /* needs culling anyway */
- nid == LNET_NID_ANY || /* removing all entries */
- tp->tp_nid == nid) { /* matched this one */
+ LNET_NID_IS_ANY(&nid) || /* removing all entries */
+ nid_same(&tp->tp_nid, &nid)) { /* matched this one */
list_move(&tp->tp_list, &cull);
}
}
}
static int
-fail_peer (lnet_nid_t nid, int outgoing)
+fail_peer(lnet_nid_t nid4, int outgoing)
{
struct lnet_test_peer *tp;
struct list_head *el;
struct list_head *next;
+ struct lnet_nid nid;
LIST_HEAD(cull);
int fail = 0;
+ lnet_nid4_to_nid(nid4, &nid);
/* NB: use lnet_net_lock(0) to serialize operations on test peers */
lnet_net_lock(0);
continue;
}
- if (tp->tp_nid == LNET_NID_ANY || /* fail every peer */
- nid == tp->tp_nid) { /* fail this peer */
+ if (LNET_NID_IS_ANY(&tp->tp_nid) || /* fail every peer */
+ nid_same(&nid, &tp->tp_nid)) { /* fail this peer */
fail = 1;
if (tp->tp_threshold != LNET_MD_THRESH_INF) {
* local ni and local net so that we pick the next ones
* in Round Robin.
*/
- best_lpni->lpni_seq++;
best_lpni->lpni_peer_net->lpn_seq++;
- best_ni->ni_seq++;
+ best_lpni->lpni_seq = best_lpni->lpni_peer_net->lpn_seq;
best_ni->ni_net->net_seq++;
+ best_ni->ni_seq = best_ni->ni_net->net_seq;
CDEBUG(D_NET, "%s NI seq info: [%d:%d:%d:%u] %s LPNI seq info [%d:%d:%d:%u]\n",
libcfs_nidstr(&best_ni->ni_nid),
rspt = msg->msg_md->md_rspt_ptr;
if (rspt) {
rspt->rspt_next_hop_nid =
- lnet_nid_to_nid4(&msg->msg_txpeer->lpni_nid);
+ msg->msg_txpeer->lpni_nid;
CDEBUG(D_NET, "rspt_next_hop_nid = %s\n",
- libcfs_nid2str(rspt->rspt_next_hop_nid));
+ libcfs_nidstr(&rspt->rspt_next_hop_nid));
}
}
if (ktime_compare(now, rspt->rspt_deadline) >= 0 ||
the_lnet.ln_mt_state == LNET_MT_STATE_SHUTDOWN) {
struct lnet_peer_ni *lpni;
- lnet_nid_t nid;
+ struct lnet_nid nid;
md = lnet_handle2md(&rspt->rspt_mdh);
if (!md) {
CDEBUG(D_NET,
"Response timeout: md = %p: nid = %s\n",
- md, libcfs_nid2str(nid));
+ md, libcfs_nidstr(&nid));
/*
* If there is a timeout on the response
* value so that we don't use it
*/
lnet_net_lock(0);
- lpni = lnet_find_peer_ni_locked(nid);
+ lpni = lnet_peer_ni_find_locked(&nid);
if (lpni) {
lnet_handle_remote_failure_locked(lpni);
lnet_peer_ni_decref_locked(lpni);
return -EPROTO;
}
- if (lnet_islocalnid(dest_nid)) {
+ if (lnet_islocalnid4(dest_nid)) {
/* dest is another local NI; sender should have used
* this node's NID on its own network */
CERROR("%s, src %s: Bad dest nid %s "
cpt);
if (IS_ERR(lpni)) {
lnet_net_unlock(cpt);
- CERROR("%s, src %s: Dropping %s "
- "(error %ld looking up sender)\n",
+ rc = PTR_ERR(lpni);
+ CERROR("%s, src %s: Dropping %s (error %d looking up sender)\n",
libcfs_nid2str(from_nid), libcfs_nid2str(src_nid),
- lnet_msgtyp2str(type), PTR_ERR(lpni));
+ lnet_msgtyp2str(type), rc);
lnet_msg_free(msg);
if (rc == -ESHUTDOWN)
/* We are shutting down. Don't do anything more */
}
}
if (lnet_drop_asym_route && for_me && !found) {
+ /* Drop ref taken by lnet_nid2peerni_locked() */
+ lnet_peer_ni_decref_locked(lpni);
lnet_net_unlock(cpt);
/* we would not use from_nid to route a message to
* src_nid