Hide Forgot
Description of problem: ping lost packages when assign a pf to guest Version-Release number of selected component (if applicable): # uname -r 2.6.32-202.el6.x86_64 #rpm -qa|grep qemu qemu-kvm-0.12.1.2-2.192.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.unbind a nic form host,such as: # lspci |grep Ether 00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 05) 03:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 03:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 04:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 04:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) # lspci -n|grep 04:00.1 04:00.1 0200: 8086:1526 (rev 01) # echo "8086 1526" > /sys/bus/pci/drivers/pci-stub/new_id # echo 0000:04:00.1 > /sys/bus/pci/devices/0000\:04\:00.1/driver/unbind # echo 0000:04:00.1 > /sys/bus/pci/drivers/pci-stub/bind 2.boot a guset with two NIC cards,one of them is assigned nic,such as: /usr/libexec/qemu-kvm -M rhel6.2.0 -enable-kvm -name RHEL-Server-6.2-64 -smp 2 -m 2G -uuid `uuidgen` -boot menu=on -drive file=/home/qcow2/RHEL-Server-6.2-64.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,aio=native,media=disk,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-blk-pci0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=net0,mac=44:37:E6:5E:A3:F2,bus=pci.0,addr=0x4,id=net0 -drive if=none,media=cdrom,readonly=on,format=raw,id=drive-ide1-0-0 -device ide-drive,drive=drive-ide1-0-0,id=ide1-0-0 -vnc :1 -balloon none -monitor stdio -usb -usbdevice tablet -device pci-assign,host=04:00.1,id=h2guest_nic_1 3.if the assigned nic in guest is eth0 ,execute "ifup eth0;ping -I eth0 www.google.com" Actual results: packages lost. with an attachment screenshot. Expected results: no package lost. Additional info: with "-device e1000" or "-device rtl8139" in qemu-kvm command line also have this issue. with "-net none" in qemu-kvm command line ,pf work well in guest.
Created attachment 525305 [details] ping screenshot
> Additional info: > with "-device e1000" or "-device rtl8139" in qemu-kvm command line also have > this issue. > > with "-net none" in qemu-kvm command line ,pf work well in guest. we just hit package loss when we first ping.second ping,... works well.
Can you issue a single packet ping (ping -c 1) and provide the netdumps and arp tables?
Is the guest configured to use dhcp or static ip address? Is there a time factor? For instance do you get the same result from: # ifup eth0; ping -I eth0 www.google.com as from # ifup eth0; sleep 30; ping -I eth0 www.google.com If you ifdown and re-do the test, do you again experience some packets lost or is it once per boot? I could imagine emulated devices could drop packets if the bridge forwarding delay is set wrong. In those cases, what bridge is being used and how is it configured? I agree with Dor that it would be useful to see tcpdumps.
At Alex's suggestion,I re-do the test,add "sleep 30" and then no package lost.