From 6384ce80e0ff710e4fe24a782cdd6069afc13435 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Fri, 29 May 2015 11:24:26 -0700 Subject: [PATCH] rsockets: Delay initializing buffers until the inline size is known The qib HCA ignores the requested max_inline_size on input and instead returns the supported value on output. As a result, the default inline size requested by rsockets is ignored, with 0 being returned. The code catches this after it creates the QP, but has already initialized its data buffers prior to creating the QP. The result is that the inline size used in rs_init_bufs() is larger than that supported by the qib device. This causes a failure when attempting to update available receive buffer space. The registered data buffer for the credit message is smaller than what is needed. Work-around this issue by delaying the initialization of the data buffers until after the QP has been created and the real size of the inline data is known. Signed-off-by: Sean Hefty --- src/rsocket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rsocket.c b/src/rsocket.c index bcb253ec..95d791c6 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -839,10 +839,6 @@ static int rs_create_ep(struct rsocket *rs) rs_set_qp_size(rs); if (rs->cm_id->verbs->device->transport_type == IBV_TRANSPORT_IWARP) rs->opts |= RS_OPT_MSG_SEND; - ret = rs_init_bufs(rs); - if (ret) - return ret; - ret = rs_create_cq(rs, rs->cm_id); if (ret) return ret; @@ -867,6 +863,10 @@ static int rs_create_ep(struct rsocket *rs) if ((rs->opts & RS_OPT_MSG_SEND) && (rs->sq_inline < RS_MSG_SIZE)) return ERR(ENOTSUP); + ret = rs_init_bufs(rs); + if (ret) + return ret; + for (i = 0; i < rs->rq_size; i++) { ret = rs_post_recv(rs); if (ret) -- 2.41.0