@@ -247,24 +247,24 @@ func (n *EnabledNodes) FindOneVfioSriovDevice() (string, sriovv1.InterfaceExt) {
247247
248248// FindOneMellanoxSriovDevice retrieves a valid sriov device for the given node.
249249func (n * EnabledNodes ) FindOneMellanoxSriovDevice (node string ) (* sriovv1.InterfaceExt , error ) {
250- s , ok := n .States [node ]
251- if ! ok {
252- return nil , fmt .Errorf ("node %s not found" , node )
253- }
254-
255250 // return error here as mlx interfaces are not supported when secure boot is enabled
256251 // TODO: remove this when mlx support secure boot/lockdown mode
257252 if n .IsSecureBootEnabled [node ] {
258253 return nil , fmt .Errorf ("secure boot is enabled on the node mellanox cards are not supported" )
259254 }
260255
261- for _ , itf := range s .Status .Interfaces {
262- if itf .Vendor == mlxVendorID && sriovv1 .IsSupportedModel (itf .Vendor , itf .DeviceID ) {
263- return & itf , nil
256+ devices , err := n .FindSriovDevices (node )
257+ if err != nil {
258+ return nil , fmt .Errorf ("unable to find a mellanox sriov devices in node %s: %w" , node , err )
259+ }
260+
261+ for _ , nic := range devices {
262+ if nic .Vendor == mlxVendorID && sriovv1 .IsSupportedModel (nic .Vendor , nic .DeviceID ) {
263+ return nic , nil
264264 }
265265 }
266266
267- return nil , fmt .Errorf ("unable to find a mellanox sriov devices in node %s" , node )
267+ return nil , fmt .Errorf ("no Mellanox devices found in node %s. Available devices [%+v] " , node , devices )
268268}
269269
270270// SriovStable tells if all the node states are in sync (and the cluster is ready for another round of tests)
0 commit comments