Whamcloud - gitweb
LU-5485 lnet: peer aliveness status and NI status
[fs/lustre-release.git] / lnet / lnet / router.c
index 290fe2d..091cfd9 100644 (file)
@@ -87,7 +87,7 @@ static int check_routers_before_use = 0;
 CFS_MODULE_PARM(check_routers_before_use, "i", int, 0444,
                "Assume routers are down and ping them before use");
 
-static int avoid_asym_router_failure = 1;
+int avoid_asym_router_failure = 1;
 CFS_MODULE_PARM(avoid_asym_router_failure, "i", int, 0644,
                "Avoid asymmetrical router failures (0 to disable)");
 
@@ -823,6 +823,21 @@ lnet_wait_known_routerstate(void)
 }
 
 void
+lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net)
+{
+       lnet_route_t *rte;
+
+       if ((gw->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) != 0) {
+               list_for_each_entry(rte, &gw->lp_routes, lr_gwlist) {
+                       if (rte->lr_net == net) {
+                               rte->lr_downis = 0;
+                               break;
+                       }
+               }
+       }
+}
+
+void
 lnet_update_ni_status_locked(void)
 {
        lnet_ni_t       *ni;
@@ -1011,7 +1026,7 @@ lnet_ping_router_locked (lnet_peer_t *rtr)
                 lnet_handle_md_t  mdh;
 
                 id.nid = rtr->lp_nid;
-                id.pid = LUSTRE_SRV_LNET_PID;
+               id.pid = LNET_PID_LUSTRE;
                 CDEBUG(D_NET, "Check: %s\n", libcfs_id2str(id));
 
                 rtr->lp_ping_notsent   = 1;
@@ -1069,7 +1084,7 @@ lnet_router_checker_start(void)
 
                 /* one async ping reply per router */
                 id.nid = rtr->lp_nid;
-                id.pid = LUSTRE_SRV_LNET_PID;
+               id.pid = LNET_PID_LUSTRE;
 
                lnet_net_unlock(0);