Whamcloud - gitweb
LU-7734 lnet: fix lnet_select_pathway()
authorAmir Shehata <amir.shehata@intel.com>
Mon, 20 Jun 2016 21:21:13 +0000 (14:21 -0700)
committerAmir Shehata <amir.shehata@intel.com>
Wed, 25 Jan 2017 03:10:16 +0000 (19:10 -0800)
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 <amir.shehata@intel.com>
Change-Id: Ib91748e80446585b6a9e1bc0f3af6894599d8aaa
Reviewed-on: http://review.whamcloud.com/20890
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Tested-by: Jenkins
lnet/include/lnet/lib-types.h
lnet/lnet/lib-move.c

index bbf0ab4..3047e7c 100644 (file)
@@ -541,9 +541,6 @@ struct lnet_peer_net {
 
        /* Net ID */
        __u32                   lpn_net_id;
-
-       /* health flag */
-       bool                    lpn_healthy;
 };
 
 /* peer hash size */
index 3606ae7..ec59069 100644 (file)
@@ -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;