X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Flnet%2Frouter.c;h=f46627ed86bc4829e46e8abbbf4e841fa99007bd;hp=c297959c8b74521d800773ed3d2a506fbe1b6461;hb=3f2844dc9333c86452c37bd7b4519729b1351371;hpb=7fdd664b3518e5e8d8a243898d48d9c62c22e18a diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index c297959..f46627e 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -329,7 +329,7 @@ bool lnet_is_route_alive(struct lnet_route *route) * routes the next-hop will not have the remote net. */ if (avoid_asym_router_failure && - (route->lr_hops == 1 || route->lr_hops == LNET_UNDEFINED_HOPS)) { + (route->lr_hops == 1 || route->lr_single_hop)) { rlpn = lnet_peer_get_net_locked(gw, route->lr_net); if (!rlpn) return false; @@ -483,8 +483,7 @@ lnet_router_discovery_ping_reply(struct lnet_peer *lp) route->lr_single_hop = single_hop; if (avoid_asym_router_failure && - (route->lr_hops == 1 || - route->lr_hops == LNET_UNDEFINED_HOPS)) + (route->lr_hops == 1 || route->lr_single_hop)) lnet_set_route_aliveness(route, net_up); else lnet_set_route_aliveness(route, true); @@ -790,6 +789,14 @@ lnet_add_route(__u32 net, __u32 hops, struct lnet_nid *gateway, lnet_peer_ni_decref_locked(lpni); lnet_net_unlock(LNET_LOCK_EX); + /* If avoid_asym_router_failure is enabled and hop count is not + * set to 1 for a route that is actually single-hop, then the + * feature will fail to prevent the router from being selected + * if it is missing a NI on the remote network due to misconfiguration. + */ + if (avoid_asym_router_failure && hops == LNET_UNDEFINED_HOPS) + CWARN("Use hops = 1 for a single-hop route when avoid_asym_router_failure feature is enabled"); + rc = 0; if (!add_route) {