RDMA/counter: Add PID category support in auto mode
authorMark Zhang <markz@mellanox.com>
Thu, 2 Jul 2020 08:29:31 +0000 (11:29 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 10 Jul 2020 19:50:53 +0000 (16:50 -0300)
commit7c97f3aded10aa86fc1944341288434117e9c926
treee1df799573e17e3b04158f55d0ae1b80990a2285
parent6c72a038bf4235180550dff9ddff7392e3cff893
RDMA/counter: Add PID category support in auto mode

With the "PID" category QPs have same PID will be bound to same counter;
If this category is not set then QPs have different PIDs will be bound
to same counter.

This is implemented for 2 reasons:
1. The counter is a limited resource, while there may be dozens of
   applications, each of which creates several types of QPs, which means
   it may doesn't have enough counter.
2. The system administrator needs all QPs created by all applications
   with same type bound to one counter.

The counter name and PID is only make sense when "PID" category are
configured.

This category can also be used in combine with others, e.g. QP type.

Link: https://lore.kernel.org/r/20200702082933.424537-2-leon@kernel.org
Signed-off-by: Mark Zhang <markz@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/counters.c
drivers/infiniband/core/nldev.c
include/uapi/rdma/rdma_netlink.h