Comment 1 for bug 1832169

Revision history for this message
sean mooney (sean-k-mooney) wrote :

the device_type is optional but if set it will be checked

https://github.com/openstack/nova/blob/51e3787bf89f19af8a9d37288a63731563c92fca/nova/pci/request.py#L136-L138

type-pci is not intended for fore use with device that are capable of sriov and exits primarly for use with pci device that are not nics.

type-PCI is reserved for device that will be passthough via the pci aliase in the falvor that should not be request able by neutron based sriov port.

it is generally used for gpus, crypto cards like intel QAT devices or nics that are not managed by neutron and do not support sriov.

type-PF is use for device that weill be request using neutron vnic_type=direct-physical.
and
type-VF is used for edvice that eill be requested using neutron vnic_type=direct.

type-pf and type-pf may also be used for non nic device but in that case the physical_network tage must
not be set in the pci whitelist.

when we process a neutron prot we translate form the port vnic type to teh correct device_type here.
https://github.com/openstack/nova/blob/212607dc6feaf311ba92295fd07363b3ee9ae010/nova/network/neutronv2/api.py#L2046-L2060

when enumarting the devices in the libvirt virt dirver here
https://opendev.org/openstack/nova/src/branch/master/nova/virt/libvirt/driver.py#L6076-L6113

we interperat the device capabilities to determine if the which type to use when reporting the device.

depending on the nic, firmware and and dirver otions the present of the virtual_fucntion capablity in the
pci capablityis reported by libvirt can change.

that is to say on older generation intel nicantics such as the intel 82599 series
the presence of the virtual_fucntion cabpablity was ondition on if data center bridgeing
was enabled in teh fireware.

in data center bridgeing mode sriov was disabled to allow VMDQ to be used so even with the same vendor and product id
the device type can change.

when a device support sriov and is listed as a PF there are also addtional checks that the schduler and pci resouce tracker must perfrom to determing that a PF is availble for assignemnt to a vm. The most import being the pci resouce track must first confirm that the PF etiher has no VFs or that all VFs are free.

For type-PCI we do not have to do that check as we know it does not support sriov and thereforce will not have VF that could be in use.