cfs_list_del (&ni->ni_list);
the_lnet.ln_nzombie_nis++;
- lnet_ni_decref_locked(ni); /* drop apini's ref */
+ lnet_ni_decref_locked(ni); /* drop ln_nis' ref */
}
/* Drop the cached eqwait NI. */
lnet_clear_peer_table();
LNET_LOCK();
- /* Now wait for the NI's I just nuked to show up on apini_zombie_nis
+ /* Now wait for the NI's I just nuked to show up on ln_zombie_nis
* and shut them down in guaranteed thread context */
i = 2;
while (the_lnet.ln_nzombie_nis != 0) {
#if defined(__KERNEL__) && defined(LNET_ROUTER)
-/* this is really lnet_proc.c */
+/* This is really lnet_proc.c. You might need to update sanity test 215
+ * if any file format is changed. */
static cfs_sysctl_table_header_t *lnet_table_header = NULL;
if (*ppos == 0) {
s += snprintf(s, tmpstr + tmpsiz - s,
- "%-24s %4s %5s %5s %5s %5s %5s %5s %s\n",
- "nid", "refs", "state", "max",
+ "%-24s %4s %5s %5s %5s %5s %5s %5s %5s %s\n",
+ "nid", "refs", "state", "last", "max",
"rtr", "min", "tx", "min", "queue");
LASSERT (tmpstr + tmpsiz - s > 0);
if (skip == 0) {
peer = lp;
- /* minor optimiztion: start from idx+1
+ /* minor optimization: start from idx+1
* on next iteration if we've just
* drained lp_hashlist */
if (lp->lp_hashlist.next ==
if (peer != NULL) {
lnet_nid_t nid = peer->lp_nid;
int nrefs = peer->lp_refcount;
+ int lastalive = -1;
char *aliveness = "NA";
int maxcr = peer->lp_ni->ni_peertxcredits;
int txcr = peer->lp_txcredits;
lnet_peer_aliveness_enabled(peer))
aliveness = peer->lp_alive ? "up" : "down";
+ if (lnet_peer_aliveness_enabled(peer)) {
+ cfs_time_t now = cfs_time_current();
+ cfs_duration_t delta;
+
+ delta = cfs_time_sub(now, peer->lp_last_alive);
+ lastalive = cfs_duration_sec(delta);
+
+ /* No need to mess up peers contents with
+ * arbitrarily long integers - it suffices to
+ * know that lastalive is more than 10000s old
+ */
+ if (lastalive >= 10000)
+ lastalive = 9999;
+ }
+
s += snprintf(s, tmpstr + tmpsiz - s,
- "%-24s %4d %5s %5d %5d %5d %5d %5d %d\n",
+ "%-24s %4d %5s %5d %5d %5d %5d %5d %5d %d\n",
libcfs_nid2str(nid), nrefs, aliveness,
- maxcr, rtrcr, minrtrcr, txcr,
+ lastalive, maxcr, rtrcr, minrtrcr, txcr,
mintxcr, txqnob);
LASSERT (tmpstr + tmpsiz - s > 0);
}
remove_lnet_proc_files "routers"
# /proc/sys/lnet/peers should look like this:
- # nid refs state max rtr min tx min queue
+ # nid refs state last max rtr min tx min queue
# where nid is a string like 192.168.1.1@tcp2, refs > 0,
- # state is up/down/NA, max >= 0. rtr, min, tx, min are
+ # state is up/down/NA, max >= 0. last, rtr, min, tx, min are
# numeric (0 or >0 or <0), queue >= 0.
- L1="^nid +refs +state +max +rtr +min +tx +min +queue$"
- BR="^$NID +$P +(up|down|NA) +$N +$I +$I +$I +$I +$N$"
+ L1="^nid +refs +state +last +max +rtr +min +tx +min +queue$"
+ BR="^$NID +$P +(up|down|NA) +$I +$N +$I +$I +$I +$I +$N$"
create_lnet_proc_files "peers"
check_lnet_proc_entry "peers.out" "/proc/sys/lnet/peers" "$BR" "$L1"
check_lnet_proc_entry "peers.sys" "lnet.peers" "$BR" "$L1"