* 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>
#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
min(t->lnd_peercredits_hiw, (__u32)conn->ibc_queue_depth - 1))
#ifdef HAVE_RDMA_CREATE_ID_5ARG
-# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) rdma_create_id(ns, cb, \
- dev, ps, \
- qpt)
+# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) \
+ rdma_create_id((ns) ? (ns) : &init_net, cb, dev, ps, qpt)
#else
# ifdef HAVE_RDMA_CREATE_ID_4ARG
-# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) rdma_create_id(cb, dev, \
- ps, qpt)
+# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) \
+ rdma_create_id(cb, dev, ps, qpt)
# else
-# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) rdma_create_id(cb, dev, \
- ps)
+# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) \
+ rdma_create_id(cb, dev, ps)
# endif
#endif
struct ib_mr *ibh_mrs; /* global MR */
#endif
struct ib_pd *ibh_pd; /* PD */
+ u8 ibh_port; /* port number */
+ struct ib_event_handler
+ ibh_event_handler; /* IB event handler */
+ int ibh_state; /* device status */
+#define IBLND_DEV_PORT_DOWN 0
+#define IBLND_DEV_PORT_ACTIVE 1
+#define IBLND_DEV_FATAL 2
struct kib_dev *ibh_dev; /* owner */
atomic_t ibh_ref; /* refcount */
};
struct kib_fmr_poolset **ibn_fmr_ps; /* fmr pool-set */
struct kib_dev *ibn_dev; /* underlying IB device */
+ struct lnet_ni *ibn_ni; /* LNet interface */
};
#define KIB_THREAD_SHIFT 16
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 */
int kiblnd_msg_queue_size(int version, struct lnet_ni *ni);
+static inline int kiblnd_timeout(void)
+{
+ return *kiblnd_tunables.kib_timeout ? *kiblnd_tunables.kib_timeout :
+ lnet_get_lnd_timeout();
+}
+
static inline int
kiblnd_concurrent_sends(int version, struct lnet_ni *ni)
{
return rd->rd_frags[index].rf_addr;
}
-static inline __u32
+static inline int
kiblnd_rd_frag_size(struct kib_rdma_desc *rd, int index)
{
return rd->rd_frags[index].rf_nob;
int kiblnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg);
int kiblnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
- int delayed, unsigned int niov, struct kvec *iov,
- lnet_kiov_t *kiov, unsigned int offset, unsigned int mlen,
+ int delayed, unsigned int niov,
+ struct bio_vec *kiov, unsigned int offset, unsigned int mlen,
unsigned int rlen);