RDMA/nldev: Allow optional-counter status configuration through RDMA netlink
authorAharon Landau <aharonl@nvidia.com>
Fri, 8 Oct 2021 12:24:35 +0000 (15:24 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 12 Oct 2021 15:48:06 +0000 (12:48 -0300)
commit3c3c1f1416392382faa0238e76a70d7810aab2ef
tree0049c2fe2de12fcd73bb7a1a1253ae5c3301099f
parent822cf785ac6d9120386f59964d6d029f3f04a8e3
RDMA/nldev: Allow optional-counter status configuration through RDMA netlink

Provide an option to allow users to enable/disable optional counters
through RDMA netlink. Limiting it to users with ADMIN capability only.

Examples:
1. Enable optional counters cc_rx_ce_pkts and cc_rx_cnp_pkts (and
   disable all others):
$ sudo rdma statistic set link rocep8s0f0/1 optional-counters \
    cc_rx_ce_pkts,cc_rx_cnp_pkts

2. Remove all optional counters:
$ sudo rdma statistic unset link rocep8s0f0/1 optional-counters

Link: https://lore.kernel.org/r/20211008122439.166063-10-markzhang@nvidia.com
Signed-off-by: Aharon Landau <aharonl@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