diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2020-01-08 20:05:32 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2020-01-16 15:55:45 -0400 |
commit | d680e88e2013186e696665cbf2056fb32b781e41 (patch) | |
tree | 128c1594619cc03189a6a67ca881afb5fa530aad /drivers/infiniband/core/uverbs_main.c | |
parent | f862308579752c75f491d6d84948d1befc29514d (diff) | |
download | linux-stable-d680e88e2013186e696665cbf2056fb32b781e41.tar.gz linux-stable-d680e88e2013186e696665cbf2056fb32b781e41.tar.bz2 linux-stable-d680e88e2013186e696665cbf2056fb32b781e41.zip |
RDMA/core: Add UVERBS_METHOD_ASYNC_EVENT_ALLOC
Allow the async FD to be allocated separately from the context.
This is necessary to introduce the ioctl to create a context, as an ioctl
should only ever create a single uobject at a time.
If multiple async FDs are created then the first one is used to deliver
affiliated events from any ib_uevent_object, with all subsequent ones will
receive only unaffiliated events.
Link: https://lore.kernel.org/r/1578506740-22188-3-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 'drivers/infiniband/core/uverbs_main.c')
-rw-r--r-- | drivers/infiniband/core/uverbs_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 1f279b0a8e49..fb9e75257607 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -475,7 +475,9 @@ void ib_uverbs_init_async_event_file( ib_uverbs_init_event_queue(&async_file->ev_queue); - if (!WARN_ON(uverbs_file->async_file)) { + /* The first async_event_file becomes the default one for the file. */ + lockdep_assert_held(&uverbs_file->ucontext_lock); + if (!uverbs_file->async_file) { /* Pairs with the put in ib_uverbs_release_file */ uverbs_uobject_get(&async_file->uobj); smp_store_release(&uverbs_file->async_file, async_file); |