Commit 9091e3b5 authored by Michael Margolin's avatar Michael Margolin Committed by Jason Gunthorpe
Browse files

RDMA/core: Fix user CQ creation for drivers without create_cq

CQ creation is failing for drivers that only implement create_user_cq
(e.g. EFA), when buffer isn't provided by userspace. This because of a
leftover check that requires create_cq existence in such case.

Remove the create_cq existence check from the no-buffer path. The
buffer is optional and drivers that handle their own memory should work
through create_user_cq regardless.

Fixes: 584ec747 ("RDMA/core: Prepare create CQ path for API unification")
Link: https://patch.msgid.link/r/20260416201408.13980-1-mrgolin@amazon.com


Signed-off-by: default avatarMichael Margolin <mrgolin@amazon.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 654a27f2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -172,8 +172,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(
		}
		umem = &umem_dmabuf->umem;
	} else if (uverbs_attr_is_valid(attrs, UVERBS_ATTR_CREATE_CQ_BUFFER_OFFSET) ||
		   uverbs_attr_is_valid(attrs, UVERBS_ATTR_CREATE_CQ_BUFFER_LENGTH) ||
		   !ib_dev->ops.create_cq) {
		   uverbs_attr_is_valid(attrs, UVERBS_ATTR_CREATE_CQ_BUFFER_LENGTH)) {
		ret = -EINVAL;
		goto err_event_file;
	}