X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Fklnds%2Fkfilnd%2Fkfilnd.h;fp=lnet%2Fklnds%2Fkfilnd%2Fkfilnd.h;h=b8243d826e0a00b2e423b965e69d5c6c03d2adfe;hb=de2536850ed2ecc2169dec4ccc458589314b2896;hp=4c21532074600e1f2ec0ff377f228b515307ebe6;hpb=c1f7eaa24f14aa567b80d99676c765db2b331d40;p=fs%2Flustre-release.git diff --git a/lnet/klnds/kfilnd/kfilnd.h b/lnet/klnds/kfilnd/kfilnd.h index 4c21532..b8243d8 100644 --- a/lnet/klnds/kfilnd/kfilnd.h +++ b/lnet/klnds/kfilnd/kfilnd.h @@ -273,14 +273,24 @@ static inline bool kfilnd_peer_is_new_peer(struct kfilnd_peer *kp) /* Peer needs hello if it is not up to date and there is not already a hello * in flight. * + * Called from the send path and the receive path. When called from send path + * we additionally consider the peer's last alive value, and proactively + * handshake peers that we haven't talked to in a while. + * * If hello was sent more than LND timeout seconds ago, and we never received a * response, then send another one. */ -static inline bool kfilnd_peer_needs_hello(struct kfilnd_peer *kp) +static inline bool kfilnd_peer_needs_hello(struct kfilnd_peer *kp, + bool proactive_handshake) { if (atomic_read(&kp->kp_hello_pending) == 0) { if (atomic_read(&kp->kp_state) != KP_STATE_UPTODATE) return true; + else if (proactive_handshake && + ktime_before(kp->kp_last_alive + + lnet_get_lnd_timeout() * 2, + ktime_get_seconds())) + return true; } else if (ktime_before(kp->kp_hello_ts + lnet_get_lnd_timeout(), ktime_get_seconds())) { /* Sent hello but never received reply */