Whamcloud - gitweb
LU-11300 lnet: remove lnd_query interface.
[fs/lustre-release.git] / lnet / include / lnet / lib-types.h
index ca93161..5b8b8d8 100644 (file)
@@ -49,6 +49,7 @@
 
 #include <uapi/linux/lnet/lnet-dlc.h>
 #include <uapi/linux/lnet/lnetctl.h>
+#include <uapi/linux/lnet/nidstr.h>
 
 /* Max payload size */
 #define LNET_MAX_PAYLOAD       LNET_MTU
@@ -194,7 +195,7 @@ struct lnet_eq {
 
 struct lnet_me {
        struct list_head        me_list;
-       struct lnet_libhandle   me_lh;
+       int                     me_cpt;
        struct lnet_process_id  me_match_id;
        unsigned int            me_portal;
        unsigned int            me_pos;         /* hash offset in mt_hash */
@@ -248,10 +249,6 @@ struct lnet_ni;                                     /* forward ref */
 struct socket;
 
 struct lnet_lnd {
-       /* fields managed by portals */
-       struct list_head        lnd_list;       /* stash in the LND table */
-       int                     lnd_refcount;   /* # active instances */
-
        /* fields initialized by the LND */
        __u32                   lnd_type;
 
@@ -300,9 +297,6 @@ struct lnet_lnd {
        /* notification of peer down */
        void (*lnd_notify_peer_down)(lnet_nid_t peer);
 
-       /* query of peer aliveness */
-       void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, time64_t *when);
-
        /* accept a new connection */
        int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
 };
@@ -402,7 +396,7 @@ struct lnet_net {
        bool                    net_tunables_set;
 
        /* procedural interface */
-       struct lnet_lnd         *net_lnd;
+       const struct lnet_lnd   *net_lnd;
 
        /* list of NIs on this net */
        struct list_head        net_ni_list;
@@ -413,9 +407,6 @@ struct lnet_net {
        /* dying LND instances */
        struct list_head        net_ni_zombie;
 
-       /* network state */
-       enum lnet_net_state     net_state;
-
        /* when I was last alive */
        time64_t                net_last_alive;
 
@@ -629,7 +620,7 @@ struct lnet_peer {
        /* 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;
 
        /*
@@ -691,6 +682,9 @@ struct lnet_peer {
 
        /* tasks waiting on discovery of this peer */
        wait_queue_head_t       lp_dc_waitq;
+
+       /* cached peer aliveness */
+       bool                    lp_alive;
 };
 
 /*
@@ -750,6 +744,8 @@ struct lnet_peer {
 
 /* gw undergoing alive discovery */
 #define LNET_PEER_RTR_DISCOVERY (1 << 16)
+/* gw has undergone discovery (does not indicate success or failure) */
+#define LNET_PEER_RTR_DISCOVERED (1 << 17)
 
 struct lnet_peer_net {
        /* chain on lp_peer_nets */
@@ -783,7 +779,6 @@ struct lnet_peer_net {
  *
  * protected by lnet_net_lock/EX for update
  *    pt_version
- *    pt_number
  *    pt_hash[...]
  *    pt_peer_list
  *    pt_peers
@@ -795,7 +790,6 @@ struct lnet_peer_net {
  */
 struct lnet_peer_table {
        int                     pt_version;     /* /proc validity stamp */
-       int                     pt_number;      /* # peers_ni extant */
        struct list_head        *pt_hash;       /* NID->peer hash */
        struct list_head        pt_peer_list;   /* peers */
        int                     pt_peers;       /* # peers */
@@ -821,6 +815,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)
@@ -1009,8 +1004,6 @@ struct lnet {
        int                             ln_nportals;
        /* the vector of portals */
        struct lnet_portal              **ln_portals;
-       /* percpt ME containers */
-       struct lnet_res_container       **ln_me_containers;
        /* percpt MD container */
        struct lnet_res_container       **ln_md_containers;
 
@@ -1112,10 +1105,10 @@ struct lnet {
        /* uniquely identifies this ni in this epoch */
        __u64                           ln_interface_cookie;
        /* registered LNDs */
-       struct list_head                ln_lnds;
+       const struct lnet_lnd           *ln_lnds[NUM_LNDS];
 
        /* test protocol compatibility flags */
-       int                             ln_testprotocompat;
+       unsigned long                   ln_testprotocompat;
 
        /* 0 - load the NIs from the mod params
         * 1 - do not load the NIs from the mod params
@@ -1125,10 +1118,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;