const int tmpsiz = 256; /* 7 %u and 4 LPU64 */
if (write) {
- LNET_LOCK();
- memset(&the_lnet.ln_counters, 0, sizeof(the_lnet.ln_counters));
- LNET_UNLOCK();
- return 0;
+ lnet_counters_reset();
+ return 0;
}
/* read */
return -ENOMEM;
}
- LNET_LOCK();
- *ctrs = the_lnet.ln_counters;
- LNET_UNLOCK();
+ lnet_counters_get(ctrs);
len = snprintf(tmpstr, tmpsiz,
"%u %u %u %u %u %u %u "LPU64" "LPU64" "
int pingsent = !peer->lp_ping_notsent;
int last_ping = cfs_duration_sec(cfs_time_sub(now,
peer->lp_ping_timestamp));
- int down_ni = lnet_router_down_ni(peer,
- LNET_NIDNET(LNET_NID_ANY));
+ int down_ni = 0;
+ lnet_route_t *rtr;
+
+ if (peer->lp_ping_version == LNET_PROTO_PING_VERSION) {
+ cfs_list_for_each_entry(rtr, &peer->lp_routes,
+ lr_gwlist) {
+ /* downis on any route should be the
+ * number of downis on the gateway */
+ if (rtr->lr_downis != 0) {
+ down_ni = rtr->lr_downis;
+ break;
+ }
+ }
+ }
if (deadline == 0)
s += snprintf(s, tmpstr + tmpsiz - s,
"pages", "count", "credits", "min");
LASSERT (tmpstr + tmpsiz - s > 0);
+ if (the_lnet.ln_rtrpools == NULL)
+ goto out; /* I'm not a router */
+
LNET_LOCK();
for (idx = 0; idx < LNET_NRBPOOLS; idx++) {
LNET_UNLOCK();
+ out:
len = s - tmpstr;
if (pos >= min_t(int, len, strlen(tmpstr)))