The nova.pci.utils Module

get_function_by_ifname(ifname)

Given the device name, returns the PCI address of a device and returns True if the address in a physical function.

get_ifname_by_pci_address(pci_addr, pf_interface=False)

Get the interface name based on a VF’s pci address

The returned interface name is either the parent PF’s or that of the VF itself based on the argument of pf_interface.

get_pci_address(domain, bus, slot, func)
get_pci_address_fields(pci_addr)
get_vf_num_by_pci_address(pci_addr)

Get the VF number based on a VF’s pci address

A VF is associated with an VF number, which ip link command uses to configure it. This number can be obtained from the PCI device filesystem.

is_physical_function(domain, bus, slot, function)
parse_address(address)

Returns (domain, bus, slot, function) from PCI address that is stored in PciDevice DB table.

pci_device_prop_match(pci_dev, specs)

Check if the pci_dev meet spec requirement

Specs is a list of PCI device property requirements. An example of device requirement that the PCI should be either: a) Device with vendor_id as 0x8086 and product_id as 0x8259, or b) Device with vendor_id as 0x10de and product_id as 0x10d8:

[{“vendor_id”:”8086”, “product_id”:”8259”},
{“vendor_id”:”10de”, “product_id”:”10d8”}]

Previous topic

The nova.pci.stats Module

Next topic

The nova.pci.whitelist Module

Project Source

This Page