我有一台带有英特尔 SRIOV 卡的 KVM。
5: enp4s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:0c:bd:05:d9:82 brd ff:ff:ff:ff:ff:ff
vf 0 MAC 00:0c:bd:05:d9:11, spoof checking off, link-state auto
vf 1 MAC 00:0c:bd:05:d9:ab, spoof checking off, link-state auto
vf 2 MAC 00:0c:bd:05:d9:a2, spoof checking off, link-state auto
vf 3 MAC 00:0c:bd:05:d9:ac, spoof checking off, link-state auto
vf 4 MAC 00:0c:bd:05:d9:ad, spoof checking off, link-state auto
vf 5 MAC 00:0c:bd:05:d9:ae, spoof checking off, link-state auto
vf 6 MAC 00:0c:bd:05:d9:af, spoof checking off, link-state auto
vf 7 MAC 00:0c:bd:05:d9:a1, spoof checking off, link-state auto
8: enp4s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:0c:bd:05:d9:83 brd ff:ff:ff:ff:ff:ff
vf 0 MAC 00:0c:bd:05:d9:12, spoof checking off, link-state auto
vf 1 MAC 00:0c:bd:05:d9:bb, spoof checking off, link-state auto
vf 2 MAC 00:0c:bd:05:d9:bc, spoof checking off, link-state auto
vf 3 MAC 00:0c:bd:05:d9:bd, spoof checking off, link-state auto
vf 4 MAC 00:0c:bd:05:d9:be, spoof checking off, link-state auto
vf 5 MAC 00:0c:bd:05:d9:bf, spoof checking off, link-state auto
vf 6 MAC 00:0c:bd:05:d9:b1, spoof checking off, link-state auto
vf 7 MAC 00:0c:bd:05:d9:b2, spoof checking off, link-state auto
我在 GUEST Ubuntu 机器中使用了每张卡的 vf0
物理功能 enp4s0f0 具有以下虚拟功能:
PCI BDF Interface
======= =========
0000:04:10.0
0000:04:10.2
0000:04:10.4
0000:04:10.6
0000:04:11.0
0000:04:11.2
0000:04:11.4
0000:04:11.6
物理功能 enp4s0f1 具有以下虚拟功能:
PCI BDF Interface
======= =========
0000:04:10.1
0000:04:10.3
0000:04:10.5
0000:04:10.7
0000:04:11.1
0000:04:11.3
0000:04:11.5
dumpxml 片段
<interface type='hostdev'>
<mac address='00:0c:bd:05:d9:11'/>
<driver name='vfio'/>
<source>
<address type='pci' domain='0x0000' bus='0x04' slot='0x10' function='0x0'/>
</source>
<alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</interface>
<interface type='hostdev'>
<mac address='00:0c:bd:05:d9:12'/>
<driver name='vfio'/>
<source>
<address type='pci' domain='0x0000' bus='0x04' slot='0x10' function='0x1'/>
</source>
<alias name='hostdev1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
我的粘合配置:
uto eth1
iface eth1 inet manual
bond-master bond0
auto eth2
iface eth2 inet manual
bond-master bond0
auto bond0
iface bond0 inet static
address 192.168.23.101
netmask 255.255.255.0
bond-slaves none
bond-mode 2
bond-miimon 100
bond-downdelay 0
bond-updelay 0
cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: load balancing (xor)
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:bd:05:d9:11
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:bd:05:d9:12
Slave queue ID: 0
bond0 Link encap:Ethernet HWaddr 00:0c:bd:05:d9:11
inet addr:192.168.23.101 Bcast:192.168.23.255 Mask:255.255.255.0
inet6 addr: fe80::20c:bdff:fe05:d911/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:122 errors:0 dropped:0 overruns:0 frame:0
TX packets:295 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:33881 (33.8 KB) TX bytes:34294 (34.2 KB)
eth1 Link encap:Ethernet HWaddr 00:0c:bd:05:d9:11
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:122 errors:0 dropped:0 overruns:0 frame:0
TX packets:183 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33881 (33.8 KB) TX bytes:28212 (28.2 KB)
eth2 Link encap:Ethernet HWaddr 00:0c:bd:05:d9:11
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
**RX packets:0** errors:0 dropped:0 overruns:0 frame:0
TX packets:112 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:6082 (6.0 KB)
这里 bond0 MAC 与 eth1 MAC 相同,因为 eth1 首先出现。问题是,当我在 PF 中收到与 eth2 对应的数据包时,数据包在 GUEST(eth2) 中收到,eth2 RX 为 0...
可能是什么问题?有时重启后 eth2 首先出现,并且 bond0 具有 eth2 MAC,此时 eth1 RX 为零。