The following are the mainstream network I/O virtualization technologies:
Software simulation—Simulates vNICs through the hypervisor to provide the same interfaces as physical devices. The operating system of a VM can use a vNIC directly. The performance of vNICs simulated by using this technology is poor.
NIC passthrough—Enables VMs to directly access physical I/O devices and provides the best performance. However, a physical I/O device can be used by only one VM at a time.
SR-IOV—Virtual network I/O solution proposed by Intel in 2007, which not only inherits the high performance of NIC passthrough but also supports physical I/O device sharing across VMs.
In October 2007, PCI-SIG released the PCI-SIG Single Root I/O Virtualization (SR-IOV) specification, which details how multiple VMs share a single I/O device.
SR-IOV provides the following functions:
PFs—A Physical Function (PF) is a PCI function of a network adapter. A PF can be virtualized into multiple VFs.
VFs—A Virtual Function (VF) is a virtual instance created on a physical NIC that supports SR-IOV. A VF is an independent NIC and has its own PCI configuration space. A physical NIC can be shared by multiple VFs.
After SR-IOV is enabled in the PF, the PCI configuration space of each VF can be accessed by the PF's bus, device, and function number. Each VF has a PCI memory space for register set mapping. The VF device drivers operate on the register set to enable its functionality and the VF appears as an actual PCI device. After a VF is created, you can assign it directly to an I/O domain, which allows VFs to share physical devices and perform I/O without the CPU and hypervisor software overhead.
A physical NIC integrated with the SR-IOV functionality can be virtualized into multiple VFs, each of which has its own virtual PCIe channel. The virtual PCIe channels of the VFs share the PCIe channel of the physical NIC. A VM can use one or multiple VFs and directly access its own VFs without the intervention of the hypervisor, which greatly improves the network throughput performance.
As a new technology, SR-IOV still has imperfections:
The number of VMs that a single physical NIC supports is limited.
Not all physical NICs support SR-IOV because of hardware limitations.