]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: small spec compliancy fixes in code
authorAmir Vadai <amirv@mellanox.co.il>
Sun, 13 Dec 2009 07:52:16 +0000 (09:52 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:44 +0000 (05:04 -0700)
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp.h
drivers/infiniband/ulp/sdp/sdp_cma.c

index 09bea871135220512ba49ea29cd339f6df92c500..8af80dea46f41485a99f229d438ff79ea5e71947 100644 (file)
@@ -8,6 +8,7 @@
 #include <rdma/ib_verbs.h>
 #include <linux/sched.h>
 #include <rdma/rdma_cm.h>
+#include <rdma/ib_cm.h>
 #include "sdp_dbg.h"
 
 /* Interval between sucessive polls in the Tx routine when polling is used
@@ -140,7 +141,7 @@ struct sdp_bsdh {
        __u32 len;
        __u32 mseq;
        __u32 mseq_ack;
-};
+} __attribute__((__packed__));
 
 union cma_ip_addr {
        struct in6_addr ip6;
@@ -148,7 +149,7 @@ union cma_ip_addr {
                __u32 pad[3];
                __u32 addr;
        } ip4;
-};
+} __attribute__((__packed__));
 
 /* TODO: too much? Can I avoid having the src/dst and port here? */
 struct sdp_hh {
@@ -163,7 +164,8 @@ struct sdp_hh {
        __u16 rsvd2;
        union cma_ip_addr src_addr;
        union cma_ip_addr dst_addr;
-};
+       u8 rsvd3[IB_CM_REQ_PRIVATE_DATA_SIZE - sizeof(struct sdp_bsdh) - 48];
+} __attribute__((__packed__));
 
 struct sdp_hah {
        struct sdp_bsdh bsdh;
@@ -172,27 +174,27 @@ struct sdp_hah {
        u8 rsvd1;
        u8 ext_max_adverts;
        __u32 actrcvsz;
-       u8 rsvd2[172]; /* was 156 on SDP 1.0 */
-};
+       u8 rsvd2[IB_CM_REP_PRIVATE_DATA_SIZE - sizeof(struct sdp_bsdh) - 8];
+} __attribute__((__packed__));
 
 struct sdp_rrch {
        __u32 len;
-};
+} __attribute__((__packed__));
 
 struct sdp_srcah {
        __u32 len;
        __u32 rkey;
        __u64 vaddr;
-};
+} __attribute__((__packed__));
 
 struct sdp_buf {
         struct sk_buff *skb;
         u64             mapping[SDP_MAX_SEND_SKB_FRAGS + 1];
-};
+} __attribute__((__packed__));
 
 struct sdp_chrecvbuf {
        u32 size;
-};
+} __attribute__((__packed__));
 
 /* Context used for synchronous zero copy bcopy (BZCOPY) */
 struct bzcopy_state {
index 5ad54963817918127f676bd954291d0c309c7bf0..cf69d9bb91d96e0bd6146a97cef90572a678d8bc 100644 (file)
@@ -344,9 +344,9 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                                rx_ring_posted(sdp_sk(sk)));
                memset(&hh, 0, sizeof hh);
                hh.bsdh.mid = SDP_MID_HELLO;
-               hh.bsdh.len = htonl(sizeof(struct sdp_bsdh) +
-                               sizeof(struct sdp_hh));
+               hh.bsdh.len = htonl(sizeof(struct sdp_hh));
                hh.max_adverts = 1;
+               hh.ipv_cap = 0x40;
                hh.majv_minv = SDP_MAJV_MINV;
                sdp_init_buffers(sdp_sk(sk), rcvbuf_initial_size);
                hh.bsdh.bufs = htons(rx_ring_posted(sdp_sk(sk)));
@@ -382,8 +382,7 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                memset(&hah, 0, sizeof hah);
                hah.bsdh.mid = SDP_MID_HELLO_ACK;
                hah.bsdh.bufs = htons(rx_ring_posted(sdp_sk(child)));
-               hah.bsdh.len = htonl(sizeof(struct sdp_bsdh) +
-                               sizeof(struct sdp_hah));
+               hah.bsdh.len = htonl(sizeof(struct sdp_hah));
                hah.majv_minv = SDP_MAJV_MINV;
                hah.ext_max_adverts = 1; /* Doesn't seem to be mandated by spec,
                                            but just in case */