public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
To: Alex Rosenbaum <rosenbaumalex-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Guy Shattah <sguy-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Yishai Hadas
	<yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Raed Salem <raeds-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Alex Rosenbaum <alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Tzahi Oved <tzahio-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH rdma-next 00/16] Flow counters support
Date: Wed, 1 Nov 2017 12:18:07 -0600	[thread overview]
Message-ID: <20171101181807.GJ1030@ziepe.ca> (raw)
In-Reply-To: <CAFgAxU_CMxQ616wBd-vkvyJ905ndLHrabmWtJ-Ye_hgSwWqiag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, Nov 01, 2017 at 11:32:26AM +0200, Alex Rosenbaum wrote:

> Yes, the original suggestion was based on strings. but let's go with enum.
> We didn't plan on a global set from start (based on strings), but
> going with enum in verbs.h definitely makes sense to define some of
> these as global scope and additional vendor/DV will always be required
> (maybe above some IBV_COUNTER_VENDOR_RANGE value).

Well, I would have insisted on some well defined global strings...

> > If the 'add_sampling_point_x' doesn't work then the counter is not
> > supported by the driver. Simple.
> 
> Since we don't want the provider lib to go to Kernel each call, we
> need to keep the counter capability (aka: describe) uverbs command, at
> least for the provider lib usage to get the values of supported
> counters for its device.

How you do that is up to your driver, I don't think we need a fully
complex describe API from the kernel. Just some simple HW specific
bitsets that indicate what level of support the driver and hardware
have. mlx can't have that many permutations, right?

> application can test the support as you mentioned above. But it is
> always better to expose caps to user like most other verbs resources
> do and we'll need in for our mlx library any way.

There are many ways to approach cap testing, we don't always need to
return a huge struct, for instance:

 ibv_query_counter_cap(...)

Is probably much saner.

> I would suggest to move it to be part of struct ibv_device_attr_ex {
> struct ibv_counter_cap *counter_caps } retrieved from
> ibv_query_device_ex() instead of a dedicated API.
> Where struct ibv_counter_cap will hold an array of supported
> ibv_counter_type enums by the device and maybe some flags per type to
> indicate extra capabilities: volatile, cached.
> Maybe even a short "pretty" string.

This might ultimately make sense as a verbs API of some kind, but not
sure we need a kernel call to support it..

> There are 2 usage models I see which probably caused the misunderstanding here:
> 1. add/remove a counter during the verbs objects life cycle to measure
> during a short period. Main use case will be debug or periodic
> auto-tuning of resources. This matches your API design nicely.
> 2. measure the entire objects activity. OVS offload of flows must
> report back 100% of the activity (redirect or drop of all packets).
> This requires to create the flow/qp atomically bounded with the
> counter. Currently this does not match your suggested API. I guess
> that where our disagreement are coming from.

I said to pass NULL for the sampling point object and then pass the
counter object to the create:

> In case #2 we'll have to bind the counter handle to the verbs object
> while creating the object: ibv_create_flow(flow, attr{coutner}) or
> ibv_create_qp(qp, attr{counter}).

Which seems perfectly fine for all uses case.

Having the object argument, even if NULL, lets us scope the counters
to the object under use, so eg we can have more generic counts like
PACKETS_RECIEVED, and if you apply that to a flow group it is the
packets entering the flow group, and if you apply it to a QP it is the
packets entering the QP, etc.

Having QP*FLOW*COUNTS labels seems overly complicated.

It also allows the API to reject confusing request eg,

  ibv_set_sampling_point_qp(counters, 0, NULL, FLOW_DISCARDED);

Should fail, as 'FLOW_DISCARDED' is a counter specific only to flows,
and asking to associate it with a QP is wrong.

It makes it much clearer in the API excatly what thing is being
counted without having to consult a manual.

> > Can mlx do the 'add counter' for any counter??
> Not sure I understood your question exactly.

I mean, if I have an existing QP, can I start counting packets
received?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-11-01 18:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 14:41 [PATCH rdma-next 00/16] Flow counters support Yishai Hadas
     [not found] ` <1508424118-27205-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-19 14:41   ` [PATCH rdma-next 01/16] IB/core: Expose max_counter_sets capability Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 02/16] IB/uverbs: " Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 03/16] IB/core: Introduce counter set describe verb Yishai Hadas
     [not found]     ` <1508424118-27205-4-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-20 10:44       ` Christopher Lameter
