aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/verbs.c
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2018-01-28 11:17:22 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-01-29 20:21:40 -0700
commit08f294a1524bc3211a28091daa6c7513828c7d33 (patch)
tree0c8e359ef99f869ac67427de46dc3c5468f39040 /drivers/infiniband/core/verbs.c
parentRDMA/core: Add resource tracking for create and destroy QPs (diff)
downloadlinux-dev-08f294a1524bc3211a28091daa6c7513828c7d33.tar.xz
linux-dev-08f294a1524bc3211a28091daa6c7513828c7d33.zip
RDMA/core: Add resource tracking for create and destroy CQs
Track create and destroy operations of CQ 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 '')
-rw-r--r--drivers/infiniband/core/verbs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 5324cf4788d0..8cb5c850828d 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1579,6 +1579,8 @@ struct ib_cq *ib_create_cq(struct ib_device *device,
cq->event_handler = event_handler;
cq->cq_context = cq_context;
atomic_set(&cq->usecnt, 0);
+ cq->res.type = RDMA_RESTRACK_CQ;
+ rdma_restrack_add(&cq->res);
}
return cq;
@@ -1597,6 +1599,7 @@ int ib_destroy_cq(struct ib_cq *cq)
if (atomic_read(&cq->usecnt))
return -EBUSY;
+ rdma_restrack_del(&cq->res);
return cq->device->destroy_cq(cq);
}
EXPORT_SYMBOL(ib_destroy_cq);