Whamcloud - gitweb
LU-11300 lnet: remove lnd_query interface.
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd.h
index 6cf451c..0389887 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LND
 
-#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
 #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
@@ -614,7 +616,7 @@ typedef struct kgn_device {
 typedef struct kgn_net {
        struct list_head    gnn_list;           /* chain on kgni_data::kgn_nets */
        kgn_device_t       *gnn_dev;            /* device for this net */
-       lnet_ni_t          *gnn_ni;             /* network interface instance */
+       struct lnet_ni          *gnn_ni;             /* network interface instance */
        atomic_t            gnn_refcount;       /* # current references */
        int                 gnn_shutdown;       /* lnd_shutdown set */
        __u16               gnn_netnum;         /* stash netnum for quicker lookup */
@@ -682,7 +684,7 @@ typedef struct kgn_tx {                         /* message descriptor */
        kgn_tx_list_state_t       tx_list_state;/* where in state machine is this TX ? */
        struct list_head         *tx_list_p;    /* pointer to current list */
        struct kgn_conn          *tx_conn;      /* owning conn */
-       lnet_msg_t               *tx_lntmsg[2]; /* ptl msgs to finalize on completion */
+       struct lnet_msg               *tx_lntmsg[2]; /* ptl msgs to finalize on completion */
        unsigned long             tx_qtime;     /* when tx started to wait for something (jiffies) */
        unsigned long             tx_cred_wait; /* time spend waiting for smsg creds */
        struct list_head          tx_map_list;  /* list entry on device map list */
@@ -763,7 +765,7 @@ typedef struct kgn_conn {
        kgn_fma_memblock_t *gnc_fma_blk;        /* pointer to fma block for our mailbox */
        gni_smsg_attr_t     gnpr_smsg_attr;     /* my short msg. attributes */
        spinlock_t          gnc_tx_lock;        /* protect tx alloc/free */
-       __u8                gnc_tx_bits[GNILND_MAX_MSG_ID/8]; /* bit table for tx id */
+       unsigned long       gnc_tx_bits[(GNILND_MAX_MSG_ID/8)/sizeof(unsigned long)]; /* bit table for tx id */
        int                 gnc_next_tx;        /* next tx to use in tx_ref_table */
        kgn_tx_t          **gnc_tx_ref_table;   /* table of TX descriptors for this conn */
        int                 gnc_mbox_id;        /* id of mbox in fma_blk                 */
@@ -791,7 +793,7 @@ typedef struct kgn_peer {
        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 */
@@ -808,7 +810,7 @@ typedef struct kgn_peer {
 typedef struct kgn_rx {
        kgn_conn_t              *grx_conn;      /* connection */
        kgn_msg_t               *grx_msg;       /* message */
-       lnet_msg_t              *grx_lntmsg;    /* lnet msg for this rx (eager only) */
+       struct lnet_msg              *grx_lntmsg;    /* lnet msg for this rx (eager only) */
        int                      grx_eager;     /* if eager, we copied msg to somewhere */
        struct timespec          grx_received;  /* time this msg received */
 } kgn_rx_t;
@@ -1769,8 +1771,8 @@ kgnilnd_find_net(lnet_nid_t nid, kgn_net_t **netp)
 
 int kgnilnd_dev_init(kgn_device_t *dev);
 void kgnilnd_dev_fini(kgn_device_t *dev);
-int kgnilnd_startup(lnet_ni_t *ni);
-void kgnilnd_shutdown(lnet_ni_t *ni);
+int kgnilnd_startup(struct lnet_ni *ni);
+void kgnilnd_shutdown(struct lnet_ni *ni);
 int kgnilnd_base_startup(void);
 void kgnilnd_base_shutdown(void);
 
@@ -1779,12 +1781,11 @@ int kgnilnd_map_phys_fmablk(kgn_device_t *device);
 void kgnilnd_unmap_fma_blocks(kgn_device_t *device);
 void kgnilnd_free_phys_fmablk(kgn_device_t *device);
 
-int kgnilnd_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg);
-void kgnilnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when);
-int kgnilnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg);
-int kgnilnd_eager_recv(lnet_ni_t *ni, void *private,
-                       lnet_msg_t *lntmsg, void **new_private);
-int kgnilnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg,
+int kgnilnd_ctl(struct lnet_ni *ni, unsigned int cmd, void *arg);
+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,
                unsigned int offset, unsigned int mlen, unsigned int rlen);
@@ -1816,7 +1817,7 @@ int kgnilnd_del_conn_or_peer(kgn_net_t *net, lnet_nid_t nid, int command, int er
 void kgnilnd_peer_increase_reconnect_locked(kgn_peer_t *peer);
 void kgnilnd_queue_reply(kgn_conn_t *conn, kgn_tx_t *tx);
 void kgnilnd_queue_tx(kgn_conn_t *conn, kgn_tx_t *tx);
-void kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, lnet_process_id_t *target);
+void kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net, struct lnet_process_id *target);
 int kgnilnd_send_mapped_tx(kgn_tx_t *tx, int try_map_if_full);
 void kgnilnd_consume_rx(kgn_rx_t *rx);