Skip to content

Commit

Permalink
Do not return DPU mode on error
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kolodiazhnyi <[email protected]>
(cherry picked from commit 1a8d74c)
  • Loading branch information
e0ne committed Jan 6, 2025
1 parent 475fdbf commit 7fc8e0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/vendors/mellanox/mellanox.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,27 @@ func (m *mellanoxHelper) GetMellanoxBlueFieldMode(PciAddress string) (BlueFieldM

internalCPUPageSupplierstatus, exist := mstCurrentData[internalCPUPageSupplier]
if !exist {
return 0, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUPageSupplier)
return -1, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUPageSupplier)
}

internalCPUEswitchManagerStatus, exist := mstCurrentData[internalCPUEswitchManager]
if !exist {
return 0, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUEswitchManager)
return -1, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUEswitchManager)
}

internalCPUIbVportoStatus, exist := mstCurrentData[internalCPUIbVporto]
if !exist {
return 0, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUIbVporto)
return -1, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUIbVporto)
}

internalCPUOffloadEngineStatus, exist := mstCurrentData[internalCPUOffloadEngine]
if !exist {
return 0, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUOffloadEngine)
return -1, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUOffloadEngine)
}

internalCPUModelStatus, exist := mstCurrentData[internalCPUModel]
if !exist {
return 0, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUModel)
return -1, fmt.Errorf("failed to find %s in the mstconfig output command", internalCPUModel)
}

// check for DPU
Expand Down

0 comments on commit 7fc8e0e

Please sign in to comment.