summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_std_types_cq.c
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2020-05-19 10:27:07 +0300
committerJason Gunthorpe <jgg@mellanox.com>2020-05-21 20:34:53 -0300
commitcda9ee494248b890973f5d31cf7851c0d21755b9 (patch)
tree7fc742f2de7f1dba4a7a101fa4145a6bfcb71cd9 /drivers/infiniband/core/uverbs_std_types_cq.c
parent98a8890f73489416a1ea49a644565a244d3f729a (diff)
downloadlinux-cda9ee494248b890973f5d31cf7851c0d21755b9.tar.bz2
IB/uverbs: Extend CQ to get its own asynchronous event FD
Extend CQ to get its own asynchronous event FD. The event FD is an optional attribute, in case wasn't given the ufile event FD will be used. Link: https://lore.kernel.org/r/20200519072711.257271-4-leon@kernel.org Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_std_types_cq.c')
-rw-r--r--drivers/infiniband/core/uverbs_std_types_cq.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types_cq.c b/drivers/infiniband/core/uverbs_std_types_cq.c
index be534b0af4f8..5dce2c7cc323 100644
--- a/drivers/infiniband/core/uverbs_std_types_cq.c
+++ b/drivers/infiniband/core/uverbs_std_types_cq.c
@@ -100,9 +100,8 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(
uverbs_uobject_get(ev_file_uobj);
}
- obj->uevent.event_file = READ_ONCE(attrs->ufile->default_async_file);
- if (obj->uevent.event_file)
- uverbs_uobject_get(&obj->uevent.event_file->uobj);
+ obj->uevent.event_file = ib_uverbs_get_async_event(
+ attrs, UVERBS_ATTR_CREATE_CQ_EVENT_FD);
if (attr.comp_vector >= attrs->ufile->device->num_comp_vectors) {
ret = -EINVAL;
@@ -173,6 +172,10 @@ DECLARE_UVERBS_NAMED_METHOD(
UVERBS_ATTR_PTR_OUT(UVERBS_ATTR_CREATE_CQ_RESP_CQE,
UVERBS_ATTR_TYPE(u32),
UA_MANDATORY),
+ UVERBS_ATTR_FD(UVERBS_ATTR_CREATE_CQ_EVENT_FD,
+ UVERBS_OBJECT_ASYNC_EVENT,
+ UVERBS_ACCESS_READ,
+ UA_OPTIONAL),
UVERBS_ATTR_UHW());
static int UVERBS_HANDLER(UVERBS_METHOD_CQ_DESTROY)(