aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/main.c
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2021-10-12 16:15:24 +0300
committerJakub Kicinski <kuba@kernel.org>2021-10-12 16:29:17 -0700
commitbd032e35c568ff7cfa347aa4ddd6491e2453f00c (patch)
treeb9a808354fc8d0554fb51a658c3e6adaac07ecb6 /drivers/net/ethernet/mellanox/mlx4/main.c
parentdevlink: Annotate devlink API calls (diff)
downloadlinux-dev-bd032e35c568ff7cfa347aa4ddd6491e2453f00c.tar.xz
linux-dev-bd032e35c568ff7cfa347aa4ddd6491e2453f00c.zip
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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 9541f3a920c8..05e850a40b36 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -4025,6 +4025,7 @@ static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
goto err_params_unregister;
pci_save_state(pdev);
+ devlink_set_features(devlink, DEVLINK_F_RELOAD);
devlink_register(devlink);
devlink_reload_enable(devlink);
return 0;