Skip to content

Commit

Permalink
Merge pull request #720 from zeeke/sync-2022-11-17
Browse files Browse the repository at this point in the history
Sync k8snetworkplumbingwg/master 2022-11-17
  • Loading branch information
openshift-merge-robot authored Nov 17, 2022
2 parents 7a27686 + 93f99a8 commit c931c93
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/util/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ func (n *EnabledNodes) FindOneSriovDevice(node string) (*sriovv1.InterfaceExt, e
continue
}

// if the sriov is not enable in the kernel for intel nic the totalVF will be 0 so we skip the device
// That is not the case for Mellanox devices that will report 0 until we configure the sriov interfaces
// with the mstconfig package
if itf.Vendor == intelVendorID && itf.TotalVfs == 0 {
continue
}

return &itf, nil
}
}
Expand All @@ -126,6 +133,13 @@ func (n *EnabledNodes) FindSriovDevices(node string) ([]*sriovv1.InterfaceExt, e
continue
}

// if the sriov is not enable in the kernel for intel nic the totalVF will be 0 so we skip the device
// That is not the case for Mellanox devices that will report 0 until we configure the sriov interfaces
// with the mstconfig package
if itf.Vendor == intelVendorID && itf.TotalVfs == 0 {
continue
}

devices = append(devices, &s.Status.Interfaces[i])
}
}
Expand All @@ -136,7 +150,7 @@ func (n *EnabledNodes) FindSriovDevices(node string) ([]*sriovv1.InterfaceExt, e
func (n *EnabledNodes) FindOneVfioSriovDevice() (string, sriovv1.InterfaceExt) {
for _, node := range n.Nodes {
for _, nic := range n.States[node].Status.Interfaces {
if nic.Vendor == intelVendorID && sriovv1.IsSupportedModel(nic.Vendor, nic.DeviceID) {
if nic.Vendor == intelVendorID && sriovv1.IsSupportedModel(nic.Vendor, nic.DeviceID) && nic.TotalVfs != 0 {
return node, nic
}
}
Expand Down

0 comments on commit c931c93

Please sign in to comment.