diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-01-28 12:17:23 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-01-30 06:21:40 +0300 |
commit | 9d5f8c209b3f29259e6aa9595ea2dc2dfa27549a (patch) | |
tree | 6bdc05684a43f7b9df193dbcb778b3726526291d /drivers/infiniband/core/verbs.c | |
parent | 08f294a1524bc3211a28091daa6c7513828c7d33 (diff) | |
download | linux-9d5f8c209b3f29259e6aa9595ea2dc2dfa27549a.tar.xz |
RDMA/core: Add resource tracking for create and destroy PDs
Track create and destroy operations of PD objects.
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/verbs.c')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 8cb5c850828d..16ebc6372c31 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -263,6 +263,10 @@ struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags, mr_access_flags |= IB_ACCESS_REMOTE_READ | IB_ACCESS_REMOTE_WRITE; } + pd->res.type = RDMA_RESTRACK_PD; + pd->res.kern_name = caller; + rdma_restrack_add(&pd->res); + if (mr_access_flags) { struct ib_mr *mr; @@ -312,6 +316,7 @@ void ib_dealloc_pd(struct ib_pd *pd) requires the caller to guarantee we can't race here. */ WARN_ON(atomic_read(&pd->usecnt)); + rdma_restrack_del(&pd->res); /* Making delalloc_pd a void return is a WIP, no driver should return an error here. */ ret = pd->device->dealloc_pd(pd); |