Whamcloud - gitweb
LU-9120 lnet: remove obsolete health functions 62/32862/14
authorAmir Shehata <amir.shehata@intel.com>
Tue, 17 Jul 2018 18:58:22 +0000 (11:58 -0700)
committerAmir Shehata <ashehata@whamcloud.com>
Fri, 17 Aug 2018 20:18:26 +0000 (20:18 +0000)
Removed obsolete health functions that were originally added
during the Multi-Rail project. Some assumptions were made about
the health implementation back then, that are no longer true.

Test-Parameters: forbuildonly
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: I4d4f47a03541d58da6807d9c2b786ecd868b50b0
Reviewed-on: https://review.whamcloud.com/32862
Tested-by: Jenkins
Reviewed-by: Sonia Sharma <sharmaso@whamcloud.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
lnet/include/lnet/lib-lnet.h
lnet/lnet/api-ni.c
lnet/lnet/lib-move.c
lnet/lnet/peer.c

index a5b66e1..928c79d 100644 (file)
@@ -545,7 +545,6 @@ extern struct lnet_ni *lnet_nid2ni_locked(lnet_nid_t nid, int cpt);
 extern struct lnet_ni *lnet_nid2ni_addref(lnet_nid_t nid);
 extern struct lnet_ni *lnet_net2ni_locked(__u32 net, int cpt);
 extern struct lnet_ni *lnet_net2ni_addref(__u32 net);
-bool lnet_is_ni_healthy_locked(struct lnet_ni *ni);
 struct lnet_net *lnet_get_net_locked(__u32 net_id);
 
 int lnet_lib_init(void);
@@ -933,45 +932,6 @@ int lnet_get_peer_ni_info(__u32 peer_index, __u64 *nid,
                          __u32 *peer_tx_qnob);
 int lnet_get_peer_ni_hstats(struct lnet_ioctl_peer_ni_hstats *stats);
 
-static inline bool
-lnet_is_peer_ni_healthy_locked(struct lnet_peer_ni *lpni)
-{
-       return lpni->lpni_healthy;
-}
-
-static inline void
-lnet_set_peer_ni_health_locked(struct lnet_peer_ni *lpni, bool health)
-{
-       lpni->lpni_healthy = health;
-}
-
-static inline bool
-lnet_is_peer_net_healthy_locked(struct lnet_peer_net *peer_net)
-{
-       struct lnet_peer_ni *lpni;
-
-       list_for_each_entry(lpni, &peer_net->lpn_peer_nis,
-                           lpni_peer_nis) {
-               if (lnet_is_peer_ni_healthy_locked(lpni))
-                       return true;
-       }
-
-       return false;
-}
-
-static inline bool
-lnet_is_peer_healthy_locked(struct lnet_peer *peer)
-{
-       struct lnet_peer_net *peer_net;
-
-       list_for_each_entry(peer_net, &peer->lp_peer_nets, lpn_peer_nets) {
-               if (lnet_is_peer_net_healthy_locked(peer_net))
-                       return true;
-       }
-
-       return false;
-}
-
 static inline struct lnet_peer_net *
 lnet_find_peer_net_locked(struct lnet_peer *peer, __u32 net_id)
 {
index d5120d5..a0fe3a5 100644 (file)
@@ -1222,15 +1222,6 @@ lnet_islocalnet(__u32 net_id)
        return local;
 }
 
-bool
-lnet_is_ni_healthy_locked(struct lnet_ni *ni)
-{
-       if (ni->ni_state & LNET_NI_STATE_ACTIVE)
-               return true;
-
-       return false;
-}
-
 struct lnet_ni  *
 lnet_nid2ni_locked(lnet_nid_t nid, int cpt)
 {
index 2c503b3..8b9ad0b 100644 (file)
@@ -2555,12 +2555,6 @@ again:
        }
        lnet_peer_ni_decref_locked(lpni);
 
-       /* If peer is not healthy then can not send anything to it */
-       if (!lnet_is_peer_healthy_locked(peer)) {
-               lnet_net_unlock(cpt);
-               return -EHOSTUNREACH;
-       }
-
        /*
         * Identify the different send cases
         */
index cb71514..0159101 100644 (file)
@@ -177,7 +177,6 @@ lnet_peer_ni_alloc(lnet_nid_t nid)
        lpni->lpni_nid = nid;
        lpni->lpni_cpt = cpt;
        atomic_set(&lpni->lpni_healthv, LNET_MAX_HEALTH_VALUE);
-       lnet_set_peer_ni_health_locked(lpni, true);
 
        net = lnet_get_net_locked(LNET_NIDNET(nid));
        lpni->lpni_net = net;
@@ -2701,8 +2700,6 @@ static lnet_nid_t lnet_peer_select_nid(struct lnet_peer *lp)
        /* Look for a direct-connected NID for this peer. */
        lpni = NULL;
        while ((lpni = lnet_get_next_peer_ni_locked(lp, NULL, lpni)) != NULL) {
-               if (!lnet_is_peer_ni_healthy_locked(lpni))
-                       continue;
                if (!lnet_get_net_locked(lpni->lpni_peer_net->lpn_net_id))
                        continue;
                break;
@@ -2713,8 +2710,6 @@ static lnet_nid_t lnet_peer_select_nid(struct lnet_peer *lp)
        /* Look for a routed-connected NID for this peer. */
        lpni = NULL;
        while ((lpni = lnet_get_next_peer_ni_locked(lp, NULL, lpni)) != NULL) {
-               if (!lnet_is_peer_ni_healthy_locked(lpni))
-                       continue;
                if (!lnet_find_rnet_locked(lpni->lpni_peer_net->lpn_net_id))
                        continue;
                break;
@@ -3094,9 +3089,6 @@ static int lnet_peer_discovery(void *arg)
                         * forever, in case the GET message (for ping)
                         * doesn't get a REPLY or the PUT message (for
                         * push) doesn't get an ACK.
-                        *
-                        * TODO: LNet Health will deal with this scenario
-                        * in a generic way.
                         */
                        lp->lp_last_queued = ktime_get_real_seconds();
                        lnet_net_unlock(LNET_LOCK_EX);