@@ -3840,16 +3840,17 @@ void lnet_monitor_thr_stop(void)
lnet_parse(struct lnet_ni *ni, struct lnet_hdr *hdr, lnet_nid_t from_nid,
void *private, int rdma_req)
{
- int rc = 0;
- int cpt;
- int for_me;
+ struct lnet_peer_ni *lpni;
struct lnet_msg *msg;
+ u32 payload_length;
lnet_pid_t dest_pid;
lnet_nid_t dest_nid;
lnet_nid_t src_nid;
- struct lnet_peer_ni *lpni;
- u32 payload_length;
+ bool push = false;
+ int for_me;
u32 type;
+ int rc = 0;
+ int cpt;
LASSERT(!in_interrupt());
@@ -3907,11 +3908,16 @@ void lnet_monitor_thr_stop(void)
lnet_ni_lock(ni);
ni->ni_last_alive = ktime_get_real_seconds();
if (ni->ni_status &&
- ni->ni_status->ns_status == LNET_NI_STATUS_DOWN)
+ ni->ni_status->ns_status == LNET_NI_STATUS_DOWN) {
ni->ni_status->ns_status = LNET_NI_STATUS_UP;
+ push = true;
+ }
lnet_ni_unlock(ni);
}
+ if (push)
+ lnet_push_update_to_peers(1);
+
/*
* Regard a bad destination NID as a protocol error. Senders should
* know what they're doing; if they don't they're misconfigured, buggy
@@ -742,10 +742,11 @@ int lnet_get_rtr_pool_cfg(int cpt, struct lnet_ioctl_pool_cfg *pool_cfg)
}
}
-static void
+static bool
lnet_update_ni_status_locked(void)
{
struct lnet_ni *ni = NULL;
+ bool push = false;
time64_t now;
time64_t timeout;
@@ -778,9 +779,12 @@ int lnet_get_rtr_pool_cfg(int cpt, struct lnet_ioctl_pool_cfg *pool_cfg)
* NI status to "down"
*/
ni->ni_status->ns_status = LNET_NI_STATUS_DOWN;
+ push = true;
}
lnet_ni_unlock(ni);
}
+
+ return push;
}
void lnet_wait_router_start(void)
@@ -817,6 +821,7 @@ bool lnet_router_checker_active(void)
{
struct lnet_peer_ni *lpni;
struct lnet_peer *rtr;
+ bool push = false;
u64 version;
time64_t now;
int cpt;
@@ -883,9 +888,13 @@ bool lnet_router_checker_active(void)
}
if (the_lnet.ln_routing)
- lnet_update_ni_status_locked();
+ push = lnet_update_ni_status_locked();
lnet_net_unlock(cpt);
+
+ /* if the status of the ni changed update the peers */
+ if (push)
+ lnet_push_update_to_peers(1);
}
void