]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
rsocket: Check max inline data after creating QP
authorSean Hefty <sean.hefty@intel.com>
Thu, 17 Apr 2014 04:42:06 +0000 (21:42 -0700)
committerSean Hefty <sean.hefty@intel.com>
Thu, 17 Apr 2014 04:42:06 +0000 (21:42 -0700)
The ipath provider will ignore the max_inline_size
specified as input into ibv_create_qp and instead
return the size that it supports (which is 0) on
output.

Update the actual inline size returned from create QP,
and check that it meets the minimum requirement for
rsockets.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/cma.c
src/rsocket.c

index 0dc229e2eeb718004d222e543566648d0e3f8ffe..4fa41ff861d6712406de906535a3830e5016ffa7 100644 (file)
--- a/src/cma.c
+++ b/src/cma.c
@@ -321,7 +321,7 @@ err:
        return ret;
 }
 
-int ucma_init_all(void)
+static int ucma_init_all(void)
 {
        int i, ret = 0;
 
index 30ea55ddcd874fd1d2a4047c28f3fa9e6b0a9a4c..8325edfb2704580a49aa172a4ffc5218277f5db7 100644 (file)
@@ -860,6 +860,10 @@ static int rs_create_ep(struct rsocket *rs)
        if (ret)
                return ret;
 
+       rs->sq_inline = qp_attr->cap.max_inline_size;
+       if (rs->sq_inline < RS_MIN_INLINE)
+               return ERR(EINVAL);
+
        for (i = 0; i < rs->rq_size; i++) {
                ret = rs_post_recv(rs);
                if (ret)
@@ -1491,6 +1495,12 @@ static int ds_create_qp(struct rsocket *rs, union socket_addr *src_addr,
        if (ret)
                goto err;
 
+       rs->sq_inline = qp_attr.cap.max_inline_data;
+       if (rs->sq_inline < RS_MIN_INLINE) {
+               ret = ERR(ENOMEM);
+               goto err;
+       }
+
        ret = ds_add_qp_dest(qp, src_addr, addrlen);
        if (ret)
                goto err;