Skip to content

Commit

Permalink
Make ConfigSriovDevice function private
Browse files Browse the repository at this point in the history
Make the function private and remove it from
the interface

Signed-off-by: Yury Kulazhenkov <[email protected]>
  • Loading branch information
ykulazhenkov committed Feb 14, 2024
1 parent d4aaea7 commit 8f2a378
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
14 changes: 0 additions & 14 deletions pkg/helper/mock/mock_helper.go

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

8 changes: 4 additions & 4 deletions pkg/host/internal/sriov/sriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,16 +452,16 @@ func (s *sriov) configSriovVFDevices(iface *sriovnetworkv1.Interface, ifaceStatu
return nil
}

func (s *sriov) ConfigSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt, skipVFConfiguration bool) error {
log.Log.V(2).Info("ConfigSriovDevice(): configure sriov device",
func (s *sriov) configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt, skipVFConfiguration bool) error {
log.Log.V(2).Info("configSriovDevice(): configure sriov device",
"device", iface.PciAddress, "config", iface, "skipVFConfiguration", skipVFConfiguration)
if !iface.ExternallyManaged {
if err := s.configSriovPFDevice(iface, ifaceStatus); err != nil {
return err
}
}
if skipVFConfiguration {
log.Log.V(2).Info("ConfigSriovDevice(): skipVFConfiguration is true, unbind all VFs from drivers",
log.Log.V(2).Info("configSriovDevice(): skipVFConfiguration is true, unbind all VFs from drivers",
"device", iface.PciAddress)
return s.unbindAllVFsOnPF(iface.PciAddress)
}
Expand Down Expand Up @@ -520,7 +520,7 @@ func (s *sriov) ConfigSriovInterfaces(storeManager store.ManagerInterface,

break
}
if err := s.ConfigSriovDevice(&iface, &ifaceStatus, skipVFConfiguration); err != nil {
if err := s.configSriovDevice(&iface, &ifaceStatus, skipVFConfiguration); err != nil {
log.Log.Error(err, "SyncNodeState(): fail to configure sriov interface. resetting interface.", "address", iface.PciAddress)
if iface.ExternallyManaged {
log.Log.Info("SyncNodeState(): skipping device reset as the nic is marked as externally created")
Expand Down
14 changes: 0 additions & 14 deletions pkg/host/mock/mock_host.go

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

3 changes: 0 additions & 3 deletions pkg/host/types/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ type SriovInterface interface {
ResetSriovDevice(ifaceStatus sriovnetworkv1.InterfaceExt) error
// DiscoverSriovDevices returns a list of all the available SR-IOV capable network interfaces on the system
DiscoverSriovDevices(storeManager store.ManagerInterface) ([]sriovnetworkv1.InterfaceExt, error)
// ConfigSriovDevice configure the request SR-IOV device with the desired configuration,
// if skipVFConfiguration flag is set, the function will configure PF and create VFs on it, but will skip VFs configuration
ConfigSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt, skipVFConfiguration bool) error
// ConfigSriovInterfaces configure multiple SR-IOV devices with the desired configuration
// if skipVFConfiguration flag is set, the function will configure PF and create VFs on it, but will skip VFs configuration
ConfigSriovInterfaces(storeManager store.ManagerInterface, interfaces []sriovnetworkv1.Interface,
Expand Down

0 comments on commit 8f2a378

Please sign in to comment.