2017-10-21  0:29         ` Guy Shattah
     [not found]           ` <AM6PR0502MB37838B19976EDF1D04C74751BD400-md96bDB8+JV1k1TWM4Wt8cDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-22 12:00             ` Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 04/16] IB/uverbs: Add describe counter set support Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 05/16] IB/core: Introduce counter set object and its create/destroy verbs Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 06/16] IB/uverbs: Add create/destroy counter set support Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 07/16] IB/core: Introduce counter set query verb Yishai Hadas
     [not found]     ` <1508424118-27205-8-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-20 10:48       ` Christopher Lameter
2017-10-20 15:40         ` Guy Shattah
2017-10-19 14:41   ` [PATCH rdma-next 08/16] IB/uverbs: Add query counter set support Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 09/16] IB/core: Add support for flow counter set Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 10/16] IB/uverbs: " Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 11/16] net/mlx5: Export flow counter related API Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 12/16] net/mlx5: Expand mlx5_fc_query_cached to return absolute counters values Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 13/16] IB/mlx5: Add counter set operations Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 14/16] IB/mlx5: Pass mlx5_flow_act struct instead of multiple arguments Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 15/16] IB/mlx5: Add flow counter set support Yishai Hadas
2017-10-19 14:41   ` [PATCH rdma-next 16/16] IB/mlx5: Expose max_counter_sets capability Yishai Hadas
2017-10-23 16:51   ` [PATCH rdma-next 00/16] Flow counters support Jason Gunthorpe
     [not found]     ` <20171023165118.GA18097-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-10-23 17:00       ` Leon Romanovsky
2017-10-25 14:58       ` Yishai Hadas
     [not found]         ` <b003f6e5-d7ce-3775-a1dc-0fd0f507a515-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-10-25 15:17           ` Jason Gunthorpe
     [not found]             ` <20171025151734.GA15557-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-10-27 15:46               ` Guy Shattah
     [not found]                 ` <AM6PR0502MB3783A1186AA0ABDCCD5359AEBD5A0-md96bDB8+JV1k1TWM4Wt8cDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-27 15:59                   ` Jason Gunthorpe
     [not found]                     ` <20171027155955.GA15922-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-10-29 15:21                       ` Alex Rosenbaum
     [not found]                         ` <CAFgAxU-UcRapsoRn3hNUn27xgY370gUJ+WWE4URBq84ufkCXtA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-29 18:00                           ` Jason Gunthorpe
     [not found]                             ` <20171029180019.GE4488-uk2M96/98Pc@public.gmane.org>
2017-11-01  9:32                               ` Alex Rosenbaum
     [not found]                                 ` <CAFgAxU_CMxQ616wBd-vkvyJ905ndLHrabmWtJ-Ye_hgSwWqiag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-01 18:18                                   ` Jason Gunthorpe [this message]
     [not found]                                     ` <20171101181807.GJ1030-uk2M96/98Pc@public.gmane.org>
2017-11-01 18:59                                       ` Alex Rosenbaum
     [not found]                                         ` <CAFgAxU-DsOr9T9P6gqvZ9AviE45_34vZ1WUgUehmF-kb2j8JtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-01 19:01                                           ` Jason Gunthorpe
     [not found]                                             ` <20171101190119.GL1030-uk2M96/98Pc@public.gmane.org>
2017-11-01 19:46                                               ` Alex Rosenbaum
     [not found]                                                 ` <CAFgAxU9FZQC3JC6sEjB9W3YqHyF5StJ8_=mDQsF0eCWr9010hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-01 21:16                                                   ` Jason Gunthorpe
     [not found]                                                     ` <20171101211629.GA18874-uk2M96/98Pc@public.gmane.org>
2017-11-02  6:50                                                       ` Alex Rosenbaum
     [not found]                                                         ` <CAFgAxU8GNEiyzwHqrYyxs8J7T0TUqmN7JrZukkA0JgYSgY8FoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-02 15:38                                                           ` Jason Gunthorpe
     [not found]                                                             ` <20171102153848.GF18874-uk2M96/98Pc@public.gmane.org>
2017-11-02 16:11                                                               ` Alex Rosenbaum
     [not found]                                                                 ` <CAFgAxU_Ouzk1bsBpZ==gTetD3OVGVosgeJRvwqErqz5s2utHBg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-02 16:19                                                                   ` Jason Gunthorpe
     [not found]                                                                     ` <20171102161928.GJ18874-uk2M96/98Pc@public.gmane.org>
2017-12-27 15:59                                                                       ` Alex Rosenbaum

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=20171101181807.GJ1030@ziepe.ca \
    --to=jgg-uk2m96/98pc@public.gmane.org \
    --cc=alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=raeds-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=rosenbaumalex-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sguy-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=tzahio-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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