Whamcloud - gitweb
LU-11297 lnet: handle router health off
[fs/lustre-release.git] / lnet / lnet / router.c
index 0346cf0..fb7f905 100644 (file)
@@ -425,7 +425,7 @@ lnet_add_route_to_rnet(struct lnet_remotenet *rnet, struct lnet_route *route)
 
 int
 lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
-              unsigned int priority)
+              __u32 priority, __u32 sensitivity)
 {
        struct list_head *route_entry;
        struct lnet_remotenet *rnet;
@@ -528,8 +528,10 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
         * to move the routes from the peer that's being deleted to the
         * consolidated peer lp_routes list
         */
-       if (add_route)
+       if (add_route) {
+               gw->lp_health_sensitivity = sensitivity;
                lnet_add_route_to_rnet(rnet2, route);
+       }
 
        /*
         * get rid of the reference on the lpni.
@@ -698,15 +700,15 @@ int lnet_get_rtr_pool_cfg(int cpt, struct lnet_ioctl_pool_cfg *pool_cfg)
 
 int
 lnet_get_route(int idx, __u32 *net, __u32 *hops,
-              lnet_nid_t *gateway, __u32 *alive, __u32 *priority)
+              lnet_nid_t *gateway, __u32 *alive, __u32 *priority, __u32 *sensitivity)
 {
-       struct list_head *e1;
-       struct list_head *e2;
        struct lnet_remotenet *rnet;
-       struct lnet_route        *route;
-       int               cpt;
-       int               i;
        struct list_head *rn_list;
+       struct lnet_route *route;
+       struct list_head *e1;
+       struct list_head *e2;
+       int cpt;
+       int i;
 
        cpt = lnet_net_lock_current();
 
@@ -724,6 +726,8 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops,
                                        *gateway  = route->lr_nid;
                                        *hops     = route->lr_hops;
                                        *priority = route->lr_priority;
+                                       *sensitivity = route->lr_gateway->
+                                               lp_health_sensitivity;
                                        *alive    = lnet_is_route_alive(route);
                                        lnet_net_unlock(cpt);
                                        return 0;