RDMA/nldev: Add support to get status of all counters
authorAharon Landau <aharonl@nvidia.com>
Fri, 8 Oct 2021 12:24:33 +0000 (15:24 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 12 Oct 2021 15:48:05 +0000 (12:48 -0300)
commit7301d0a9834c7f1f0c91c1f0a46c7b191b1fd0da
tree228ee8aeb70e6141bb2e5763e58045239390f3e8
parent5e2ddd1e598273d77f653c70df96fc417a2d0a85
RDMA/nldev: Add support to get status of all counters

This patch adds the ability to get the name, index and status of all
counters for each link through RDMA netlink. This can be used for
user-space to get the current optional-counter mode.

Examples:
$ rdma statistic mode
link rocep8s0f0/1 optional-counters cc_rx_ce_pkts

$ rdma statistic mode supported
link rocep8s0f0/1 supported optional-counters cc_rx_ce_pkts,cc_rx_cnp_pkts,cc_tx_cnp_pkts
link rocep8s0f1/1 supported optional-counters cc_rx_ce_pkts,cc_rx_cnp_pkts,cc_tx_cnp_pkts

Link: https://lore.kernel.org/r/20211008122439.166063-8-markzhang@nvidia.com
Signed-off-by: Aharon Landau <aharonl@nvidia.com>
Signed-off-by: Neta Ostrovsky <netao@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/nldev.c
include/uapi/rdma/rdma_netlink.h