Skip to content

Commit 3333caa

Browse files
Merge pull request #109 from almaslennikov/bf3-reset
fix: consider config reset successful after reboot
2 parents 389e953 + 0bd1475 commit 3333caa

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

internal/controller/nicdevice_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ func (r *NicDeviceReconciler) handleConfigurationSpecValidation(ctx context.Cont
533533
return nil
534534
}
535535

536+
// If configuration reset was applied (nvConfigUpdateRequired == false) and reboot has happened (uptime > sinceStatusUpdate),
537+
// there might still be discrepancies in the mlxconfig query that might lead to a boot loop.
538+
// In this case, consider the reset successful
539+
if status.device.Spec.Configuration.ResetToDefault {
540+
status.rebootRequired = false
541+
return nil
542+
}
543+
536544
log.Log.Info("nv config failed to update after reboot for device", "device", status.device.Name)
537545
r.EventRecorder.Event(status.device, v1.EventTypeWarning, consts.FirmwareError, consts.FwConfigNotAppliedAfterRebootErrorMsg)
538546
err = r.updateConfigInProgressStatusCondition(ctx, status.device, consts.FirmwareError, metav1.ConditionFalse, consts.FwConfigNotAppliedAfterRebootErrorMsg)

pkg/host/configvalidation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ func (v *configValidationImpl) ValidateResetToDefault(nvConfig types.NvConfigQue
219219
// ResetToDefault requires us to set ADVANCED_PCI_SETTINGS=true, which is not a default value
220220
// Deleting this key from maps so that it doesn't interfere with comparisons
221221
delete(nvConfig.DefaultConfig, consts.AdvancedPCISettingsParam)
222+
// We want to retain the BF3 operation mode after reset, so not taking it into consideration
223+
delete(nvConfig.DefaultConfig, consts.BF3OperationModeParam)
224+
delete(nvConfig.CurrentConfig, consts.BF3OperationModeParam)
225+
delete(nvConfig.NextBootConfig, consts.BF3OperationModeParam)
222226

223227
alreadyResetInCurrent := false
224228
willResetInNextBoot := false

0 commit comments

Comments
 (0)