# Re: \[net-next PATCH 2/2\] ice: support dry run of a flash update to validate firmware file

- From: Leon Romanovsky \<leon@kernel.org\>
- Date: 2022-07-21 07:53:38 
- List: netdev
- Page: https://ratatoskr.run/netdev/2022/07/11235512
- Thread: https://ratatoskr.run/netdev/2022/07/11235465/t.md

```text
On Wed, Jul 20, 2022 at 11:34:33AM -0700, Jacob Keller wrote:
> Now that devlink core flash update can handle dry run requests, update
> the ice driver to allow validating a PLDM file in dry_run mode.
> 
> First, add a new dry_run field to the pldmfw context structure. This
> indicates that the PLDM firmware file library should only validate the
> file and verify that it has a matching record. Update the pldmfw
> documentation to indicate this "dry run" mode.
> 
> In the ice driver, let the stack know that we support the dry run
> attribute for flash update by setting the appropriate bit in the
> .supported_flash_update_params field.
> 
> If the dry run is requested, notify the PLDM firmware library by setting
> the context bit appropriately. Don't cancel a pending update during
> a dry run.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  Documentation/driver-api/pldmfw/index.rst      | 10 ++++++++++
>  drivers/net/ethernet/intel/ice/ice_devlink.c   |  3 ++-
>  drivers/net/ethernet/intel/ice/ice_fw_update.c | 14 ++++++++++----
>  include/linux/pldmfw.h                         |  5 +++++
>  lib/pldmfw/pldmfw.c                            | 12 ++++++++++++
>  5 files changed, 39 insertions(+), 5 deletions(-)

<...>

>  struct pldmfw {
>  	const struct pldmfw_ops *ops;
>  	struct device *dev;
> +	bool dry_run;
>  };

Just a nitpick, it is better to write "u8 dry_run : 1;" and not bool.

Thanks
```
