static inline struct ibv_qp *
ibv_create_qp_ex(struct ibv_context *context, struct ibv_qp_init_attr_ex *qp_init_attr_ex)
{
- struct verbs_context *vctx = verbs_get_ctx_op(context, create_qp_ex);
- if (!vctx) {
+ struct verbs_context *vctx;
+ uint32_t mask = qp_init_attr_ex->comp_mask;
+
+ if (!(mask & ~(IBV_QP_INIT_ATTR_PD)) && (mask & IBV_QP_INIT_ATTR_PD))
+ return ibv_create_qp(qp_init_attr_ex->pd,
+ (struct ibv_qp_init_attr *) qp_init_attr_ex);
+
+ if (!(vctx = verbs_get_ctx_op(context, create_qp_ex))) {
errno = ENOSYS;
return NULL;
}