X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Finclude%2Flnet%2Flib-lnet.h;h=73a4d68db318cf71a94ee1c8ea03030c525d4762;hp=36b1a6334d170974b1cc11645d4ee2a75bbc5b6c;hb=339c7b2b784a528f41c432e9b90285d3445b7536;hpb=d68d56c00e7788a445f94b6e099f7f8b9e259bae diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 36b1a63..73a4d68 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -651,6 +651,31 @@ lnet_isrouter(lnet_peer_t *lp) return lp->lp_rtr_refcount != 0; } +/* check if it's a router checker ping */ +static inline int +lnet_msg_is_rc_ping(struct lnet_msg *msg) +{ + lnet_hdr_t *hdr = &msg->msg_hdr; + + return msg->msg_type == LNET_MSG_GET && + hdr->msg.get.ptl_index == cpu_to_le32(LNET_RESERVED_PORTAL) && + hdr->msg.get.match_bits == + cpu_to_le64(LNET_PROTO_PING_MATCHBITS); +} + +/* peer aliveness is enabled in a network where lnet_ni_t::ni_peertimeout has + * been set to a positive value, it's only valid for router peers or peers on + * routers. + */ +static inline int +lnet_peer_aliveness_enabled(struct lnet_peer *lp) +{ + if (lp->lp_ni->ni_peertimeout <= 0) + return 0; + + return the_lnet.ln_routing || lnet_isrouter(lp); +} + static inline void lnet_ni_addref_locked(lnet_ni_t *ni, int cpt) {