VPC-SI assigns the vNIC interfaces in the order offered by the hypervisor. You cannot be guaranteed that the order of the vNICs
as listed in the hypervisor CLI/GUI is the same as how the hypervisor offers them to the VM.
The order that VPC-SI finds the vNICs is subject to the PCI bus enumeration order and even paravirtual devices are represented on the PCI bus.
The PCI bus is enumerated in a depth first manner where bridges are explored before additional devices at the same level.
If all the network interfaces are of the same type then knowing the PCI topology is sufficient to get the vNIC order correct.
If the network interfaces are of different types, then the order is dependent on the PCI topology plus the device driver load
order inside the VM. The device driver load order is not guaranteed to be the same from software release to release but in
general paravirtual devices are prior to pass-through devices.
There are several
methods available to identify NICs.
-
MAC address:
MAC address of the interface
-
Virtual PCI ID
-
Bonded interfaces: When using network device bonding, network interfaces are identified to serve as the slave interface role.
The slave interfaces in the bond are identified using MAC, PCI ID, or Interface type.
-
Interface type and instance number.
Virtual PCI
ID
Devices on a PCI
bus are identified by a unique tuple known as the domain, bus, device, and
function numbers. These identifiers can be identified in several ways.
Inside the guest,
the
lspci utility
shows the bus configuration:
# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 System peripheral: Intel Corporation 6300ESB Watchdog Timer
00:04.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
00:05.0 Ethernet controller: Red Hat, Inc Virtio network device
00:06.0 Ethernet controller: Red Hat, Inc Virtio network device
The domain, bus,
device, and function numbers for this virtual bus are shown here:
Table 2. Virtual PCI
IDs
Line
|
Domain
|
Bus
|
Device
|
Function
|
00:00.0
Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
|
0
|
0
|
0
|
0
|
00:01.0
ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
|
0
|
0
|
1
|
0
|
00:01.1
IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
|
0
|
0
|
1
|
1
|
00:01.2
USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
|
0
|
0
|
1
|
2
|
00:01.3
Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
|
0
|
0
|
1
|
3
|
00:02.0
VGA compatible controller: Cirrus Logic GD 5446
|
0
|
0
|
2
|
0
|
00:03.0
System peripheral: Intel Corporation 6300ESB Watchdog Timer
|
0
|
0
|
3
|
0
|
00:04.0
Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
|
0
|
0
|
4
|
0
|
00:05.0
Ethernet controller: Red Hat, Inc Virtio network device
|
0
|
0
|
5
|
0
|
00:06.0
Ethernet controller: Red Hat, Inc Virtio network device
|
0
|
0
|
6
|
0
|
For libvirt-based
virtual machines, you can get the virtual PCI bus topology from the
virsh dumpxml
command. Note that the libvirt schema uses the term
slot for the
device number. This is a snippet of the xml description of the virtual machine
used in the previous example:
<interface type='bridge'>
<mac address='52:54:00:c2:d0:5f'/>
<source bridge='br3043'/>
<target dev='vnet0'/>
<model type='virtio'/>
<driver name='vhost' queues='8'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
<interface type='bridge'>
<mac address='52:54:00:c3:60:eb'/>
<source bridge='br0'/>
<target dev='vnet1'/>
<model type='virtio'/>
<alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</interface>
Interface Type and Instance Number
Here the NIC is identified by its type using its Linux device driver name (virtio_net, vmxnet3, ixgbe, i40e, etc) and its
instance number. The instance number is based on PCI enumeration order for that type of interface starting at instance number
1. The interface type is available to identify both paravirtual types as well as pass-through interfaces and SR-IOV virtual
functions. The PCI enumeration order of devices on the PCI bus can be seen from the lspci utility, which is on the host OS.
For example, a CF with the following guest PCI topology indicates that virtio_net interface number1 is the Ethernet controller
at 00:05.0 and virtio_net interface number 2 is the Ethernet Controller at 00:06.0. The output is from the lspci command executed in the guest:
# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 System peripheral: Intel Corporation 6300ESB Watchdog Timer
00:04.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
00:05.0 Ethernet controller: Red Hat, Inc Virtio network device
00:06.0 Ethernet controller: Red Hat, Inc Virtio network device
Here is the complete list of the supported Linux drivers:
Table 3. Supported Linux Drivers
Type
|
PCI Vendor / Device ID
|
Driver Name
|
VIRTIO (paravirtual NIC for KVM)
|
0x10af / 0x1000
|
virtio_net
|
VMXNET3 (paravirtual NIC for VMware)
|
0x15ad / 0x07b0
|
vmxnet3
|
Intel 10 Gigabit Ethernet
|
0x8086 / 0x10b6
0x8086 / 0x10c6
0x8086 / 0x10c7
0x8086 / 0x10c8
0x8086 / 0x150b
0x8086 / 0x10dd
0x8086 / 0x10ec
0x8086 / 0x10f1
0x8086 / 0x10e1
0x8086 / 0x10db
0x8086 / 0x1508
0x8086 / 0x10f7
0x8086 / 0x10fc
0x8086 / 0x1517
0x8086 / 0x10fb
0x8086 / 0x1507
0x8086 / 0x1514
0x8086 / 0x10f9
0x8086 / 0x152a
0x8086 / 0x1529
0x8086 / 0x151c
0x8086 / 0x10f8
0x8086 / 0x1528
0x8086 / 0x154d
0x8086 / 0x154f
0x8086 / 0x1557
|
ixgbe
|
Intel 10 Gigabit NIC virtual function
|
0x8086 / 0x10ed
0x8086 / 0x1515
|
ixgbevf
|
Cisco UCS NIC
|
0x1137 / 0x0043
0x1137 / 0x0044
0x1137 / 0x0071
|
enic
|
Mellanox ConnectX-5
Note
|
Mellanox is supported only on the User Plane.
|
|
0x15b3 / 0x1017
0x15b3 / 0x1018
|
mlx5_core
|
Intel XL 710 family NIC (PF)
|
0x8086 / 0x1572 (40 gig)
0x8086 / 0x1574 (40 gig)
0x8086 / 0x1580 (40 gig)
0x8086 / 0x1581 (40 gig)
0x8086 / 0x1583 (40 gig)
0x8086 / 0x1584 (40 gig)
0x8086 / 0x1585 (40 gig)
0x8086 / 0x158a (25 gig)
0x8086 / 0x158b (25 gig)
|
i40e**
|
Intel XL 710 family NIC virtual function
|
0x8086 / 0x154c
|
i40evf
|
** Note: A known issue exists where MAC address assignment does not occur dynamically for SRIOV VFs created on the host when
using the i40e driver. MAC address assignment is necessary to boot the StarOS VM. As a workaround, MAC address assignment must be configured
from the host. Refer to the following link for more information:https://www.intel.com/content/dam/www/public/us/en/documents/technology-briefs/xl710-sr-iov-config-guide-gbe-linux-brief.pdf