linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Leon Romanovsky <leonro@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Erez Alfasi <ereza@mellanox.com>
Subject: Re: [PATCH rdma-next v2 4/4] RDMA/nldev: Provide MR statistics
Date: Wed, 9 Oct 2019 14:40:16 +0000	[thread overview]
Message-ID: <20191009144012.GJ22714@mellanox.com> (raw)
In-Reply-To: <20191006155139.30632-5-leon@kernel.org>

On Sun, Oct 06, 2019 at 06:51:39PM +0300, Leon Romanovsky wrote:
> From: Erez Alfasi <ereza@mellanox.com>
> 
> Add RDMA nldev netlink interface for dumping MR
> statistics information.
> 
> Output example:
> ereza@dev~$: ./ibv_rc_pingpong -o -P -s 500000000
>   local address:  LID 0x0001, QPN 0x00008a, PSN 0xf81096, GID ::
> 
> ereza@dev~$: rdma stat show mr
> dev mlx5_0 mrn 2 page_faults 122071 page_invalidations 0
> prefetched_pages 122071
> 
> Signed-off-by: Erez Alfasi <ereza@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>  drivers/infiniband/core/device.c      |  1 +
>  drivers/infiniband/core/nldev.c       | 41 ++++++++++++++++++++++---
>  drivers/infiniband/hw/mlx5/main.c     |  2 ++
>  drivers/infiniband/hw/mlx5/mlx5_ib.h  |  2 ++
>  drivers/infiniband/hw/mlx5/restrack.c | 44 +++++++++++++++++++++++++++
>  include/rdma/ib_verbs.h               |  7 +++++
>  include/rdma/restrack.h               |  3 ++
>  7 files changed, 96 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> index a667636f74bf..2e53aa25f0c7 100644
> +++ b/drivers/infiniband/core/device.c
> @@ -2606,6 +2606,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
>  	SET_DEVICE_OP(dev_ops, drain_sq);
>  	SET_DEVICE_OP(dev_ops, enable_driver);
>  	SET_DEVICE_OP(dev_ops, fill_res_entry);
> +	SET_DEVICE_OP(dev_ops, fill_stat_entry);
>  	SET_DEVICE_OP(dev_ops, get_dev_fw_str);
>  	SET_DEVICE_OP(dev_ops, get_dma_mr);
>  	SET_DEVICE_OP(dev_ops, get_hw_stats);
> diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
> index 6114465959e1..1d9d89fd9ce9 100644
> +++ b/drivers/infiniband/core/nldev.c
> @@ -454,6 +454,14 @@ static bool fill_res_entry(struct ib_device *dev, struct sk_buff *msg,
>  	return dev->ops.fill_res_entry(msg, res);
>  }
>  
> +static bool fill_stat_entry(struct ib_device *dev, struct sk_buff *msg,
> +			    struct rdma_restrack_entry *res)
> +{
> +	if (!dev->ops.fill_stat_entry)
> +		return false;
> +	return dev->ops.fill_stat_entry(msg, res);
> +}

Why do we need this function called in only one place?

Jason

  reply	other threads:[~2019-10-09 14:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-06 15:51 [PATCH rdma-next v2 0/4] ODP information and statistics Leon Romanovsky
2019-10-06 15:51 ` [PATCH rdma-next v2 1/4] IB/mlx5: Introduce ODP diagnostic counters Leon Romanovsky
2019-10-08 19:57   ` Jason Gunthorpe
2019-10-10  9:02     ` Leon Romanovsky
2019-10-10 19:49       ` Jason Gunthorpe
2019-10-06 15:51 ` [PATCH rdma-next v2 2/4] RDMA/nldev: Allow different fill function per resource Leon Romanovsky
2019-10-08 19:58   ` Jason Gunthorpe
2019-10-06 15:51 ` [PATCH rdma-next v2 3/4] RDMA/mlx5: Return ODP type per MR Leon Romanovsky
2019-10-06 15:51 ` [PATCH rdma-next v2 4/4] RDMA/nldev: Provide MR statistics Leon Romanovsky
2019-10-09 14:40   ` Jason Gunthorpe [this message]
2019-10-10  9:02     ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191009144012.GJ22714@mellanox.com \
    --to=jgg@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=ereza@mellanox.com \
    --cc=leon@kernel.org \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).