switch (response) { case IXGBE_ACI_NVM_PASS_COMP_CAN_BE_UPDATED: /* Firmware indicated this update is good to proceed. */ return0; case IXGBE_ACI_NVM_PASS_COMP_CAN_MAY_BE_UPDATEABLE:
NL_SET_ERR_MSG_MOD(extack, "Firmware recommends not updating, as it may result in a downgrade. Continuing anyways"); return0; case IXGBE_ACI_NVM_PASS_COMP_CAN_NOT_BE_UPDATED:
NL_SET_ERR_MSG_MOD(extack, "Firmware has rejected updating."); break; case IXGBE_ACI_NVM_PASS_COMP_PARTIAL_CHECK: if (hw->mac.ops.fw_recovery_mode &&
hw->mac.ops.fw_recovery_mode(hw)) return0; break;
}
switch (code) { case IXGBE_ACI_NVM_PASS_COMP_STAMP_IDENTICAL_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component comparison stamp is identical to running image"); break; case IXGBE_ACI_NVM_PASS_COMP_STAMP_LOWER:
NL_SET_ERR_MSG_MOD(extack, "Component comparison stamp is lower than running image"); break; case IXGBE_ACI_NVM_PASS_COMP_INVALID_STAMP_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component comparison stamp is invalid"); break; case IXGBE_ACI_NVM_PASS_COMP_CONFLICT_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component table conflict occurred"); break; case IXGBE_ACI_NVM_PASS_COMP_PRE_REQ_NOT_MET_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component pre-requisites not met"); break; case IXGBE_ACI_NVM_PASS_COMP_NOT_SUPPORTED_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component not supported"); break; case IXGBE_ACI_NVM_PASS_COMP_CANNOT_DOWNGRADE_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component cannot be downgraded"); break; case IXGBE_ACI_NVM_PASS_COMP_INCOMPLETE_IMAGE_CODE:
NL_SET_ERR_MSG_MOD(extack, "Incomplete component image"); break; case IXGBE_ACI_NVM_PASS_COMP_VER_STR_IDENTICAL_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component version is identical to running image"); break; case IXGBE_ACI_NVM_PASS_COMP_VER_STR_LOWER_CODE:
NL_SET_ERR_MSG_MOD(extack, "Component version is lower than the running image"); break; default:
NL_SET_ERR_MSG_MOD(extack, "Received unexpected response code from firmware"); break;
}
switch (component->identifier) { case NVM_COMP_ID_OROM: case NVM_COMP_ID_NVM: case NVM_COMP_ID_NETLIST: break; default:
NL_SET_ERR_MSG_MOD(extack, "Unable to update due to unknown firmware component"); return -EOPNOTSUPP;
}
/* Length in seconds to wait before timing out when erasing a flash module. *Yes,erasingreallycantakeminutestocomplete.
*/ #define IXGBE_FW_ERASE_TIMEOUT 300
switch (component->identifier) { case NVM_COMP_ID_OROM:
module = IXGBE_E610_SR_1ST_OROM_BANK_PTR;
flag = IXGBE_ACI_NVM_ACTIV_SEL_OROM;
name = "fw.undi"; break; case NVM_COMP_ID_NVM:
module = IXGBE_E610_SR_1ST_NVM_BANK_PTR;
flag = IXGBE_ACI_NVM_ACTIV_SEL_NVM;
name = "fw.mgmt"; break; case NVM_COMP_ID_NETLIST:
module = IXGBE_E610_SR_NETLIST_BANK_PTR;
flag = IXGBE_ACI_NVM_ACTIV_SEL_NETLIST;
name = "fw.netlist"; break;
default: return -EOPNOTSUPP;
}
/* Mark this component for activating at the end. */
priv->activate_flags |= flag;
err = ixgbe_erase_nvm_module(adapter, module, name, extack); if (err) return err;
if (!adapter->fw_emp_reset_disabled)
devlink_flash_update_status_notify(devlink, "Suggested is to activate new firmware by devlink reload, if it doesn't work then a power cycle is required",
NULL, 0, 0);
err = ixgbe_get_pending_updates(adapter, &pending, extack); if (err) return err;
/* If the flash_update request is for a specific component, ignore all *oftheothercomponents.
*/ if (component) { if (strcmp(component, "fw.mgmt") == 0)
pending &= IXGBE_ACI_NVM_ACTIV_SEL_NVM; elseif (strcmp(component, "fw.undi") == 0)
pending &= IXGBE_ACI_NVM_ACTIV_SEL_OROM; elseif (strcmp(component, "fw.netlist") == 0)
pending &= IXGBE_ACI_NVM_ACTIV_SEL_NETLIST; else return -EINVAL;
}
/* There is no previous pending update, so this request may continue */ if (!pending) return0;
/* In order to allow overwriting a previous pending update, notify *firmwaretocancelthatupdatebyissuingtheappropriatecommand.
*/
devlink_flash_update_status_notify(devlink, "Canceling previous pending update",
component, 0, 0);
err = ixgbe_acquire_nvm(hw, LIBIE_AQC_RES_ACCESS_WRITE); if (err) {
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock"); return -EIO;
}
if (hw->mac.type != ixgbe_mac_e610) return -EOPNOTSUPP;
switch (params->overwrite_mask) { case0: /* preserve all settings and identifiers */
preservation = IXGBE_ACI_NVM_PRESERVE_ALL; break; case DEVLINK_FLASH_OVERWRITE_SETTINGS: /* Overwrite settings, but preserve vital information such as *deviceidentifiers.
*/
preservation = IXGBE_ACI_NVM_PRESERVE_SELECTED; break; case (DEVLINK_FLASH_OVERWRITE_SETTINGS |
DEVLINK_FLASH_OVERWRITE_IDENTIFIERS): /* overwrite both settings and identifiers, preserve nothing */
preservation = IXGBE_ACI_NVM_NO_PRESERVATION; break; default:
NL_SET_ERR_MSG_MOD(extack, "Requested overwrite mask is not supported"); return -EOPNOTSUPP;
}
/* Cannot get caps in recovery mode, so lack of nvm_unified_update bit *cannotleadtoerror
*/ if (!hw->dev_caps.common_cap.nvm_unified_update &&
(hw->mac.ops.fw_recovery_mode &&
!hw->mac.ops.fw_recovery_mode(hw))) {
NL_SET_ERR_MSG_MOD(extack, "Current firmware does not support unified update"); return -EOPNOTSUPP;
}
devlink_flash_update_status_notify(devlink, "Preparing to flash", NULL, 0, 0);
err = ixgbe_cancel_pending_update(adapter, NULL, extack); if (err) return err;
err = ixgbe_acquire_nvm(hw, LIBIE_AQC_RES_ACCESS_WRITE); if (err) {
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock"); return -EIO;
}
err = pldmfw_flash_image(&priv.context, params->fw); if (err == -ENOENT) {
NL_SET_ERR_MSG_MOD(extack, "Firmware image has no record matching this device");
} elseif (err) {
NL_SET_ERR_MSG_MOD(extack, "Failed to flash PLDM image");
}
ixgbe_release_nvm(hw);
return err;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet am 2026-10-04)
¤