Skip to content

Verbs flow counters support

Leon Romanovsky linux-rdma netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest14 patches 10 repliesIn review
  2. v213 patches 9 repliesSuperseded
  3. v113 patches 5 repliesSuperseded

Changes in v3 from the cover letter

* Change function mlx5_fc_query signature to hide the details of internal core driver struct mlx5_fc
* Add commen to data[] field at struct mlx5_ib_flow_counters_data (mlx5-abi.h)
* Use array of struct mlx5_ib_flow_counters_desc to clarify the output

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14IB/uverbs: Add an ib_uobject getter to ioctl() infrastructuredrivers/infiniband/core/uverbs_std_types_cq.c drivers/infiniband/core/uverbs_std_types_flow_action.c include/rdma/uverbs_ioctl.h+25 -130 replies
2/14net/mlx5: Use flow counter pointer as input to the query functiondrivers/net/ethernet/mellanox/mlx5/core/eswitch.c drivers/net/ethernet/mellanox/mlx5/core/fs_core.h drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c+9 -120 replies
3/14net/mlx5: Export flow counter related APIdrivers/net/ethernet/mellanox/mlx5/core/fs_core.h drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c include/linux/mlx5/fs.h+6 -20 replies
4/14IB/core: Introduce counters object and its create/destroyinclude/rdma/ib_verbs.h+11 -00 replies
5/14IB/uverbs: Add create/destroy counters supportdrivers/infiniband/core/Makefile drivers/infiniband/core/uverbs.h drivers/infiniband/core/uverbs_std_types.c +2 more+118 -22 replies
6/14IB/core: Introduce counters read verbinclude/rdma/ib_verbs.h+14 -00 replies
7/14IB/uverbs: Add read counters supportdrivers/infiniband/core/uverbs_std_types_counters.c include/uapi/rdma/ib_user_ioctl_cmds.h+65 -10 replies
8/14IB/core: Support passing uhw for create_flowdrivers/infiniband/core/uverbs_cmd.c drivers/infiniband/core/verbs.c drivers/infiniband/hw/mlx4/main.c +2 more+20 -52 replies
9/14IB/core: Add support for flow countersinclude/rdma/ib_verbs.h+14 -10 replies
10/14IB/uverbs: Add support for flow countersdrivers/infiniband/core/uverbs.h drivers/infiniband/core/uverbs_cmd.c include/uapi/rdma/ib_user_verbs.h+84 -112 replies
11/14IB/mlx5: Add counters create and destroy supportdrivers/infiniband/hw/mlx5/main.c drivers/infiniband/hw/mlx5/mlx5_ib.h+33 -00 replies
12/14IB/mlx5: Add flow counters binding supportdrivers/infiniband/hw/mlx5/main.c drivers/infiniband/hw/mlx5/mlx5_ib.h include/linux/mlx5/fs.h +1 more+249 -140 replies
13/14IB/mlx5: Add flow counters read supportdrivers/infiniband/hw/mlx5/main.c drivers/infiniband/hw/mlx5/mlx5_ib.h+27 -10 replies
14/14IB/mlx5: Add counters read supportdrivers/infiniband/hw/mlx5/main.c+43 -00 replies

Reviews trailers per patch

13 of 14 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMichael J. RuhlYishai HadasJason Gunthorpe
SeriesA-b
1/14R-b
2/14
3/14R-b
4/14R-b
5/14R-b
6/14R-b
7/14R-b
8/14R-b
9/14R-b
10/14R-b
11/14R-b
12/14R-b
13/14R-b
14/14R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH rdma-next v3 00/14] Verbs flow counters support

From: Leon Romanovsky <[email protected]>

Changelog:
v2->v3:
* Change function mlx5_fc_query signature to hide the details of internal core driver struct mlx5_fc
* Add commen to data[] field at struct mlx5_ib_flow_counters_data (mlx5-abi.h)
* Use array of struct mlx5_ib_flow_counters_desc to clarify the output
v1->v2:
* Removed conversion from struct mlx5_fc* to void*
* Fixed one place with double space in it
* Balanced release of hardware handler in case of counters allocation failure
* Added Tested-by
* Minimize time spent holding mutex lock
* Fixed deadlock caused by nested lock in error path
* Protect from handler pointer derefence in the error paths

