Skip to contentSkip to conversation

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

PATCH In review Michael Margolin 2 participants 2 messages Apr 16 – Apr 17 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 584ec74748e6 ("RDMA/core: Prepare create CQ path for API unification")
---
 drivers/infiniband/core/uverbs_std_types_cq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/infiniband/core/uverbs_std_types_cq.c +1 -2
index d2c8f71f934c..79b51f60ce2a 100644
@@ -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;
 	}
Signature · 1 line
2.47.3
maintainer
#1 lore raw
Quoted 8 lines · Michael Margolin

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.

Quoted 5 lines
Fixes 584ec74748e6 ("RDMA/core: Prepare create CQ path for API unification")
---
 drivers/infiniband/core/uverbs_std_types_cq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied thanks!

Jason