diff options
author | Vipul Pandya <vipul@chelsio.com> | 2012-05-18 11:59:27 +0200 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-05-18 22:22:29 +0200 |
commit | 8d81ef34b249109084b2f3c4bb826d0417ef5814 (patch) | |
tree | 77dbd13539db2053cada804c35e4cccd26f4e4c0 /drivers/infiniband/hw/cxgb4/provider.c | |
parent | cxgb4: DB Drop Recovery for RDMA and LLD queues (diff) | |
download | linux-8d81ef34b249109084b2f3c4bb826d0417ef5814.tar.xz linux-8d81ef34b249109084b2f3c4bb826d0417ef5814.zip |
RDMA/cxgb4: Add debugfs RDMA memory stats
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/provider.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/provider.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index be1c18f44400..8d58736f9b4f 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -190,6 +190,9 @@ static int c4iw_deallocate_pd(struct ib_pd *pd) PDBG("%s ibpd %p pdid 0x%x\n", __func__, pd, php->pdid); c4iw_put_resource(&rhp->rdev.resource.pdid_fifo, php->pdid, &rhp->rdev.resource.pdid_fifo_lock); + mutex_lock(&rhp->rdev.stats.lock); + rhp->rdev.stats.pd.cur--; + mutex_unlock(&rhp->rdev.stats.lock); kfree(php); return 0; } @@ -222,6 +225,11 @@ static struct ib_pd *c4iw_allocate_pd(struct ib_device *ibdev, return ERR_PTR(-EFAULT); } } + mutex_lock(&rhp->rdev.stats.lock); + rhp->rdev.stats.pd.cur++; + if (rhp->rdev.stats.pd.cur > rhp->rdev.stats.pd.max) + rhp->rdev.stats.pd.max = rhp->rdev.stats.pd.cur; + mutex_unlock(&rhp->rdev.stats.lock); PDBG("%s pdid 0x%0x ptr 0x%p\n", __func__, pdid, php); return &php->ibpd; } |