[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220725205629.3993766-5-jacob.e.keller@intel.com>
Date: Mon, 25 Jul 2022 13:56:29 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: netdev@...r.kernel.org
Cc: Jacob Keller <jacob.e.keller@...el.com>,
Jonathan Corbet <corbet@....net>, Jiri Pirko <jiri@...dia.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
David Ahern <dsahern@...nel.org>,
Stephen Hemminger <stephen@...workplumber.org>,
linux-doc@...r.kernel.org
Subject: [net-next v3 4/4] ice: support dry run of a flash update to validate firmware file
The devlink core flash update and the PLDMFW library can now handle dry run
requests. Update the ice driver to support this feature.
Indicate that we support dry runs 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@...el.com>
---
Changes since v2
* Move the PLDMFW changes to their own patch
drivers/net/ethernet/intel/ice/ice_devlink.c | 3 ++-
drivers/net/ethernet/intel/ice/ice_fw_update.c | 14 ++++++++++----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
index 3337314a7b35..18214ea33e2d 100644
--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
@@ -467,7 +467,8 @@ ice_devlink_reload_empr_finish(struct devlink *devlink,
}
static const struct devlink_ops ice_devlink_ops = {
- .supported_flash_update_params = DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK,
+ .supported_flash_update_params = DEVLINK_SUPPORT_FLASH_UPDATE_OVERWRITE_MASK |
+ DEVLINK_SUPPORT_FLASH_UPDATE_DRY_RUN,
.reload_actions = BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE),
/* The ice driver currently does not support driver reinit */
.reload_down = ice_devlink_reload_empr_start,
diff --git a/drivers/net/ethernet/intel/ice/ice_fw_update.c b/drivers/net/ethernet/intel/ice/ice_fw_update.c
index 3dc5662d62a6..51b352bc26a2 100644
--- a/drivers/net/ethernet/intel/ice/ice_fw_update.c
+++ b/drivers/net/ethernet/intel/ice/ice_fw_update.c
@@ -1015,15 +1015,21 @@ int ice_devlink_flash_update(struct devlink *devlink,
else
priv.context.ops = &ice_fwu_ops_e810;
priv.context.dev = dev;
+ priv.context.only_validate = params->dry_run;
priv.extack = extack;
priv.pf = pf;
priv.activate_flags = preservation;
- devlink_flash_update_status_notify(devlink, "Preparing to flash", NULL, 0, 0);
+ if (params->dry_run)
+ devlink_flash_update_status_notify(devlink, "Validating flash binary", NULL, 0, 0);
+ else
+ devlink_flash_update_status_notify(devlink, "Preparing to flash", NULL, 0, 0);
- err = ice_cancel_pending_update(pf, NULL, extack);
- if (err)
- return err;
+ if (!params->dry_run) {
+ err = ice_cancel_pending_update(pf, NULL, extack);
+ if (err)
+ return err;
+ }
err = ice_acquire_nvm(hw, ICE_RES_WRITE);
if (err) {
--
2.35.1.456.ga9c7032d4631
Powered by blists - more mailing lists