Skip to content

Commit

Permalink
update mlxutils package
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Sch <[email protected]>
  • Loading branch information
SchSeba committed Dec 17, 2023
1 parent 5a85ec3 commit d10f2d3
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 92 deletions.
64 changes: 32 additions & 32 deletions pkg/platforms/mock/mock_platforms.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/plugins/mellanox/mellanox_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type MellanoxPlugin struct {
helpers plugin.HostHelpersInterface
}

var attributesToChange map[string]mlx.MLXNic
var attributesToChange map[string]mlx.MlxNic
var mellanoxNicsStatus map[string]map[string]sriovnetworkv1.InterfaceExt
var mellanoxNicsSpec map[string]sriovnetworkv1.Interface

Expand Down Expand Up @@ -50,7 +50,7 @@ func (p *MellanoxPlugin) OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeS
needDrain = false
needReboot = false
err = nil
attributesToChange = map[string]mlx.MLXNic{}
attributesToChange = map[string]mlx.MlxNic{}
mellanoxNicsSpec = map[string]sriovnetworkv1.Interface{}
processedNics := map[string]bool{}

Expand Down Expand Up @@ -95,14 +95,14 @@ func (p *MellanoxPlugin) OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeS
continue
}
processedNics[pciPrefix] = true
fwCurrent, fwNext, err := p.helpers.GetMlnxNicFwData(ifaceSpec.PciAddress)
fwCurrent, fwNext, err := p.helpers.GetMlxNicFwData(ifaceSpec.PciAddress)
if err != nil {
return false, false, err
}

isDualPort := mlx.IsDualPort(ifaceSpec.PciAddress, mellanoxNicsStatus)
// Attributes to change
attrs := &mlx.MLXNic{TotalVfs: -1}
attrs := &mlx.MlxNic{TotalVfs: -1}
var changeWithoutReboot bool

var totalVfs int
Expand Down Expand Up @@ -144,13 +144,13 @@ func (p *MellanoxPlugin) OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeS
continue
}

_, fwNext, err := p.helpers.GetMlnxNicFwData(pciAddress)
_, fwNext, err := p.helpers.GetMlxNicFwData(pciAddress)
if err != nil {
return false, false, err
}

if fwNext.TotalVfs > 0 || fwNext.EnableSriov {
attributesToChange[pciAddress] = mlx.MLXNic{TotalVfs: 0}
attributesToChange[pciAddress] = mlx.MlxNic{TotalVfs: 0}
log.Log.V(2).Info("Changing TotalVfs to 0, doesn't require rebooting", "fwNext.totalVfs", fwNext.TotalVfs)
}
}
Expand All @@ -169,5 +169,5 @@ func (p *MellanoxPlugin) Apply() error {
return nil
}
log.Log.Info("mellanox-plugin Apply()")
return p.helpers.MLXConfigFW(attributesToChange)
return p.helpers.MlxConfigFW(attributesToChange)
}
34 changes: 17 additions & 17 deletions pkg/plugins/mock/mock_plugin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/plugins/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewVendorPluginHelpers(utilsHelper utils.UtilsInterface,

func NewDefaultVendorPluginHelpers() (*HostHelpers, error) {
utilsHelper := utils.NewUtilsHelper()
mlxHelper := mlx.NewMellanoxHelper(utilsHelper)
mlxHelper := mlx.New(utilsHelper)
hostManager := host.NewHostManager(utilsHelper)
storeManager, err := host.NewStoreManager()
if err != nil {
Expand Down
Loading

0 comments on commit d10f2d3

Please sign in to comment.