diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-01-28 12:17:22 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-01-30 06:21:40 +0300 |
commit | 08f294a1524bc3211a28091daa6c7513828c7d33 (patch) | |
tree | 0c8e359ef99f869ac67427de46dc3c5468f39040 /drivers/infiniband/core/verbs.c | |
parent | 78a0cd648a802450602c95e164a820fe1a165247 (diff) | |
download | linux-08f294a1524bc3211a28091daa6c7513828c7d33.tar.xz |
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 'drivers/infiniband/core/verbs.c')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 3 |
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); |