Not changed: mlx5-abi.h

v0->v1:
* Decouple from DevX submission
* Use uverbs_attr_get_obj at counters read method
* Added define for max read buffer size (MAX_COUNTERS_BUFF_SIZE)
* Removed the struct mlx5_ib_flow_counter basic_flow_cnts and the related structs used, used define instead
* Took Matan's patch from DevX
* uverbs_free_counters removed void* casting
* Added check to bound ncounters value (added define
* Changed user supplied data buffer structure to be array of struct <desc,index> pair (applied this change to user space also)

Not changed:
* UAPI files
* Addition of uhw to flow

Thanks

----------------------------------------------------------------------

Quoted 1 line

From Raed:

This series comes to allow user space applications to monitor real time traffic activity and events of the verbs objects it manages, e.g.:
ibv_qp, ibv_wq, ibv_flow.

This API enables generic counters creation and define mapping to association with a verbs object, current mlx5 driver using this API for flow counters.

With this API, an application can monitor the entire life cycle of object activity, defined here as a static counters attachment. This API also allows dynamic counters monitoring of measurement points for a partial period in the verbs object life cycle.

In addition it presents the implementation of the generic counters interface.

This will be achieved by extending flow creation by adding a new flow count specification type which allows the user to associate a previously created flow counters using the generic verbs counters interface to the created flow, once associated the user could read statistics by using the read function of the generic counters interface.

The API includes:
1. create and destroyed API of a new counters objects
2. read the counters values from HW

Note:
Attaching API to allow application to define the measurement points per objects is a user space only API and this data is passed to kernel when the counted object (e.g. flow) is created with the counters object.

Thanks

Matan Barak (2):
IB/uverbs: Add an ib_uobject getter to ioctl() infrastructure IB/core: Support passing uhw for create_flow

Or Gerlitz (1):
net/mlx5: Use flow counter pointer as input to the query function

Raed Salem (11):
net/mlx5: Export flow counter related API IB/core: Introduce counters object and its create/destroy IB/uverbs: Add create/destroy counters support IB/core: Introduce counters read verb
IB/uverbs: Add read counters support
IB/core: Add support for flow counters IB/uverbs: Add support for flow counters IB/mlx5: Add counters create and destroy support IB/mlx5: Add flow counters binding support IB/mlx5: Add flow counters read support
IB/mlx5: Add counters read support

 drivers/infiniband/core/Makefile                   |   2 +-
 drivers/infiniband/core/uverbs.h                   |   2 +
 drivers/infiniband/core/uverbs_cmd.c               |  88 +++++-
 drivers/infiniband/core/uverbs_std_types.c         |   3 +-
 .../infiniband/core/uverbs_std_types_counters.c    | 157 +++++++++++
 drivers/infiniband/core/uverbs_std_types_cq.c      |  23 +-
 .../infiniband/core/uverbs_std_types_flow_action.c |   4 +-
 drivers/infiniband/core/verbs.c                    |   2 +-
 drivers/infiniband/hw/mlx4/main.c                  |   6 +-
 drivers/infiniband/hw/mlx5/main.c                  | 305 ++++++++++++++++++++-
 drivers/infiniband/hw/mlx5/mlx5_ib.h               |  36 +++
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  |  15 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.h  |   2 -
 .../net/ethernet/mellanox/mlx5/core/fs_counters.c  |   7 +-
 include/linux/mlx5/fs.h                            |   4 +
 include/rdma/ib_verbs.h                            |  43 ++-
 include/rdma/uverbs_ioctl.h                        |  11 +
 include/uapi/rdma/ib_user_ioctl_cmds.h             |  21 ++
 include/uapi/rdma/ib_user_verbs.h                  |  13 +
 include/uapi/rdma/mlx5-abi.h                       |  24 ++
 20 files changed, 712 insertions(+), 56 deletions(-)
 create mode 100644 drivers/infiniband/core/uverbs_std_types_counters.c