diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-11-28 13:16:43 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-12-03 14:58:25 -0500 |
commit | 606152107bbdbc0e21f25e0d15ef2787a4ab90fd (patch) | |
tree | 00a99cd545378fb77d8697229af2b2513372d96f /drivers/infiniband/core | |
parent | 61d69528689b96984970388b319b0c92f5679274 (diff) |
RDMA/restrack: Track ucontext
Add ability to track allocated ib_ucontext, which are limited
resource and worth to be visible by users.
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/restrack.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c index 06d8657ce583..3dd316159f5f 100644 --- a/drivers/infiniband/core/restrack.c +++ b/drivers/infiniband/core/restrack.c @@ -32,6 +32,7 @@ static const char *type2str(enum rdma_restrack_type type) [RDMA_RESTRACK_QP] = "QP", [RDMA_RESTRACK_CM_ID] = "CM_ID", [RDMA_RESTRACK_MR] = "MR", + [RDMA_RESTRACK_CTX] = "CTX", }; return names[type]; @@ -130,6 +131,8 @@ static struct ib_device *res_to_dev(struct rdma_restrack_entry *res) res)->id.device; case RDMA_RESTRACK_MR: return container_of(res, struct ib_mr, res)->device; + case RDMA_RESTRACK_CTX: + return container_of(res, struct ib_ucontext, res)->device; default: WARN_ONCE(true, "Wrong resource tracking type %u\n", res->type); return NULL; @@ -149,6 +152,8 @@ static bool res_is_user(struct rdma_restrack_entry *res) return !res->kern_name; case RDMA_RESTRACK_MR: return container_of(res, struct ib_mr, res)->pd->uobject; + case RDMA_RESTRACK_CTX: + return true; default: WARN_ONCE(true, "Wrong resource tracking type %u\n", res->type); return false; |