Whamcloud - gitweb
LU-12686 lnet: change ln_mt_waitq to a completion.
[fs/lustre-release.git] / lnet / include / lnet / lib-types.h
index 6121592..b446414 100644 (file)
@@ -415,6 +415,12 @@ struct lnet_net {
 
        /* network state */
        enum lnet_net_state     net_state;
+
+       /* when I was last alive */
+       time64_t                net_last_alive;
+
+       /* protects access to net_last_alive */
+       spinlock_t              net_lock;
 };
 
 struct lnet_ni {
@@ -450,9 +456,6 @@ struct lnet_ni {
        /* percpt reference count */
        int                     **ni_refs;
 
-       /* when I was last alive */
-       time64_t                ni_last_alive;
-
        /* pointer to parent network */
        struct lnet_net         *ni_net;
 
@@ -581,6 +584,8 @@ struct lnet_peer_ni {
        __u32                   lpni_gw_seq;
        /* returned RC ping features. Protected with lpni_lock */
        unsigned int            lpni_ping_feats;
+       /* time last message was received from the peer */
+       time64_t                lpni_last_alive;
        /* preferred local nids: if only one, use lpni_pref.nid */
        union lpni_pref {
                lnet_nid_t      nid;
@@ -615,13 +620,16 @@ struct lnet_peer {
        /* primary NID of the peer */
        lnet_nid_t              lp_primary_nid;
 
+       /* net to perform discovery on */
+       __u32                   lp_disc_net_id;
+
        /* CPT of peer_table */
        int                     lp_cpt;
 
        /* number of NIDs on this peer */
        int                     lp_nnis;
 
-       /* # refs from lnet_route_t::lr_gateway */
+       /* # refs from lnet_route::lr_gateway */
        int                     lp_rtr_refcount;
 
        /*
@@ -636,9 +644,6 @@ struct lnet_peer {
        /* routes on this peer */
        struct list_head        lp_routes;
 
-       /* time of last router check attempt */
-       time64_t                lp_rtrcheck_timestamp;
-
        /* reference count */
        atomic_t                lp_refcount;
 
@@ -759,6 +764,12 @@ struct lnet_peer_net {
        /* Net ID */
        __u32                   lpn_net_id;
 
+       /* time of last router net check attempt */
+       time64_t                lpn_rtrcheck_timestamp;
+
+       /* selection sequence number */
+       __u32                   lpn_seq;
+
        /* reference count */
        atomic_t                lpn_refcount;
 };
@@ -810,6 +821,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 */
 };
 
 #define LNET_REMOTE_NETS_HASH_DEFAULT  (1U << 7)
@@ -961,9 +973,13 @@ struct lnet_msg_container {
        int                     msc_nfinalizers;
        /* msgs waiting to complete finalizing */
        struct list_head        msc_finalizing;
+       /* msgs waiting to be resent */
+       struct list_head        msc_resending;
        struct list_head        msc_active;     /* active message list */
        /* threads doing finalization */
        void                    **msc_finalizers;
+       /* threads doing resends */
+       void                    **msc_resenders;
 };
 
 /* Peer Discovery states */
@@ -1110,10 +1126,10 @@ struct lnet {
        bool                            ln_nis_from_mod_params;
 
        /*
-        * waitq for the monitor thread. The monitor thread takes care of
+        * completion for the monitor thread. The monitor thread takes care of
         * checking routes, timedout messages and resending messages.
         */
-       wait_queue_head_t               ln_mt_waitq;
+       struct completion               ln_mt_wait_complete;
 
        /* per-cpt resend queues */
        struct list_head                **ln_mt_resendqs;
@@ -1129,9 +1145,21 @@ struct lnet {
         * based on the mdh cookie.
         */
        struct list_head                **ln_mt_rstq;
+       /*
+        * A response tracker becomes a zombie when the associated MD is queued
+        * for unlink before the response tracker is detached from the MD. An
+        * entry on a zombie list can be freed when either the remaining
+        * operations on the MD complete or when LNet has shut down.
+        */
+       struct list_head                **ln_mt_zombie_rstqs;
        /* recovery eq handler */
        struct lnet_handle_eq           ln_mt_eqh;
 
+       /*
+        * Completed when the discovery and monitor threads can enter their
+        * work loops
+        */
+       struct completion               ln_started;
 };
 
 #endif