- format and style updates; avoid 64bit division on 32bit systems.
int lnet_peers_start_down(void);
int lnet_peer_buffer_credits(lnet_ni_t *ni);
-extern int router_ping_timeout;
-extern int dead_router_check_interval;
-extern int live_router_check_interval;
int lnet_router_checker_start(void);
void lnet_router_checker_stop(void);
void lnet_swap_pinginfo(lnet_ping_info_t *info);
if ((umd->options & (LNET_MD_KIOV | LNET_MD_IOVEC)) != 0 &&
umd->length > LNET_MAX_IOV) {
- CERROR("Invalid option: too many fragments %d, %d max\n",
+ CERROR("Invalid option: too many fragments %u, %d max\n",
umd->length, LNET_MAX_IOV);
return -EINVAL;
}
CFS_MODULE_PARM(avoid_asym_router_failure, "i", int, 0444,
"Avoid asymmetrical failures: reserved, use at your own risk");
-int dead_router_check_interval = 0;
+static int dead_router_check_interval = 0;
CFS_MODULE_PARM(dead_router_check_interval, "i", int, 0444,
"Seconds between dead router health checks (<= 0 to disable)");
-int live_router_check_interval = 0;
+static int live_router_check_interval = 0;
CFS_MODULE_PARM(live_router_check_interval, "i", int, 0444,
"Seconds between live router health checks (<= 0 to disable)");
-int router_ping_timeout = 50;
+static int router_ping_timeout = 50;
CFS_MODULE_PARM(router_ping_timeout, "i", int, 0444,
"Seconds to wait for the reply to a router health query");
/* FIXME use Lustre random function when it's moved to libcfs.
* See bug 18751 */
/* len+1 positions to add a new entry, also prevents division by 0 */
- offset = lnet_create_interface_cookie() % (len + 1);
+ offset = ((unsigned int) lnet_create_interface_cookie()) % (len + 1);
list_for_each (e, &rnet->lrn_routes) {
if (offset == 0)
break;
int alive_cnt = peer->lp_alive_count;
int alive = peer->lp_alive;
int pingsent = !peer->lp_ping_notsent;
- int last_ping = cfs_duration_sec(now - peer->lp_ping_timestamp);
- int down_ni = lnet_router_down_ni(peer, LNET_NIDNET(LNET_NID_ANY));
+ 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));
if (deadline == 0)
s += snprintf(s, tmpstr + tmpsiz - s,
nrefs, nrtrrefs, alive_cnt,
alive ? "up" : "down", last_ping,
pingsent,
- cfs_duration_sec(deadline - now),
+ cfs_duration_sec(cfs_time_sub(deadline, now)),
down_ni, libcfs_nid2str(nid));
LASSERT (tmpstr + tmpsiz - s > 0);
}
if (ni != NULL) {
cfs_time_t now = cfs_time_current();
+ int last_alive = -1;
int maxtxcr = ni->ni_maxtxcredits;
int txcr = ni->ni_txcredits;
int mintxcr = ni->ni_mintxcredits;
int npeerrtrcr = ni->ni_peerrtrcredits;
lnet_nid_t nid = ni->ni_nid;
int nref = ni->ni_refcount;
- int last_alive;
char *stat;
- last_alive = (the_lnet.ln_routing) ?
- cfs_duration_sec(now - ni->ni_last_alive) : -1;
+ if (the_lnet.ln_routing)
+ last_alive = cfs_duration_sec(cfs_time_sub(now,
+ ni->ni_last_alive));
if (ni->ni_lnd->lnd_type == LOLND) /* @lo forever alive */
last_alive = 0;