Skip to content

Commit

Permalink
Do not configure BlueField NICs in DPU mode
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kolodiazhnyi <[email protected]>
  • Loading branch information
e0ne committed Dec 13, 2024
1 parent d172b52 commit bd6b5cd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/vendors/mellanox/mellanox.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strconv"
"strings"

"github.com/pkg/errors"
kerrors "k8s.io/apimachinery/pkg/util/errors"
"sigs.k8s.io/controller-runtime/pkg/log"

Expand Down Expand Up @@ -162,6 +163,14 @@ func (m *mellanoxHelper) MlxResetFW(pciAddresses []string) error {
func (m *mellanoxHelper) MlxConfigFW(attributesToChange map[string]MlxNic) error {
log.Log.Info("mellanox-plugin configFW()")
for pciAddr, fwArgs := range attributesToChange {
bfMode, err := m.GetMellanoxBlueFieldMode(pciAddr)
if err != nil {
// NIC is not a DPU or mstconfig failed. It's safe to continue FW configuration
log.Log.V(2).Info("mellanox-plugin: configFW(): can't get DPU mode for NIC", "pciAddress", pciAddr)
}
if bfMode == BluefieldDpu {
return errors.Errorf("NIC %s is in DPU mode", pciAddr)
}
cmdArgs := []string{"-d", pciAddr, "-y", "set"}
if fwArgs.EnableSriov {
cmdArgs = append(cmdArgs, fmt.Sprintf("%s=True", EnableSriov))
Expand Down

0 comments on commit bd6b5cd

Please sign in to comment.