Delete publish of single parameter API
Subsystems (5)
cover Delete publish of single parameter API
From: Leon Romanovsky <[email protected]>
Hi,
This short series removes the single parameter publish/unpublish API that does nothing expect mimics already existing devlink_paramss_*publish calls.
In near future, we will be able to delete devlink_paramss_*publish too.
Thanks
Leon Romanovsky (2):
net/mlx5: Publish and unpublish all devlink parameters at once
devlink: Delete not-used single parameter notification APIs
.../net/ethernet/mellanox/mlx5/core/devlink.c | 10 +--- include/net/devlink.h | 4 -- net/core/devlink.c | 48 ------------------- 3 files changed, 2 insertions(+), 60 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/2 net/mlx5: Publish and unpublish all devlink parameters at once
From: Leon Romanovsky <[email protected]>
The devlink parameters were published in two steps despite being static and known in advance.
First step was to use devlink_params_publish() which iterated over all known up to that point parameters and sent notification messages. In second step, the call was devlink_param_publish() that looped over same parameters list and sent notification for new parameters.
In order to simplify the API, move devlink_params_publish() to be called when all parameters were already added and save the need to iterate over parameters list again.
As a side effect, this change fixes the error unwind flow in which parameters were not marked as unpublished.
--- drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +2 -8
@@ -625,7 +625,6 @@ static int mlx5_devlink_eth_param_register(struct devlink *devlink)devlink_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_ETH , value); -devlink_param_publish (devlink, &enable_eth_param);return 0 ; }
@@ -636,7 +635,6 @@ static void mlx5_devlink_eth_param_unregister(struct devlink *devlink)if (!mlx5_eth_supported (dev))return ; -devlink_param_unpublish (devlink, &enable_eth_param);devlink_param_unregister (devlink, &enable_eth_param); }
@@ -673,7 +671,6 @@ static int mlx5_devlink_rdma_param_register(struct devlink *devlink)devlink_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_RDMA , value); -devlink_param_publish (devlink, &enable_rdma_param);return 0 ; }
@@ -684,7 +681,6 @@ static void mlx5_devlink_rdma_param_unregister(struct devlink *devlink)if (!IS_ENABLED (CONFIG_MLX5_INFINIBAND ) ||MLX5_ESWITCH_MANAGER (dev))return ; -devlink_param_unpublish (devlink, &enable_rdma_param);devlink_param_unregister (devlink, &enable_rdma_param); }
@@ -709,7 +705,6 @@ static int mlx5_devlink_vnet_param_register(struct devlink *devlink)devlink_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_VNET , value); -devlink_param_publish (devlink, &enable_rdma_param);return 0 ; }
@@ -720,7 +715,6 @@ static void mlx5_devlink_vnet_param_unregister(struct devlink *devlink)if (!mlx5_vnet_supported (dev))return ; -devlink_param_unpublish (devlink, &enable_vnet_param);devlink_param_unregister (devlink, &enable_vnet_param); }
@@ -811,7 +805,6 @@ int mlx5_devlink_register(struct devlink *devlink)if (err) goto params_reg_err;mlx5_devlink_set_params_init_values (devlink); -devlink_params_publish (devlink); err =mlx5_devlink_auxdev_params_register (devlink);if (err)
@@ -821,6 +814,7 @@ int mlx5_devlink_register(struct devlink *devlink)if (err) goto traps_reg_err; +devlink_params_publish (devlink);return 0 ; traps_reg_err:
@@ -835,9 +829,9 @@ int mlx5_devlink_register(struct devlink *devlink)void mlx5_devlink_unregister (struct devlink *devlink) { +devlink_params_unpublish (devlink);mlx5_devlink_traps_unregister (devlink);mlx5_devlink_auxdev_params_unregister (devlink); -devlink_params_unpublish (devlink);devlink_params_unregister (devlink, mlx5_devlink_params,ARRAY_SIZE (mlx5_devlink_params));devlink_unregister (devlink);
Signature · 1 line
2.31.1
PATCH 2/2 devlink: Delete not-used single parameter notification APIs
In reply to Leon RomanovskyFrom: Leon Romanovsky <[email protected]>
There is no need in specific devlink_param_*publish(), because same output can be achieved by using devlink_params_*publish() in correct places.
--- include/net/devlink.h | 4 ---- net/core/devlink.c | 48 ------------------------------------------- 2 files changed, 52 deletions(-)
include/net/devlink.h +0 -4
@@ -1653,10 +1653,6 @@ void devlink_param_unregister(struct devlink *devlink, const struct devlink_param *param);void devlink_params_publish (struct devlink *devlink);void devlink_params_unpublish (struct devlink *devlink); -void devlink_param_publish (struct devlink *devlink, -const struct devlink_param *param); -void devlink_param_unpublish (struct devlink *devlink, -const struct devlink_param *param);int devlink_port_params_register (struct devlink_port *devlink_port,const struct devlink_param *params,size_t params_count);
net/core/devlink.c +0 -48
54 lines not on this page · raw message
Signature · 1 line
2.31.1
Re: [PATCH net-next 2/2] devlink: Delete not-used single parameter notification APIs
Quoted 7 lines · On Tue, 14 Sep 2021 15:58:29 +0300 Leon Romanovsky wrote:
From: Leon Romanovsky <[email protected]>
There is no need in specific devlink_param_*publish(), because same output can be achieved by using devlink_params_*publish() in correct places.
Signed-off-by Leon Romanovsky <[email protected]>
This series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Tue, 14 Sep 2021 15:58:27 +0300 you wrote:
From: Leon Romanovsky <[email protected]>
Hi,
This short series removes the single parameter publish/unpublish API that does nothing expect mimics already existing devlink_paramss_*publish calls.
[...]
Here is the summary with links:
- [net-next,1/2] net/mlx5: Publish and unpublish all devlink parameters at once
https://git.kernel.org/netdev/net-next/c/e9310aed8e6a - [net-next,2/2] devlink: Delete not-used single parameter notification APIs https://git.kernel.org/netdev/net-next/c/c2d2f9885066
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html