From ba05b3a98a0c41d31968b9c9e9ee66cbc68504e8 Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Tue, 17 Jul 2018 11:58:22 -0700 Subject: [PATCH] LU-9120 lnet: remove obsolete health functions 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 Change-Id: I4d4f47a03541d58da6807d9c2b786ecd868b50b0 Reviewed-on: https://review.whamcloud.com/32862 Tested-by: Jenkins Reviewed-by: Sonia Sharma Reviewed-by: Olaf Weber --- lnet/include/lnet/lib-lnet.h | 40 ---------------------------------------- lnet/lnet/api-ni.c | 9 --------- lnet/lnet/lib-move.c | 6 ------ lnet/lnet/peer.c | 8 -------- 4 files changed, 63 deletions(-) diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index a5b66e1..928c79d 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -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) { diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index d5120d5..a0fe3a5 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -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) { diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 2c503b3..8b9ad0b 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -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 */ diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index cb71514..0159101 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -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); -- 1.8.3.1