@@ -350,7 +350,7 @@ struct lnet_net *
spin_lock_init(&net->net_lock);
net->net_id = net_id;
- net->net_last_alive = ktime_get_real_seconds();
+ net->net_last_alive = ktime_get_seconds();
net->net_sel_priority = LNET_MAX_SELECTION_PRIORITY;
@@ -4250,6 +4250,7 @@ void lnet_monitor_thr_stop(void)
u32 type;
int rc = 0;
int cpt;
+ time64_t now = ktime_get_seconds();
LASSERT(!in_interrupt());
@@ -4301,11 +4302,18 @@ void lnet_monitor_thr_stop(void)
return -EPROTO;
}
- if (the_lnet.ln_routing &&
- ni->ni_net->net_last_alive != ktime_get_real_seconds()) {
+ /* Only update net_last_alive for incoming GETs on the reserved portal
+ * (i.e. incoming lnet/discovery pings).
+ * This avoids situations where the router's own traffic results in NI
+ * status changes
+ */
+ if (the_lnet.ln_routing && type == LNET_MSG_GET &&
+ hdr->msg.get.ptl_index == LNET_RESERVED_PORTAL &&
+ !lnet_islocalnid(&src_nid) &&
+ ni->ni_net->net_last_alive != now) {
lnet_ni_lock(ni);
spin_lock(&ni->ni_net->net_lock);
- ni->ni_net->net_last_alive = ktime_get_real_seconds();
+ ni->ni_net->net_last_alive = now;
spin_unlock(&ni->ni_net->net_lock);
push = lnet_ni_set_status_locked(ni, LNET_NI_STATUS_UP);
lnet_ni_unlock(ni);
@@ -4480,7 +4488,7 @@ void lnet_monitor_thr_stop(void)
}
}
- lpni->lpni_last_alive = ktime_get_seconds();
+ lpni->lpni_last_alive = now;
msg->msg_rxpeer = lpni;
msg->msg_rxni = ni;
@@ -1044,7 +1044,7 @@ int lnet_get_rtr_pool_cfg(int cpt, struct lnet_ioctl_pool_cfg *pool_cfg)
timeout = router_ping_timeout + alive_router_check_interval;
- now = ktime_get_real_seconds();
+ now = ktime_get_seconds();
list_for_each_entry(net, &the_lnet.ln_nets, net_list) {
if (net->net_lnd->lnd_type == LOLND)
continue;
@@ -663,7 +663,7 @@ static int proc_lnet_nis(struct ctl_table *table, int write,
if (ni) {
struct lnet_tx_queue *tq;
char *stat;
- time64_t now = ktime_get_real_seconds();
+ time64_t now = ktime_get_seconds();
time64_t last_alive = -1;
int i;
int j;