Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: Doug Ledford <dledford@redhat.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: Thu, 10 Oct 2019 12:02:59 +0300
Message-ID: <20191010090259.GK5855@unreal> (raw)
In-Reply-To: <20191009144012.GJ22714@mellanox.com>

On Wed, Oct 09, 2019 at 02:40:16PM +0000, Jason Gunthorpe wrote:
> 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?

Be consistent with other fill_... functions.

>
> Jason

      reply index

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
2019-10-10  9:02     ` Leon Romanovsky [this message]

Reply instructions:

You may reply publically 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=20191010090259.GK5855@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=ereza@mellanox.com \
    --cc=jgg@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

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org linux-rdma@archiver.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/ public-inbox