Whamcloud - gitweb
LU-9120 lnet: handle local ni failure
[fs/lustre-release.git] / lnet / include / lnet / lib-types.h
index 3817bcd..dee0a46 100644 (file)
 /* forward refs */
 struct lnet_libmd;
 
+enum lnet_msg_hstatus {
+       LNET_MSG_STATUS_OK = 0,
+       LNET_MSG_STATUS_LOCAL_INTERRUPT,
+       LNET_MSG_STATUS_LOCAL_DROPPED,
+       LNET_MSG_STATUS_LOCAL_ABORTED,
+       LNET_MSG_STATUS_LOCAL_NO_ROUTE,
+       LNET_MSG_STATUS_LOCAL_ERROR,
+       LNET_MSG_STATUS_LOCAL_TIMEOUT,
+       LNET_MSG_STATUS_REMOTE_ERROR,
+       LNET_MSG_STATUS_REMOTE_DROPPED,
+       LNET_MSG_STATUS_REMOTE_TIMEOUT,
+       LNET_MSG_STATUS_NETWORK_TIMEOUT
+};
+
 struct lnet_msg {
        struct list_head        msg_activelist;
        struct list_head        msg_list;       /* Q for credits/MD */
@@ -88,6 +102,13 @@ struct lnet_msg {
         */
        ktime_t                 msg_deadline;
 
+       /* The message health status. */
+       enum lnet_msg_hstatus   msg_health_status;
+       /* This is a recovery message */
+       bool                    msg_recovery;
+       /* flag to indicate that we do not want to resend this message */
+       bool                    msg_no_resend;
+
        /* committed for sending */
        unsigned int            msg_tx_committed:1;
        /* CPT # this message committed for sending */
@@ -287,18 +308,11 @@ enum lnet_net_state {
        LNET_NET_STATE_DELETING
 };
 
-enum lnet_ni_state {
-       /* set when NI block is allocated */
-       LNET_NI_STATE_INIT = 0,
-       /* set when NI is started successfully */
-       LNET_NI_STATE_ACTIVE,
-       /* set when LND notifies NI failed */
-       LNET_NI_STATE_FAILED,
-       /* set when LND notifies NI degraded */
-       LNET_NI_STATE_DEGRADED,
-       /* set when shuttding down NI */
-       LNET_NI_STATE_DELETING
-};
+#define LNET_NI_STATE_INIT             (1 << 0)
+#define LNET_NI_STATE_ACTIVE           (1 << 1)
+#define LNET_NI_STATE_FAILED           (1 << 2)
+#define LNET_NI_STATE_RECOVERY_PENDING (1 << 3)
+#define LNET_NI_STATE_DELETING         (1 << 4)
 
 enum lnet_stats_type {
        LNET_STATS_TYPE_SEND = 0,
@@ -371,6 +385,12 @@ struct lnet_ni {
        /* chain on net_ni_cpt */
        struct list_head        ni_cptlist;
 
+       /* chain on the recovery queue */
+       struct list_head        ni_recovery;
+
+       /* MD handle for recovery ping */
+       struct lnet_handle_md   ni_ping_mdh;
+
        spinlock_t              ni_lock;
 
        /* number of CPTs */
@@ -404,7 +424,7 @@ struct lnet_ni {
        struct lnet_ni_status   *ni_status;
 
        /* NI FSM */
-       enum lnet_ni_state      ni_state;
+       __u32                   ni_state;
 
        /* per NI LND tunables */
        struct lnet_lnd_tunables ni_lnd_tunables;
@@ -1046,6 +1066,14 @@ struct lnet {
         * checking routes, timedout messages and resending messages.
         */
        wait_queue_head_t               ln_mt_waitq;
+
+       /* per-cpt resend queues */
+       struct list_head                **ln_mt_resendqs;
+       /* local NIs to recover */
+       struct list_head                ln_mt_localNIRecovq;
+       /* recovery eq handler */
+       struct lnet_handle_eq           ln_mt_eqh;
+
 };
 
 #endif