devlink: expose instance locking and add locked port registering
authorJakub Kicinski <kuba@kernel.org>
Tue, 15 Mar 2022 06:00:04 +0000 (23:00 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 16 Mar 2022 19:56:31 +0000 (12:56 -0700)
commit2cb7b4890d6e7f20560dc251e7f8d3cc68b0d554
tree7a097268cd33bddcbc44114f2c1111e501373375
parent49045b9c810cd9b4ac5f8f235ad8ef17553a00fa
devlink: expose instance locking and add locked port registering

It should be familiar and beneficial to expose devlink instance
lock to the drivers. This way drivers can block devlink from
calling them during critical sections without breakneck locking.

Add port helpers, port splitting callbacks will be the first
target.

Use 'devl_' prefix for "explicitly locked" API. Initial RFC used
'__devlink' but that's too much typing.

devl_lock_is_held() is not defined without lockdep, which is
the same behavior as lockdep_is_held() itself.

Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/devlink/index.rst
include/net/devlink.h
net/core/devlink.c