Whamcloud - gitweb
LU-13912 lnet: Correct the router ping interval calculation
[fs/lustre-release.git] / lnet / include / lnet / lib-types.h
index 4ffb27c..ed52e0a 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/include/lnet/lib-types.h
  *
@@ -46,6 +45,7 @@
 #include <linux/uio.h>
 #include <linux/semaphore.h>
 #include <linux/types.h>
+#include <linux/kref.h>
 
 #include <uapi/linux/lnet/lnet-dlc.h>
 #include <uapi/linux/lnet/lnetctl.h>
@@ -473,6 +473,13 @@ struct lnet_ni {
        /* Recovery state. Protected by lnet_ni_lock() */
        __u32                   ni_recovery_state;
 
+       /* When to send the next recovery ping */
+       time64_t                ni_next_ping;
+       /* How many pings sent during current recovery period did not receive
+        * a reply. NB: reset whenever _any_ message arrives on this NI
+        */
+       unsigned int            ni_ping_count;
+
        /* per NI LND tunables */
        struct lnet_lnd_tunables ni_lnd_tunables;
 
@@ -580,7 +587,7 @@ struct lnet_peer_ni {
        /* peer's NID */
        lnet_nid_t              lpni_nid;
        /* # refs */
-       atomic_t                lpni_refcount;
+       struct kref             lpni_kref;
        /* health value for the peer */
        atomic_t                lpni_healthv;
        /* recovery ping mdh */
@@ -803,8 +810,8 @@ struct lnet_peer_net {
        /* peer net health */
        int                     lpn_healthv;
 
-       /* time of last router net check attempt */
-       time64_t                lpn_rtrcheck_timestamp;
+       /* time of next router ping on this net */
+       time64_t                lpn_next_ping;
 
        /* selection sequence number */
        __u32                   lpn_seq;
@@ -861,7 +868,7 @@ struct lnet_route {
        int                     lr_seq;         /* sequence for round-robin */
        __u32                   lr_hops;        /* how far I am */
        unsigned int            lr_priority;    /* route priority */
-       bool                    lr_alive;       /* cached route aliveness */
+       atomic_t                lr_alive;       /* cached route aliveness */
        bool                    lr_single_hop;  /* this route is single-hop */
 };