#include <lnet/lib-lnet.h>
#include <gni_pub.h>
-#include "gnilnd_version.h"
+
+static inline time_t cfs_duration_sec(long duration_jiffies)
+{
+ return jiffies_to_msecs(duration_jiffies) / MSEC_PER_SEC;
+}
#ifdef CONFIG_SLAB
#define GNILND_MBOX_SIZE KMALLOC_MAX_SIZE
#define GNILND_BUF_IMMEDIATE_KIOV 2 /* immediate data */
#define GNILND_BUF_PHYS_UNMAPPED 3 /* physical: not mapped yet */
#define GNILND_BUF_PHYS_MAPPED 4 /* physical: mapped already */
-#define GNILND_BUF_VIRT_UNMAPPED 5 /* virtual: not mapped yet */
-#define GNILND_BUF_VIRT_MAPPED 6 /* virtual: mapped already */
#define GNILND_TX_WAITING_REPLY (1<<1) /* expecting to receive reply */
#define GNILND_TX_WAITING_COMPLETION (1<<2) /* waiting for smsg_send to complete */
atomic64_t gnd_nbytes_map; /* bytes of total GART maps - fma, tx, etc */
__u32 gnd_map_nphys; /* # TX phys mappings */
__u32 gnd_map_physnop; /* # TX phys pages mapped */
- __u32 gnd_map_nvirt; /* # TX virt mappings */
- __u64 gnd_map_virtnob; /* # TX virt bytes mapped */
spinlock_t gnd_map_lock; /* serialize gnd_map_XXX */
unsigned long gnd_next_map; /* next mapping attempt in jiffies */
int gnd_map_attempt; /* last map attempt # */
short gnp_connecting; /* connection forming */
short gnp_pending_unlink; /* need last conn close to trigger unlink */
int gnp_last_errno; /* last error conn saw */
- unsigned long gnp_last_alive; /* last time I had valid comms */
+ time64_t gnp_last_alive; /* last time I had valid comms */
int gnp_last_dgram_errno; /* last error dgrams saw */
unsigned long gnp_last_dgram_time; /* last time I tried to connect */
unsigned long gnp_reconnect_time; /* get_seconds() when reconnect OK */
#error "this code uses actions inside LASSERT for ref counting"
#endif
-#define kgnilnd_admin_addref(atomic) \
-do { \
- int val = atomic_inc_return(&atomic); \
- LASSERTF(val > 0, #atomic " refcount %d\n", val); \
- CDEBUG(D_NETTRACE, #atomic " refcount %d\n", val); \
+#define kgnilnd_admin_addref(atomic) \
+do { \
+ int val = atomic_inc_return(&atomic); \
+ LASSERTF(val > 0, #atomic " refcount %d\n", val); \
+ CDEBUG(D_NETTRACE, #atomic " refcount %d\n", val); \
} while (0)
-#define kgnilnd_admin_decref(atomic) \
-do { \
- int val = atomic_dec_return(&atomic); \
- LASSERTF(val >=0, #atomic " refcount %d\n", val); \
- CDEBUG(D_NETTRACE, #atomic " refcount %d\n", val); \
+#define kgnilnd_admin_decref(atomic) \
+do { \
+ int val = atomic_dec_return(&atomic); \
+ LASSERTF(val >= 0, #atomic " refcount %d\n", val); \
+ CDEBUG(D_NETTRACE, #atomic " refcount %d\n", val); \
+ if (!val) \
+ wake_up_var(&kgnilnd_data); \
}while (0)
#define kgnilnd_net_addref(net) \
static inline int
kgnilnd_tx_mapped(kgn_tx_t *tx)
{
- return (tx->tx_buftype == GNILND_BUF_VIRT_MAPPED ||
- tx->tx_buftype == GNILND_BUF_PHYS_MAPPED);
+ return tx->tx_buftype == GNILND_BUF_PHYS_MAPPED;
}
static inline struct list_head *
void kgnilnd_free_phys_fmablk(kgn_device_t *device);
int kgnilnd_ctl(struct lnet_ni *ni, unsigned int cmd, void *arg);
-void kgnilnd_query(struct lnet_ni *ni, lnet_nid_t nid, cfs_time_t *when);
int kgnilnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg);
int kgnilnd_eager_recv(struct lnet_ni *ni, void *private,
struct lnet_msg *lntmsg, void **new_private);
int kgnilnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
int delayed, unsigned int niov,
- struct kvec *iov, lnet_kiov_t *kiov,
+ struct bio_vec *kiov,
unsigned int offset, unsigned int mlen, unsigned int rlen);
-__u16 kgnilnd_cksum_kiov(unsigned int nkiov, lnet_kiov_t *kiov, unsigned int offset, unsigned int nob, int dump_blob);
+__u16 kgnilnd_cksum_kiov(unsigned int nkiov, struct bio_vec *kiov,
+ unsigned int offset, unsigned int nob, int dump_blob);
/* purgatory functions */
void kgnilnd_add_purgatory_locked(kgn_conn_t *conn, kgn_peer_t *peer);