-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
LASSERT (lnet_peer_aliveness_enabled(lp));
LASSERT (ni->ni_lnd->lnd_query != NULL);
+ LASSERT (the_lnet.ln_routing == 1);
LNET_UNLOCK();
(ni->ni_lnd->lnd_query)(ni, lp->lp_nid, &last_alive);
if (last_alive != 0) /* NI has updated timestamp */
lp->lp_last_alive = last_alive;
- return;
}
/* NB: always called with LNET_LOCK held */
cfs_time_t deadline;
LASSERT (lnet_peer_aliveness_enabled(lp));
+ LASSERT (the_lnet.ln_routing == 1);
/* Trust lnet_notify() if it has more recent aliveness news, but
* ignore the initial assumed death (see lnet_peers_start_down()).
{
cfs_time_t now = cfs_time_current();
+ /* LU-630: only router checks peer health. */
+ if (the_lnet.ln_routing == 0)
+ return 1;
+
if (!lnet_peer_aliveness_enabled(lp))
return -ENODEV;
/* NB 'lp' is always the next hop */
if ((msg->msg_target.pid & LNET_PID_USERFLAG) == 0 &&
lnet_peer_alive_locked(lp) == 0) {
+ the_lnet.ln_counters.drop_count++;
+ the_lnet.ln_counters.drop_length += msg->msg_len;
LNET_UNLOCK();
- CDEBUG(D_NETERROR, "Dropping message for %s: peer not alive\n",
- libcfs_id2str(msg->msg_target));
+ CNETERR("Dropping message for %s: peer not alive\n",
+ libcfs_id2str(msg->msg_target));
if (do_send)
lnet_finalize(ni, msg, -EHOSTUNREACH);
* fairness; everything else being equal... */
cfs_list_del(&best_route->lr_list);
cfs_list_add_tail(&best_route->lr_list, &rnet->lrn_routes);
+ CDEBUG(D_NET, "Best route to %s via %s for %s %d\n",
+ libcfs_nid2str(dst_nid), libcfs_nid2str(lp->lp_nid),
+ lnet_msgtyp2str(msg->msg_type), msg->msg_len);
if (src_ni == NULL) {
src_ni = lp->lp_ni;
/* fall through */
case LNET_MATCHMD_DROP:
- CDEBUG(D_NETERROR,
- "Dropping PUT from %s portal %d match "LPU64
- " offset %d length %d: %d\n",
- libcfs_id2str(src), index,
- hdr->msg.put.match_bits,
- hdr->msg.put.offset, rlength, rc);
+ CNETERR("Dropping PUT from %s portal %d match "LPU64
+ " offset %d length %d: %d\n",
+ libcfs_id2str(src), index,
+ hdr->msg.put.match_bits,
+ hdr->msg.put.offset, rlength, rc);
LNET_UNLOCK();
return ENOENT; /* +ve: OK but no match */
hdr->msg.get.match_bits, msg,
&mlength, &offset, &md);
if (rc == LNET_MATCHMD_DROP) {
- CDEBUG(D_NETERROR,
- "Dropping GET from %s portal %d match "LPU64
- " offset %d length %d\n",
- libcfs_id2str(src),
- hdr->msg.get.ptl_index,
- hdr->msg.get.match_bits,
- hdr->msg.get.src_offset,
- hdr->msg.get.sink_length);
+ CNETERR("Dropping GET from %s portal %d match "LPU64
+ " offset %d length %d\n",
+ libcfs_id2str(src),
+ hdr->msg.get.ptl_index,
+ hdr->msg.get.match_bits,
+ hdr->msg.get.src_offset,
+ hdr->msg.get.sink_length);
LNET_UNLOCK();
return ENOENT; /* +ve: OK but no match */
}
/* NB handles only looked up by creator (no flips) */
md = lnet_wire_handle2md(&hdr->msg.reply.dst_wmd);
if (md == NULL || md->md_threshold == 0 || md->md_me != NULL) {
- CDEBUG(D_NETERROR, "%s: Dropping REPLY from %s for %s "
- "MD "LPX64"."LPX64"\n",
- libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
- (md == NULL) ? "invalid" : "inactive",
- hdr->msg.reply.dst_wmd.wh_interface_cookie,
- hdr->msg.reply.dst_wmd.wh_object_cookie);
+ CNETERR("%s: Dropping REPLY from %s for %s "
+ "MD "LPX64"."LPX64"\n",
+ libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
+ (md == NULL) ? "invalid" : "inactive",
+ hdr->msg.reply.dst_wmd.wh_interface_cookie,
+ hdr->msg.reply.dst_wmd.wh_object_cookie);
if (md != NULL && md->md_me != NULL)
CERROR("REPLY MD also attached to portal %d\n",
md->md_me->me_portal);
if (mlength < rlength &&
(md->md_options & LNET_MD_TRUNCATE) == 0) {
- CDEBUG(D_NETERROR, "%s: Dropping REPLY from %s length %d "
- "for MD "LPX64" would overflow (%d)\n",
- libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
+ CNETERR("%s: Dropping REPLY from %s length %d "
+ "for MD "LPX64" would overflow (%d)\n",
+ libcfs_nid2str(ni->ni_nid), libcfs_id2str(src),
rlength, hdr->msg.reply.dst_wmd.wh_object_cookie,
mlength);
LNET_UNLOCK();