]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: Allow control devlink ops behavior through feature mask
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 12 Oct 2021 13:15:24 +0000 (16:15 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Oct 2021 23:29:17 +0000 (16:29 -0700)
commit56e61900d62261a361ee4a7b98fcbaf2f32f42b2
treeb9a808354fc8d0554fb51a658c3e6adaac07ecb6
parentfde1dc19ecfbcc41437f6a0cc9b75fe4153d43ac
devlink: Allow control devlink ops behavior through feature mask

Introduce new devlink call to set feature mask to control devlink
behavior during device initialization phase after devlink_alloc()
is already called.

This allows us to set reload ops based on device property which
is not known at the beginning of driver initialization.

For the sake of simplicity, this API lacks any type of locking and
needs to be called before devlink_register() to make sure that no
parallel access to the ops is possible at this stage.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c
drivers/net/ethernet/mellanox/mlx4/main.c
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/netdevsim/dev.c
include/net/devlink.h
net/core/devlink.c