Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12d23a91 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Doug Ledford
Browse files

RDMA/uverbs: Annotate alloc/deallloc paths with context tracking



Add restrack annotations to track allocations of ucontexts.

Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 60615210
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -820,6 +820,8 @@ static void ufile_destroy_ucontext(struct ib_uverbs_file *ufile,
	ib_rdmacg_uncharge(&ucontext->cg_obj, ib_dev,
			   RDMACG_RESOURCE_HCA_HANDLE);

	rdma_restrack_del(&ucontext->res);

	/*
	 * FIXME: Drivers are not permitted to fail dealloc_ucontext, remove
	 * the error return.
+3 −0
Original line number Diff line number Diff line
@@ -259,6 +259,9 @@ static int ib_uverbs_get_context(struct uverbs_attr_bundle *attrs)

	fd_install(resp.async_fd, filp);

	ucontext->res.type = RDMA_RESTRACK_CTX;
	rdma_restrack_add(&ucontext->res);

	/*
	 * Make sure that ib_uverbs_get_ucontext() sees the pointer update
	 * only after all writes to setup the ucontext have completed