The comments and documentation for rdma_create_ep indicate that
it will only allocate a QP if initial QP attributes are provided.
However, the code always attempts to create a QP off an
active rdma_cm_id endpoint.
By _not_ allocating the QP, a user can first determine
what RDMA device an rdma_cm_id was associated with (returned from
rdma_create_ep). The user can then call rdma_create_qp to
allocate a QP referencing an existing CQ, SRQ, or PD.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
if (ret)\r
goto err;\r
\r
- qp_init_attr->qp_type = (enum ibv_qp_type) res->ai_qp_type;\r
- ret = rdma_create_qp(cm_id, pd, qp_init_attr);\r
- if (ret)\r
- goto err;\r
+ if (qp_init_attr) {\r
+ qp_init_attr->qp_type = (enum ibv_qp_type) res->ai_qp_type;\r
+ ret = rdma_create_qp(cm_id, pd, qp_init_attr);\r
+ if (ret)\r
+ goto err;\r
+ }\r
\r
out:\r
*id = cm_id;\r