From: Amir Shehata Date: Mon, 20 Jun 2016 21:21:13 +0000 (-0700) Subject: LU-7734 lnet: fix lnet_select_pathway() X-Git-Tag: 2.9.53~47^2~15 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=a52d11ffe4f5d922749c67b37a07f777e56a2390;p=fs%2Flustre-release.git LU-7734 lnet: fix lnet_select_pathway() Fixed the selection algorithm to work properly with > 1 local networks. The behavior now is to iterate through all interfaces on all networks Also removed the health variable from struct lnet_peer_net since it's never used. Signed-off-by: Amir Shehata Change-Id: Ib91748e80446585b6a9e1bc0f3af6894599d8aaa Reviewed-on: http://review.whamcloud.com/20890 Reviewed-by: Doug Oucharek Tested-by: Jenkins --- diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index bbf0ab4..3047e7c 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -541,9 +541,6 @@ struct lnet_peer_net { /* Net ID */ __u32 lpn_net_id; - - /* health flag */ - bool lpn_healthy; }; /* peer hash size */ diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 3606ae7..ec59069 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1416,6 +1416,8 @@ again: * b. Iterate through each of the peer_nets/nis to decide * the best peer/local_ni pair to use */ + shortest_distance = INT_MAX; + best_credits = INT_MIN; list_for_each_entry(peer_net, &peer->lp_peer_nets, lpn_on_peer_list) { if (!lnet_is_peer_net_healthy_locked(peer_net)) continue; @@ -1476,8 +1478,6 @@ again: * 2. NI available credits * 3. Round Robin */ - shortest_distance = INT_MAX; - best_credits = INT_MIN; ni = NULL; while ((ni = lnet_get_next_ni_locked(local_net, ni))) { int ni_credits;