qp_create.cap.max_send_wr, qp_create.cap.max_send_sge,
qp_create.cap.max_recv_wr, qp_create.cap.max_recv_sge);
- dapli_mix_qp_create(ep_ptr->qp_handle, &qp_create, req_cq, rcv_cq);
+ ret = dapli_mix_qp_create(ep_ptr->qp_handle, &qp_create, req_cq, rcv_cq);
+ if (ret)
+ goto err;
} else {
/* NON-MIC: need QPt, in case of shadowed QP's from MIC's */
qp_create.cap.max_recv_wr = 1;
ret = scif_send(mix_ep, &msg, len, SCIF_SEND_BLOCK);
if (ret != len) {
dapl_log(1, " ERR: send on %d, ret %d, exp %d, error %s\n", mix_ep, ret, len, strerror(errno));
+ return EFAULT;
}
dapl_log(DAPL_DBG_TYPE_EXTENSION," Sent %s request on SCIF EP\n", mix_op_str(msg.hdr.op));
ret = scif_recv(mix_ep, &msg, len, SCIF_RECV_BLOCK);
if (ret != len) {
dapl_log(1, " ERR: rcv on new_ep %d, ret %d, exp %d, error %s\n", mix_ep, ret, len, strerror(errno));
- return -1;
+ return EFAULT;
}
if (msg.hdr.ver != DAT_MIX_VER || msg.hdr.op != MIX_QP_CREATE ||
msg.hdr.flags != MIX_OP_RSP || msg.hdr.status != MIX_SUCCESS) {
dapl_log(1, " MIX msg ver %d, op %d, flags %d, or stat %d ERR \n",
msg.hdr.ver, msg.hdr.op, msg.hdr.flags, msg.hdr.status);
- return -1;
+ if (msg.hdr.status)
+ return msg.hdr.status;
+ else
+ return EINVAL;
}
/* save QP_t id, ctx, and proxy buffer and wr pools. used on post_writes */
/* Find the CM and EP for event processing */
cm = dapli_mix_get_cm(tp, pmsg->cm_ctx);
if (!cm) {
- dapl_log(DAPL_DBG_TYPE_ERR, " ERR: mcm_get_cm, ctx %p, not found\n", pmsg->cm_ctx);
+ dapl_log(DAPL_DBG_TYPE_CM_WARN, " mcm_get_cm, ctx %p, not found\n", pmsg->cm_ctx);
return -1;
}
*new_mqp = m_qp;
return 0;
err:
+ ret = errno;
destroy_mbuf_pool(m_qp);
destroy_wrbuf_pool(m_qp);
if (m_qp)
free(m_qp);
- return -1;
+ return ret;
}
/* create new proxy QP */
ret = scif_recv(smd->scif_ep, ((char*)pmsg + sizeof(dat_mix_hdr_t)), len, SCIF_RECV_BLOCK);
if (ret != len) {
mlog(0, " ERR: ret %d, exp %d\n", ret, len);
- return ret;
+ return -1;
}
mlog(1, " QP_r - qpn 0x%x, ctx %p, rq %d,%d sq %d,%d rcq_id %d\n",
qp_create.cap.max_recv_sge = pmsg->qp_t.max_recv_sge;
qp_create.cap.max_send_wr = pmsg->qp_t.max_send_wr * (mix_max_msg_mb*1024*1024/mix_buffer_sg);
qp_create.cap.max_send_sge = pmsg->qp_t.max_send_sge;
- qp_create.cap.max_inline_data = pmsg->qp_t.max_inline_data;
+ qp_create.cap.max_inline_data = 0; /* better bandwidth without inline */
qp_create.qp_type = IBV_QPT_RC;
- if (m_qp_create(smd, &qp_create, pmsg->qp_t.scq_id, &new_mqp))
- goto err;
+ mlog(1, " QP_t - max_wr %d adjusted for segmentation\n",
+ pmsg->qp_t.max_send_wr, pmsg->qp_t.max_send_sge,
+ pmsg->qp_t.max_inline_data);
+
+ pmsg->hdr.status = m_qp_create(smd, &qp_create, pmsg->qp_t.scq_id, &new_mqp);
+ if (pmsg->hdr.status)
+ goto resp;
/* return QPt info to MIC client, insert on QP list */
memcpy(&pmsg->qp_t, &new_mqp->qp_t, sizeof(dat_mix_qp_attr_t));
pmsg->qp_t.max_send_sge, pmsg->qp_t.max_recv_wr,
pmsg->qp_t.max_recv_sge);
- goto resp;
-err:
- mlog(0, " ERR: %s\n", strerror(errno));
- pmsg->hdr.status = MIX_EINVAL;
resp:
/* send back response */
pmsg->hdr.flags = MIX_OP_RSP;