Whamcloud - gitweb
* "proper" fix for 5890: fixed the misplaced vibnal wire struct
authoreeb <eeb>
Fri, 18 Mar 2005 11:48:47 +0000 (11:48 +0000)
committereeb <eeb>
Fri, 18 Mar 2005 11:48:47 +0000 (11:48 +0000)
    __attribute__((packed)) statements, bumped wire protocol version and
    rebuilt wire struct assertions.

*   Added new vibnal_wire.h into autoMakefile.am

lnet/klnds/viblnd/autoMakefile.am
lnet/klnds/viblnd/viblnd.c
lnet/klnds/viblnd/viblnd_wire.h

index eb65412..6d5de4c 100644 (file)
@@ -12,4 +12,4 @@ endif
 endif
 
 MOSTLYCLEANFILES = *.o *.ko *.mod.c
 endif
 
 MOSTLYCLEANFILES = *.o *.ko *.mod.c
-DIST_SOURCES = $(kvibnal-objs:%.o=%.c) vibnal.h
+DIST_SOURCES = $(kvibnal-objs:%.o=%.c) vibnal.h vibnal_wire.h
index 73542fa..b89fc11 100644 (file)
@@ -128,7 +128,7 @@ void vibnal_assert_wire_constants (void)
         CLASSERT ((int)sizeof(((kib_get_msg_t *)0)->ibgm_rd) == 8);
 
         /* Checks for struct kib_completion_msg_t */
         CLASSERT ((int)sizeof(((kib_get_msg_t *)0)->ibgm_rd) == 8);
 
         /* Checks for struct kib_completion_msg_t */
-        CLASSERT ((int)sizeof(kib_completion_msg_t) == 16);
+        CLASSERT ((int)sizeof(kib_completion_msg_t) == 12);
         CLASSERT ((int)offsetof(kib_completion_msg_t, ibcm_cookie) == 0);
         CLASSERT ((int)sizeof(((kib_completion_msg_t *)0)->ibcm_cookie) == 8);
         CLASSERT ((int)offsetof(kib_completion_msg_t, ibcm_status) == 8);
         CLASSERT ((int)offsetof(kib_completion_msg_t, ibcm_cookie) == 0);
         CLASSERT ((int)sizeof(((kib_completion_msg_t *)0)->ibcm_cookie) == 8);
         CLASSERT ((int)offsetof(kib_completion_msg_t, ibcm_status) == 8);
@@ -169,7 +169,7 @@ void vibnal_assert_wire_constants (void)
         CLASSERT ((int)offsetof(kib_msg_t, ibm_u.get) == 56);
         CLASSERT ((int)sizeof(((kib_msg_t *)0)->ibm_u.get) == 88);
         CLASSERT ((int)offsetof(kib_msg_t, ibm_u.completion) == 56);
         CLASSERT ((int)offsetof(kib_msg_t, ibm_u.get) == 56);
         CLASSERT ((int)sizeof(((kib_msg_t *)0)->ibm_u.get) == 88);
         CLASSERT ((int)offsetof(kib_msg_t, ibm_u.completion) == 56);
-        CLASSERT ((int)sizeof(((kib_msg_t *)0)->ibm_u.completion) == 16);
+        CLASSERT ((int)sizeof(((kib_msg_t *)0)->ibm_u.completion) == 12);
 }
 
 void
 }
 
 void
index cd1ba5f..3cb8d1f 100644 (file)
@@ -8,13 +8,13 @@ typedef struct kib_connparams
         __u32             ibcp_queue_depth;
         __u32             ibcp_max_msg_size;
         __u32             ibcp_max_frags;
         __u32             ibcp_queue_depth;
         __u32             ibcp_max_msg_size;
         __u32             ibcp_max_frags;
-} kib_connparams_t __attribute__((packed));
+} WIRE_ATTR kib_connparams_t;
 
 typedef struct
 {
         ptl_hdr_t         ibim_hdr;             /* portals header */
         char              ibim_payload[0];      /* piggy-backed payload */
 
 typedef struct
 {
         ptl_hdr_t         ibim_hdr;             /* portals header */
         char              ibim_payload[0];      /* piggy-backed payload */
-} kib_immediate_msg_t __attribute__((packed));
+} WIRE_ATTR kib_immediate_msg_t;
 
 /* 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 (<=
 
 /* 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 (<=
@@ -24,14 +24,14 @@ typedef struct
         __u32             rf_nob;               /* # of bytes */
         __u32             rf_addr_lo;           /* lo 4 bytes of vaddr */
         __u32             rf_addr_hi;           /* hi 4 bytes of vaddr */
         __u32             rf_nob;               /* # of bytes */
         __u32             rf_addr_lo;           /* lo 4 bytes of vaddr */
         __u32             rf_addr_hi;           /* hi 4 bytes of vaddr */
