Whamcloud - gitweb
convert uint64_t to __u64
[fs/lustre-release.git] / lnet / klnds / viblnd / viblnd_wire.h
index 3cb8d1f..26242c1 100644 (file)
@@ -12,10 +12,22 @@ typedef struct kib_connparams
 
 typedef struct
 {
-        ptl_hdr_t         ibim_hdr;             /* portals header */
+        lnet_hdr_t        ibim_hdr;             /* portals header */
         char              ibim_payload[0];      /* piggy-backed payload */
 } WIRE_ATTR kib_immediate_msg_t;
 
+#ifndef IBNAL_USE_FMR
+# error "IBNAL_USE_FMR must be defined 1 or 0 before including this file"
+#endif
+
+#if IBNAL_USE_FMR
+typedef struct
+{
+       __u64             rd_addr;              /* IO VMA address */
+       __u32             rd_nob;               /* # of bytes */
+       __u32             rd_key;               /* remote key */
+} WIRE_ATTR kib_rdma_desc_t;
+#else
 /* YEUCH! the __u64 address is split into 2 __u32 fields to ensure proper
  * packing.  Otherwise we can't fit enough frags into an IBNAL message (<=
  * smallest page size on any arch). */
@@ -32,13 +44,11 @@ typedef struct
         __u32             rd_nfrag;             /* # fragments */
         kib_rdma_frag_t   rd_frags[0];          /* buffer frags */
 } WIRE_ATTR kib_rdma_desc_t;
-
-/* CAVEAT EMPTOR!  We don't actually put ibprm_rd on the wire; it's just there
- * to remember the source buffers while we wait for the PUT_ACK */
+#endif
 
 typedef struct
 {
-        ptl_hdr_t         ibprm_hdr;            /* portals header */
+        lnet_hdr_t        ibprm_hdr;            /* portals header */
         __u64             ibprm_cookie;         /* opaque completion cookie */
 } WIRE_ATTR kib_putreq_msg_t;
 
@@ -51,7 +61,7 @@ typedef struct
 
 typedef struct
 {
-        ptl_hdr_t         ibgm_hdr;             /* portals header */
+        lnet_hdr_t        ibgm_hdr;             /* portals header */
         __u64             ibgm_cookie;          /* opaque completion cookie */
         kib_rdma_desc_t   ibgm_rd;              /* rdma descriptor */
 } WIRE_ATTR kib_get_msg_t;
@@ -88,8 +98,11 @@ typedef struct
         } WIRE_ATTR ibm_u;
 } WIRE_ATTR kib_msg_t;
 
-#define IBNAL_MSG_MAGIC       0x0be91b91        /* unique magic */
-#define IBNAL_MSG_VERSION              6        /* current protocol version */
+#define IBNAL_MSG_MAGIC LNET_PROTO_VIB_MAGIC   /* unique magic */
+
+#define IBNAL_MSG_VERSION_RDMAREPLYNOTRSRVD 0x10 /* previous version */
+
+#define IBNAL_MSG_VERSION           0x11       /* current version */
 
 #define IBNAL_MSG_CONNREQ           0xc0        /* connection request */
 #define IBNAL_MSG_CONNACK           0xc1        /* connection acknowledge */
@@ -101,3 +114,8 @@ typedef struct
 #define IBNAL_MSG_PUT_DONE          0xd5        /* completion (src->sink) */
 #define IBNAL_MSG_GET_REQ           0xd6        /* getreq (sink->src) */
 #define IBNAL_MSG_GET_DONE          0xd7        /* completion (src->sink: all OK) */
+
+/* connection rejection reasons */
+#define IBNAL_REJECT_CONN_RACE       0          /* You lost connection race */
+#define IBNAL_REJECT_NO_RESOURCES    1          /* Out of memory/conns etc */
+#define IBNAL_REJECT_FATAL           2          /* Anything else */