virtio: vm killed (Guest moved used index)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
I ran a DPDK application with virtio ports. If I killed and relaunched it, VM is
killed by qemu with the following message:
> qemu-system-x86_64: Guest moved used index from 571 to 0
If I ran the same application with e1000 ports, I haven't this issue.
Network topology
================
I used two VM machines with last qemu-2.5 with two virtio-net netdevs. Both
netdevs are connected through a VDE switch.
On testnode, I used a Debian 8 (3.16) and virtio-net linux drivers. On DUT, I
used a Ubuntu 14.04 (3.13) with DPDK (next/16_04) with virtio pmd.
(Topology in attachment, launchpad does not support ascii-art)
Steps
=====
1. Start a DPDK application using virtio ports
2. Send traffic over those ports (using ping flood ...)
3. Kill this DPDK application (sending SIGKILL, making it crash etc...)
4. Restart this DPDK application with the same configuration
5. During EAL initialization, if an incoming packet is received on a virtio
port, qemu exits (error code 1) with the following message:
> qemu-system-x86_64: Guest moved used index from 571 to 0
NOTE: This issue is *NOT* seen with e1000 interface
Configuration
=============
Hypervisor
-----------
Debian 8
Kernel 3.16.0-4-amd64 #1 SMP Debian 3.16.7-
Qemu
----
qemu 2.5 (vanilla)
./configure --enable-kvm --enable-vhost-net --enable-vde --target-
> qemu-system-x86_64 -k fr --enable-kvm -m 4G -cpu host -smp \
sockets=
-qmp tcp::47257,
"/opt/
-netdev vde,id=
virtio-
vde,id=
virtio-
On Testnode
-----------
Configure interface to send continuous traffic to PMD
> ip link set dev eth0 up
> ip addr add 1.1.1.1/24 dev eth0
> ip neigh add 1.1.1.2 lladdr DE:ED:01:0C:DD:CC dev eth0
> ping -q -f 1.1.1.2
On DUT
------
Configure and start testpmd (a standard DPDK application)
> modprobe uio
> modprobe igb_uio
> mkdir -p /mnt/huge
> mount -t hugetlbfs nodev /mnt/huge
> echo 64 > /sys/devices/
> dpdk_nic_bind --bind=igb_uio 0000:00:04.0
> dpdk_nic_bind --bind=igb_uio 0000:00:05.0
> testpmd --huge-
-w 0000:00:05.0 --log-level 8 -- -i --nb-cores=1 --nb-ports=2\
--total-
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 0 on socket 0
EAL: Support maximum 255 logical core(s) by configuration.
EAL: Detected 2 lcore(s)
EAL: Probing VFIO support...
EAL: Module /sys/module/
EAL: VFIO modules not loaded, skipping VFIO support...
EAL: Setting up physically contiguous memory...
EAL: Ask a virtual area of 0x4600000 bytes
EAL: Virtual area found at 0x7fbcbf000000 (size = 0x4600000)
EAL: Ask a virtual area of 0xc00000 bytes
EAL: Virtual area found at 0x7fbcbe200000 (size = 0xc00000)
EAL: Ask a virtual area of 0x400000 bytes
EAL: Virtual area found at 0x7fbcbdc00000 (size = 0x400000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fbcbd800000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fbcbd400000 (size = 0x200000)
EAL: Ask a virtual area of 0x1c00000 bytes
EAL: Virtual area found at 0x7fbcbb600000 (size = 0x1c00000)
EAL: Ask a virtual area of 0x600000 bytes
EAL: Virtual area found at 0x7fbcbae00000 (size = 0x600000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fbcbaa00000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fbcba600000 (size = 0x200000)
EAL: Requesting 64 pages of size 2MB from socket 0
EAL: TSC frequency is ~3192572 KHz
EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles !
EAL: Master lcore 0 is ready (tid=c5707900;
EAL: lcore 1 is ready (tid=c3ffd700;
EAL: PCI device 0000:00:04.0 on NUMA socket -1
EAL: probe driver: 1af4:1000 rte_virtio_pmd
EAL: PCI memory mapped at 0x7fbcc3600000
PMD: virtio_read_caps(): [40] skipping non VNDR cap id: 11
PMD: virtio_read_caps(): no modern virtio pci device found.
PMD: vtpci_init(): trying with legacy virtio pci.
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: virtio_
PMD: virtio_
EAL: PCI device 0000:00:05.0 on NUMA socket -1
EAL: probe driver: 1af4:1000 rte_virtio_pmd
EAL: PCI memory mapped at 0x7fbcc3601000
PMD: virtio_read_caps(): [40] skipping non VNDR cap id: 11
PMD: virtio_read_caps(): no modern virtio pci device found.
PMD: vtpci_init(): trying with legacy virtio pci.
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: eth_virtio_
PMD: virtio_
PMD: virtio_
Interactive-mode selected
Configuring Port 0 (socket 0)
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_dev_start(): nb_queues=1
PMD: virtio_dev_start(): Notified backend at initialization
PMD: virtio_dev_start(): VQ: - size=256; free=0; used=0; desc_head_
PMD: virtio_dev_start(): VQ: - size=256; free=256; used=0; desc_head_idx=0; avail.idx=0; used_cons_idx=0; used.idx=0; avail.flags=0x1; used.flags=0x0
rte_eth_
PMD: virtio_
PMD: virtio_
PMD: virtio_
vq->vq_
PMD: virtio_
PMD: virtio_
PMD: virtio_
vq->vq_
PMD: virtio_
PMD: virtio_
Port 0: DE:ED:01:0C:DD:CC
Configuring Port 1 (socket 0)
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_dev_start(): nb_queues=1
PMD: virtio_dev_start(): Notified backend at initialization
PMD: virtio_dev_start(): VQ: - size=256; free=0; used=0; desc_head_
PMD: virtio_dev_start(): VQ: - size=256; free=256; used=0; desc_head_idx=0; avail.idx=0; used_cons_idx=0; used.idx=0; avail.flags=0x1; used.flags=0x0
rte_eth_
PMD: virtio_
PMD: virtio_
PMD: virtio_
vq->vq_
PMD: virtio_
PMD: virtio_
PMD: virtio_
vq->vq_
PMD: virtio_
PMD: virtio_
Port 1: DE:ED:02:04:01:60
Checking link statuses...
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
PMD: virtio_
Port 0 Link Up - speed 10000 Mbps - full-duplex
PMD: virtio_
PMD: virtio_
Port 1 Link Up - speed 10000 Mbps - full-duplex
Done
PMD: virtio_
PMD: virtio_
PMD: virtio_
vq->vq_
PMD: virtio_
PMD: virtio_
PMD: virtio_
vq->vq_
testpmd> start
io packet forwarding - CRC stripping disabled - packets/burst=32
nb forwarding cores=1 - nb forwarding ports=2
RX queues=1 - RX desc=128 - RX free threshold=0
RX threshold registers: pthresh=0 hthresh=0 wthresh=0
TX queues=1 - TX desc=512 - TX free threshold=0
TX threshold registers: pthresh=0 hthresh=0 wthresh=0
TX RS bit threshold=0 - TXQ flags=0xf00
...
[wait a few seconds]
...
Kill the application
> kill -9 $(pidof testpmd) (On another shell)
Relaunch the application
> testpmd --huge-
-w 0000:00:05.0 --log-level 8 -- -i --nb-cores=1 --nb-ports=2 \
--total-
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 0 on socket 0
EAL: Support maximum 255 logical core(s) by configuration.
EAL: Detected 2 lcore(s)
EAL: Probing VFIO support...
EAL: Module /sys/module/
EAL: VFIO modules not loaded, skipping VFIO support...
EAL: Setting up physically contiguous memory...
EAL: Ask a virtual area of 0x4400000 bytes
EAL: Virtual area found at 0x7f86cde00000 (size = 0x4400000)
EAL: Ask a virtual area of 0x400000 bytes
EAL: Virtual area found at 0x7f86cd800000 (size = 0x400000)
EAL: Ask a virtual area of 0x400000 bytes
EAL: Virtual area found at 0x7f86cd200000 (size = 0x400000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f86cce00000 (size = 0x200000)
EAL: Ask a virtual area of 0xc00000 bytes
EAL: Virtual area found at 0x7f86cc000000 (size = 0xc00000)
EAL: Ask a virtual area of 0x1c00000 bytes
EAL: Virtual area found at 0x7f86ca200000 (size = 0x1c00000)
EAL: Ask a virtual area of 0x600000 bytes
EAL: Virtual area found at 0x7f86c9a00000 (size = 0x600000)
EAL: Ask a virtual area of 0x400000 bytes
EAL: Virtual area found at 0x7f86c9400000 (size = 0x400000)
EAL: Requesting 64 pages of size 2MB from socket 0
...
VM has been killed by qemu with the following error
> qemu-system-x86_64: Guest moved used index from 570 to 0
Debugging
---------
With GDB, I have got this backtrace for Qemu
(gdb) bt full
#0 __GI_exit (status=1) at exit.c:104
No locals.
#1 0x00007f13cb53412e in virtqueue_num_heads (vq=0x7f13ce28d4c0, idx=592)
at /tmp/qemu/
num_heads = 64944
#2 0x00007f13cb53444e in virtqueue_
out_
idx = 592
total_bufs = 0
in_total = 0
out_total = 0
#3 0x00007f13cb5344b6 in virtqueue_
at /tmp/qemu/
in_total = 1543725744
out_total = 32767
#4 0x00007f13cb51ad6b in virtio_
at /tmp/qemu/
n = 0x7f13cda08f18
#5 0x00007f13cb51b37d in virtio_net_receive (nc=0x7f13cdf96490,
buf=
at /tmp/qemu/
n = 0x7f13cda08f18
q = 0x7f13ce22cea0
vdev = 0x7f13cda08f18
__func__ = "virtio_
mhdr_sg = {{iov_base = 0x7f1365fda43e, iov_len = 2}, {iov_base = 0x0, iov_len = 0} <repeats 1023 times>}
mhdr = {hdr = {flags = 0 '\000', gso_type = 0 '\000', hdr_len = 0, gso_size = 0, csum_start = 0,
mhdr_cnt = 0
offset = 98
i = 1
#6 0x00007f13cb75da86 in nc_sendv_compat (nc=0x7f13cdf96490, iov=0x7fff5c057440, iovcnt=1, flags=0) at net/net.c:717
buf = '\000' <repeats 416 times>...
buffer = 0x7fff5c057580 "\336\355\
offset = 98
#7 0x00007f13cb75db3e in qemu_deliver_
opaque=
nc = 0x7f13cdf96490
ret = 0
#8 0x00007f13cb75fa5f in qemu_net_
data=
ret = -1
iov = {iov_base = 0x7fff5c057580, iov_len = 98}
#9 0x00007f13cb75fb7b in qemu_net_queue_send (queue=
data=
ret = 139722994604174
#10 0x00007f13cb75d8d9 in qemu_send_
buf=
queue = 0x7f13cdf966b0
ret = 0
#11 0x00007f13cb75d911 in qemu_send_
buf=
No locals.
#12 0x00007f13cb75d93e in qemu_send_packet (nc=0x7f13cc902eb0,
buf=
No locals.
#13 0x00007f13cb76b49e in vde_to_qemu (opaque=
s = 0x7f13cc902eb0
buf = "[...]"
size = 98
[...]
According to GDB, there is no available vring
(gdb) up
#1 0x00007f13cb53412e in virtqueue_num_heads (vq=0x7f13ce28d4c0, idx=592)
at /tmp/qemu/
320 exit(1);
(gdb) p num_heads
$1 = 64944
(gdb) p vq->vring.num
$2 = 256
(gdb) p idx
$3 = 592
(gdb) p vring_avail_idx(vq)
$5 = 0
VMs network topology