-} kib_rdma_frag_t __attribute__((packed));
+} WIRE_ATTR kib_rdma_frag_t;
 
 typedef struct
 {
         __u32             rd_key;               /* local/remote key */
         __u32             rd_nfrag;             /* # fragments */
         kib_rdma_frag_t   rd_frags[0];          /* buffer frags */
 
 typedef struct
 {
         __u32             rd_key;               /* local/remote key */
         __u32             rd_nfrag;             /* # fragments */
         kib_rdma_frag_t   rd_frags[0];          /* buffer frags */
-} kib_rdma_desc_t __attribute__((packed));
+} 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 */
 
 /* 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 */
@@ -40,28 +40,27 @@ typedef struct
 {
         ptl_hdr_t         ibprm_hdr;            /* portals header */
         __u64             ibprm_cookie;         /* opaque completion cookie */
 {
         ptl_hdr_t         ibprm_hdr;            /* portals header */
         __u64             ibprm_cookie;         /* opaque completion cookie */
-} kib_putreq_msg_t __attribute__((packed));
+} WIRE_ATTR kib_putreq_msg_t;
 
 typedef struct
 {
         __u64             ibpam_src_cookie;     /* reflected completion cookie */
         __u64             ibpam_dst_cookie;     /* opaque completion cookie */
         kib_rdma_desc_t   ibpam_rd;             /* sender's sink buffer */
 
 typedef struct
 {
         __u64             ibpam_src_cookie;     /* reflected completion cookie */
         __u64             ibpam_dst_cookie;     /* opaque completion cookie */
         kib_rdma_desc_t   ibpam_rd;             /* sender's sink buffer */
-} kib_putack_msg_t __attribute__((packed));
+} WIRE_ATTR kib_putack_msg_t;
 
 typedef struct
 {
         ptl_hdr_t         ibgm_hdr;             /* portals header */
         __u64             ibgm_cookie;          /* opaque completion cookie */
         kib_rdma_desc_t   ibgm_rd;              /* rdma descriptor */
 
 typedef struct
 {
         ptl_hdr_t         ibgm_hdr;             /* portals header */
         __u64             ibgm_cookie;          /* opaque completion cookie */
         kib_rdma_desc_t   ibgm_rd;              /* rdma descriptor */
-} kib_get_msg_t __attribute__((packed));
+} WIRE_ATTR kib_get_msg_t;
 
 typedef struct
 {
         __u64             ibcm_cookie;          /* opaque completion cookie */
         __s32             ibcm_status;          /* < 0 failure: >= 0 length */
 
 typedef struct
 {
         __u64             ibcm_cookie;          /* opaque completion cookie */
         __s32             ibcm_status;          /* < 0 failure: >= 0 length */
-       __u32             ibcm_pad;             /* pad to 8 byte boundary */
-} kib_completion_msg_t __attribute__((packed));
+} WIRE_ATTR kib_completion_msg_t;
 
 typedef struct
 {
 
 typedef struct
 {
@@ -86,11 +85,11 @@ typedef struct
                 kib_putack_msg_t      putack;
                 kib_get_msg_t         get;
                 kib_completion_msg_t  completion;
                 kib_putack_msg_t      putack;
                 kib_get_msg_t         get;
                 kib_completion_msg_t  completion;
-        } ibm_u __attribute__((packed));
-} kib_msg_t __attribute__((packed));
+        } WIRE_ATTR ibm_u;
+} WIRE_ATTR kib_msg_t;
 
 #define IBNAL_MSG_MAGIC       0x0be91b91        /* unique magic */
 
 #define IBNAL_MSG_MAGIC       0x0be91b91        /* unique magic */
-#define IBNAL_MSG_VERSION              5        /* current protocol version */
+#define IBNAL_MSG_VERSION              6        /* current protocol version */
 
 #define IBNAL_MSG_CONNREQ           0xc0        /* connection request */
 #define IBNAL_MSG_CONNACK           0xc1        /* connection acknowledge */
 
 #define IBNAL_MSG_CONNREQ           0xc0        /* connection request */
 #define IBNAL_MSG_CONNACK           0xc1        /* connection acknowledge */