aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_main.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2020-01-08 19:21:57 +0200
committerJason Gunthorpe <jgg@mellanox.com>2020-01-13 16:20:15 -0400
commit4ec1dcfcdf3756555adb5122c2443ea27741296a (patch)
treefddb2a2cf162ba8c20b91667027e3fe821059cd0 /drivers/infiniband/core/uverbs_main.c
parentRDMA/core: Do not allow alloc_commit to fail (diff)
downloadlinux-dev-4ec1dcfcdf3756555adb5122c2443ea27741296a.tar.xz
linux-dev-4ec1dcfcdf3756555adb5122c2443ea27741296a.zip
RDMA/core: Make ib_ucq_object use ib_uevent_object
Any uobject that sends events into the async_event_file should be using ib_uevent_object so it can use the standard uevent based helper functions. CQ pushes events into both the async_event and the comp_channel in an open coded way. Move the async events related stuff to ib_uevent_object. Link: https://lore.kernel.org/r/1578504126-9400-6-git-send-email-yishaih@mellanox.com Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/core/uverbs_main.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index da56fda259fd..940bb291a57d 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -150,12 +150,7 @@ void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
uverbs_uobject_put(&ev_file->uobj);
}
- spin_lock_irq(&file->async_file->ev_queue.lock);
- list_for_each_entry_safe(evt, tmp, &uobj->async_list, obj_list) {
- list_del(&evt->list);
- kfree(evt);
- }
- spin_unlock_irq(&file->async_file->ev_queue.lock);
+ ib_uverbs_release_uevent(file, &uobj->uevent);
}
void ib_uverbs_release_uevent(struct ib_uverbs_file *file,
@@ -413,7 +408,7 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
return;
}
- uobj = container_of(cq->uobject, struct ib_ucq_object, uobject);
+ uobj = container_of(cq->uobject, struct ib_ucq_object, uevent.uobject);
entry->desc.comp.cq_handle = cq->uobject->user_handle;
entry->counter = &uobj->comp_events_reported;
@@ -462,12 +457,12 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
void ib_uverbs_cq_event_handler(struct ib_event *event, void *context_ptr)
{
- struct ib_ucq_object *uobj = container_of(event->element.cq->uobject,
- struct ib_ucq_object, uobject);
+ struct ib_uevent_object *uobj = container_of(
+ event->element.cq->uobject, struct ib_uevent_object, uobject);
ib_uverbs_async_handler(uobj->uobject.ufile, uobj->uobject.user_handle,
- event->event, &uobj->async_list,
- &uobj->async_events_reported);
+ event->event, &uobj->event_list,
+ &uobj->events_reported);
}
void ib_uverbs_qp_event_handler(struct ib_event *event, void *context_ptr)