diff --git a/pkg/helper/mock/mock_helper.go b/pkg/helper/mock/mock_helper.go index e311edcd56..16bd64c742 100644 --- a/pkg/helper/mock/mock_helper.go +++ b/pkg/helper/mock/mock_helper.go @@ -154,20 +154,6 @@ func (mr *MockHostHelpersInterfaceMockRecorder) CompareServices(serviceA, servic return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CompareServices", reflect.TypeOf((*MockHostHelpersInterface)(nil).CompareServices), serviceA, serviceB) } -// ConfigSriovDevice mocks base method. -func (m *MockHostHelpersInterface) ConfigSriovDevice(iface *v1.Interface, ifaceStatus *v1.InterfaceExt, skipVFConfiguration bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ConfigSriovDevice", iface, ifaceStatus, skipVFConfiguration) - ret0, _ := ret[0].(error) - return ret0 -} - -// ConfigSriovDevice indicates an expected call of ConfigSriovDevice. -func (mr *MockHostHelpersInterfaceMockRecorder) ConfigSriovDevice(iface, ifaceStatus, skipVFConfiguration interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigSriovDevice", reflect.TypeOf((*MockHostHelpersInterface)(nil).ConfigSriovDevice), iface, ifaceStatus, skipVFConfiguration) -} - // ConfigSriovDeviceVirtual mocks base method. func (m *MockHostHelpersInterface) ConfigSriovDeviceVirtual(iface *v1.Interface) error { m.ctrl.T.Helper() diff --git a/pkg/host/internal/sriov/sriov.go b/pkg/host/internal/sriov/sriov.go index 3c07d7ad81..48d2488f19 100644 --- a/pkg/host/internal/sriov/sriov.go +++ b/pkg/host/internal/sriov/sriov.go @@ -452,8 +452,8 @@ 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 { @@ -461,7 +461,7 @@ func (s *sriov) ConfigSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus * } } 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) } @@ -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") diff --git a/pkg/host/mock/mock_host.go b/pkg/host/mock/mock_host.go index bb719f4dca..6c6d704285 100644 --- a/pkg/host/mock/mock_host.go +++ b/pkg/host/mock/mock_host.go @@ -124,20 +124,6 @@ func (mr *MockHostManagerInterfaceMockRecorder) CompareServices(serviceA, servic return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CompareServices", reflect.TypeOf((*MockHostManagerInterface)(nil).CompareServices), serviceA, serviceB) } -// ConfigSriovDevice mocks base method. -func (m *MockHostManagerInterface) ConfigSriovDevice(iface *v1.Interface, ifaceStatus *v1.InterfaceExt, skipVFConfiguration bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ConfigSriovDevice", iface, ifaceStatus, skipVFConfiguration) - ret0, _ := ret[0].(error) - return ret0 -} - -// ConfigSriovDevice indicates an expected call of ConfigSriovDevice. -func (mr *MockHostManagerInterfaceMockRecorder) ConfigSriovDevice(iface, ifaceStatus, skipVFConfiguration interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigSriovDevice", reflect.TypeOf((*MockHostManagerInterface)(nil).ConfigSriovDevice), iface, ifaceStatus, skipVFConfiguration) -} - // ConfigSriovDeviceVirtual mocks base method. func (m *MockHostManagerInterface) ConfigSriovDeviceVirtual(iface *v1.Interface) error { m.ctrl.T.Helper() diff --git a/pkg/host/types/interfaces.go b/pkg/host/types/interfaces.go index 9bf14353f6..2f7e26f86e 100644 --- a/pkg/host/types/interfaces.go +++ b/pkg/host/types/interfaces.go @@ -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,