* enabled.
*/
if (lnet_is_discovery_disabled(gw))
- return route->lr_alive;
+ return atomic_read(&route->lr_alive) == 1;
/*
* check the gateway's interfaces on the local network
}
/* Must hold net_lock/EX */
-static inline void
-lnet_set_route_aliveness(struct lnet_route *route, bool alive)
-{
- /* Log when there's a state change */
- if (route->lr_alive != alive) {
- CERROR("route to %s through %s has gone from %s to %s\n",
- libcfs_net2str(route->lr_net),
- libcfs_nid2str(route->lr_gateway->lp_primary_nid),
- (route->lr_alive) ? "up" : "down",
- alive ? "up" : "down");
- route->lr_alive = alive;
- }
-}
-
-/* Must hold net_lock/EX */
void
lnet_router_discovery_ping_reply(struct lnet_peer *lp)
{
route->lr_nid = gateway;
route->lr_priority = priority;
route->lr_hops = hops;
+ if (lnet_peers_start_down())
+ atomic_set(&route->lr_alive, 0);
+ else
+ atomic_set(&route->lr_alive, 1);
lnet_net_lock(LNET_LOCK_EX);
*/
if (lnet_is_discovery_disabled(lp)) {
list_for_each_entry(route, &lp->lp_routes, lr_gwlist) {
- if (route->lr_nid == lpni->lpni_nid &&
- route->lr_alive != alive) {
- lnet_net_unlock(0);
- lnet_net_lock(LNET_LOCK_EX);
+ if (route->lr_nid == lpni->lpni_nid)
lnet_set_route_aliveness(route, alive);
- lnet_net_unlock(LNET_LOCK_EX);
- lnet_net_lock(0);
- }
}
}
}