Whamcloud - gitweb
LU-16548 lnet: report actual timeout used by lnd
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd.h
index f307b79..bb1ccd7 100644 (file)
@@ -411,13 +411,13 @@ typedef struct {
 } __packed kgn_rdma_desc_t;
 
 typedef struct {
-       struct lnet_hdr   gnim_hdr;             /* LNet header */
+       struct lnet_hdr_nid4    gnim_hdr;       /* LNet header */
        /* LNet payload is in FMA "Message Data" */
 } __packed kgn_immediate_msg_t;
 
 typedef struct {
-       struct lnet_hdr   gnprm_hdr;            /* LNet header */
-       __u64             gnprm_cookie;         /* opaque completion cookie */
+       struct lnet_hdr_nid4    gnprm_hdr;      /* LNet header */
+       __u64                   gnprm_cookie;   /* opaque completion cookie */
 } __packed kgn_putreq_msg_t;
 
 typedef struct {
@@ -428,10 +428,10 @@ typedef struct {
 } __packed kgn_putack_msg_t;
 
 typedef struct {
-       struct lnet_hdr   gngm_hdr;             /* LNet header */
-       __u64             gngm_cookie;          /* opaque completion cookie */
-       __u16             gngm_payload_cksum;   /* checksum for put msg */
-       kgn_rdma_desc_t   gngm_desc;            /* sender's sink buffer */
+       struct lnet_hdr_nid4    gngm_hdr;       /* LNet header */
+       __u64                   gngm_cookie;    /* opaque completion cookie */
+       __u16                   gngm_payload_cksum; /* checksum for put msg */
+       kgn_rdma_desc_t         gngm_desc;      /* sender's sink buffer */
 } __packed kgn_get_msg_t;
 
 typedef struct {
@@ -898,6 +898,13 @@ extern void kgnilnd_destroy_conn(kgn_conn_t *conn);
 extern int _kgnilnd_schedule_conn(kgn_conn_t *conn, const char *caller, int line, int refheld, int lock_held);
 extern int _kgnilnd_schedule_delay_conn(kgn_conn_t *conn);
 
+static inline int kgnilnd_timeout(void)
+{
+       return *kgnilnd_tunables.kgn_timeout ?
+              *kgnilnd_tunables.kgn_timeout :
+              lnet_get_lnd_timeout();
+}
+
 /* Macro wrapper for _kgnilnd_schedule_conn. This will store the function
  * and the line of the calling function to allow us to debug problematic
  * schedule calls in the future without the programmer having to mark
@@ -1004,13 +1011,13 @@ static inline void *kgnilnd_vzalloc(int size)
        else
                ret = __ll_vmalloc(size, __GFP_HIGHMEM | GFP_NOIO | __GFP_ZERO);
 
-       LIBCFS_ALLOC_POST(ret, size);
+       LIBCFS_ALLOC_POST(ret, size, "alloc");
        return ret;
 }
 
 static inline void kgnilnd_vfree(void *ptr, int size)
 {
-       libcfs_kmem_dec(ptr, size);
+       LIBCFS_FREE_PRE(ptr, size, "vfree");
        vfree(ptr);
 }
 
@@ -1818,7 +1825,8 @@ 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, struct lnet_process_id *target);
+void kgnilnd_launch_tx(kgn_tx_t *tx, kgn_net_t *net,
+                      struct lnet_processid *target);
 int kgnilnd_send_mapped_tx(kgn_tx_t *tx, int try_map_if_full);
 void kgnilnd_consume_rx(kgn_rx_t *rx);