On Thu, 17 Sep 2020 17:45:25 -0700 Jacob Keller wrote:
> When implementing .flash_update, drivers which do not support
> per-component update are manually checking the component parameter to
> verify that it is NULL. Without this check, the driver might accept an
> update request with a component specified even though it will not honor
> such a request.
> 
> Instead of having each driver check this, move the logic into
> net/core/devlink.c, and use a new `supported_flash_update_params` field
> in the devlink_ops. Drivers which will support per-component update must
> now specify this by setting DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT in
> the supported_flash_update_params in their devlink_ops.
> 
> This helps ensure that drivers do not forget to check for a NULL
> component if they do not support per-component update. This also enables
> a slightly better error message by enabling the core stack to set the
> netlink bad attribute message to indicate precisely the unsupported
> attribute in the message.
> 
> Going forward, any new additional parameter to flash update will require
> a bit in the supported_flash_update_params bitfield.

Reviewed-by: Jakub Kicinski <k...@kernel.org>

Reply via email to