Whamcloud - gitweb
LU-9120 lnet: health error simulation
[fs/lustre-release.git] / lnet / include / lnet / lib-types.h
index e921595..4ee8c60 100644 (file)
@@ -75,7 +75,8 @@ enum lnet_msg_hstatus {
        LNET_MSG_STATUS_REMOTE_ERROR,
        LNET_MSG_STATUS_REMOTE_DROPPED,
        LNET_MSG_STATUS_REMOTE_TIMEOUT,
-       LNET_MSG_STATUS_NETWORK_TIMEOUT
+       LNET_MSG_STATUS_NETWORK_TIMEOUT,
+       LNET_MSG_STATUS_END,
 };
 
 struct lnet_rsp_tracker {
@@ -348,6 +349,22 @@ struct lnet_element_stats {
        struct lnet_comm_count el_drop_stats;
 };
 
+struct lnet_health_local_stats {
+       atomic_t hlt_local_interrupt;
+       atomic_t hlt_local_dropped;
+       atomic_t hlt_local_aborted;
+       atomic_t hlt_local_no_route;
+       atomic_t hlt_local_timeout;
+       atomic_t hlt_local_error;
+};
+
+struct lnet_health_remote_stats {
+       atomic_t hlt_remote_dropped;
+       atomic_t hlt_remote_timeout;
+       atomic_t hlt_remote_error;
+       atomic_t hlt_network_timeout;
+};
+
 struct lnet_net {
        /* chain on the ln_nets */
        struct list_head        net_list;
@@ -448,6 +465,7 @@ struct lnet_ni {
 
        /* NI statistics */
        struct lnet_element_stats ni_stats;
+       struct lnet_health_local_stats ni_hstats;
 
        /* physical device CPT */
        int                     ni_dev_cpt;
@@ -465,6 +483,13 @@ struct lnet_ni {
        atomic_t                ni_healthv;
 
        /*
+        * Set to 1 by the LND when it receives an event telling it the device
+        * has gone into a fatal state. Set to 0 when the LND receives an
+        * even telling it the device is back online.
+        */
+       atomic_t                ni_fatal_error_on;
+
+       /*
         * equivalent interfaces to use
         * This is an array because socklnd bonding can still be configured
         */
@@ -523,6 +548,7 @@ struct lnet_peer_ni {
        struct lnet_peer_net    *lpni_peer_net;
        /* statistics kept on each peer NI */
        struct lnet_element_stats lpni_stats;
+       struct lnet_health_remote_stats lpni_hstats;
        /* spin lock protecting credits and lpni_txq / lpni_rtrq */
        spinlock_t              lpni_lock;
        /* # tx credits available */