Whamcloud - gitweb
LU-13972 o2iblnd: Don't retry indefinitely
[fs/lustre-release.git] / lnet / klnds / o2iblnd / o2iblnd.h
index 9bb0b60..8ff3b8c 100644 (file)
  * Author: Eric Barton <eric@bartonsoftware.com>
  */
 
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+#if defined(NEED_LOCKDEP_IS_HELD_DISCARD_CONST) \
+ && defined(CONFIG_LOCKDEP) \
+ && defined(lockdep_is_held)
+#undef lockdep_is_held
+       #define lockdep_is_held(lock) \
+               lock_is_held((struct lockdep_map *)&(lock)->dep_map)
+#endif
+
 #ifdef HAVE_COMPAT_RDMA
 #include <linux/compat-2.6.h>
 
 #undef NEED_KTIME_GET_REAL_NS
 #endif
 
+/* MOFED has its own bitmap_alloc backport */
+#define HAVE_BITMAP_ALLOC 1
+
 #endif
 
-#include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/kthread.h>
 #include <linux/mm.h>
 #include <linux/string.h>
@@ -79,8 +91,6 @@
 #include <lnet/lib-lnet.h>
 
 #define IBLND_PEER_HASH_SIZE           101     /* # peer_ni lists */
-/* # scheduler loops before reschedule */
-#define IBLND_RESCHED                  100
 
 #define IBLND_N_SCHED                  2
 #define IBLND_N_SCHED_HIGH             4
@@ -636,8 +646,6 @@ struct kib_tx {                                     /* transmit message */
        struct kib_fmr          tx_fmr;
                                /* dma direction */
        int                     tx_dmadir;
-       /* time when tx added on ibc_active_txs */
-       ktime_t                 tx_on_activeq;
 };
 
 struct kib_connvars {
@@ -760,6 +768,8 @@ struct kib_peer_ni {
        unsigned char           ibp_races;
        /* # consecutive reconnection attempts to this peer */
        unsigned int            ibp_reconnected;
+       /* number of total active retries */
+       unsigned int            ibp_retries;
        /* errno on closing this peer_ni */
        int                     ibp_error;
        /* max map_on_demand */