RDMA/uverbs: Refactor rdma_counter_set_auto_mode and __counter_set_mode
authorPatrisious Haddad <phaddad@nvidia.com>
Thu, 18 Mar 2021 11:05:02 +0000 (13:05 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 26 Mar 2021 14:52:09 +0000 (11:52 -0300)
commit49695e95ceea08913e7355c9914a25ddffc504ba
treeb6ca1e8ab6b02f5b43ca1ed8913f79d1b309f0f2
parent6845485f9ed0157d6689321155ec7d168c6bfbd7
RDMA/uverbs: Refactor rdma_counter_set_auto_mode and __counter_set_mode

Success is returned in the following flows:
 * New mode is the same as the current one.
 * Switched to new mode and there are no bound counters yet.

Link: https://lore.kernel.org/r/20210318110502.673676-1-leon@kernel.org
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Zhang <markzhang@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/counters.c