Skip to content

Commit

Permalink
cnf-tests: improve sriov nic selector
Browse files Browse the repository at this point in the history
this commit add a check to be sure for intel nics that we enable sriov in the bios.
if that is not the case the totalvf variabel will be 0 so we skip that nic

Signed-off-by: Sebastian Sch [email protected]
Signed-off-by: Sebastian Sch <[email protected]>
  • Loading branch information
SchSeba committed Nov 23, 2022
1 parent 2a2c50e commit 062a2e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions cnf-tests/testsuites/e2esuite/dpdk/dpdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,7 @@ func findSriovDeviceForDPDK(sriovInfos *sriovcluster.EnabledNodes, nodeNames []s
continue
}

// if the sriov is not able 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 iface.Vendor == networks.IntelVendorID && iface.TotalVfs == 0 {
if networks.IsIntelDisabledNic(iface) {
continue
}

Expand Down
10 changes: 10 additions & 0 deletions cnf-tests/testsuites/pkg/networks/sriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ func GetSupportedSriovNics() (map[string]string, error) {
return supportedNicsConfigMap.Data, nil
}

// if the sriov is not able 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
func IsIntelDisabledNic(iface sriovv1.InterfaceExt) bool {
if iface.Vendor == IntelVendorID && iface.TotalVfs == 0 {
return true
}
return false
}

func CreateSriovPolicyAndNetworkDPDKOnlyWithVhost(dpdkResourceName, workerCnfLabelSelector string) {
createSriovPolicyAndNetwork(dpdkResourceName, workerCnfLabelSelector, true)
}
Expand Down

0 comments on commit 062a2e8

Please sign in to comment.