• Parav Pandit's avatar
    devlink: Add API to register and unregister single parameter · b40c51ef
    Parav Pandit authored
    Currently device configuration parameters can be registered as an array.
    Due to this a constant array must be registered. A single driver
    supporting multiple devices each with different device capabilities end
    up registering all parameters even if it doesn't support it.
    
    One possible workaround a driver can do is, it registers multiple single
    entry arrays to overcome such limitation.
    
    Better is to provide a API that enables driver to register/unregister a
    single parameter. This also further helps in two ways.
    (1) to reduce the memory of devlink_param_entry by avoiding in registering
    parameters which are not supported by the device.
    (2) avoid generating multiple parameter add, delete, publish, unpublish,
    init value notifications for such unsupported parameters
    Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b40c51ef
devlink.c 294 KB