Bug 1273300 - guest network can not resume when with vhost=off and sndbuf=100 during pktgen test from guest to host
guest network can not resume when with vhost=off and sndbuf=100 during pktge...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.2
All Linux
medium Severity medium
: rc
: ---
Assigned To: jason wang
xiywang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-20 03:39 EDT by weliao
Modified: 2017-12-25 21:36 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-25 03:39:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
script (1014 bytes, application/x-shellscript)
2015-10-20 03:40 EDT, weliao
no flags Details

  None (edit)
Description weliao 2015-10-20 03:39:02 EDT
Description of problem:
RHEL guest with vhost=off and sudbuf=100, if during pktgen stress from guest to host, guest network can not resume

Version-Release number of selected component (if applicable):
3.10.0-324.el7.x86_64
qemu-kvm-rhev-2.3.0-30.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.1.Boot guest with sndbuf=100 and vhost=off
/usr/libexec/qemu-kvm -name guest1 \
-S -machine pc \
-cpu SandyBridge \
-m 4G \
-realtime mlock=off \
-sandbox off \
-smp 6 \
-uuid fbf54917-5833-48f2-b3fb-5ce2ad294d93 \
-no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/rhel7cp1.0.monitor,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc,driftfix=slew \
-global kvm-pit.lost_tick_policy=discard \
-no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 \
-global PIIX4_PM.disable_s4=1 \
-boot menu=on \
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x6.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x6 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x6.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x6.0x2 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 \
-drive file=iscsi://10.66.9.230:3260/iqn.2003-01.org.linux-iscsi.dhcp-65-87.x8664:sn.36f0c8edc63d/0,snapshot=on,cache=none,if=none,id=drive-virtio-disk0,format=raw \
-iscsi initiator-name=iqn.1994-05.com.redhat:172f21663af5 \
-device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi1 \
-device scsi-hd,drive=drive-virtio-disk0,bus=scsi1.0,id=hd1 \
-netdev tap,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,id=hostnet0,vhost=off,sndbuf=100 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:0b:06:82,bus=pci.0,addr=0x3 \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/rhel7cp1.0.org.qemu.guest_agent.0,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-chardev spicevmc,id=charchannel1,name=vdagent \
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 \
-device usb-tablet,id=input0 -spice port=5900,disable-ticketing,seamless-migration=on \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
-chardev spicevmc,id=charredir0,name=usbredir \
-device usb-redir,chardev=charredir0,id=redir0 \
-chardev spicevmc,id=charredir1,name=usbredir \
-device usb-redir,chardev=charredir1,id=redir1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 \
-msg timestamp=on \
-monitor stdio \
-qmp tcp:0:4444,server,nowait

2.In guest, modify the pktgen script, set the dst address as host's and start pktgen test to host
# cat pktgen.sh
...
pgset "dst $host_ip"
pgset "dst_mac $host-macaddress"
...
#./pktgen.sh eth0

Actual results:
guest network can not access. stop pktgen.sh script, guest network always can not access.

Expected results:
guest network works well. 

Additional info:
1, Test no with sndbuf=100, no this issue.

2, Test with vhost=on, no this issue.

3, Test with qemu-kvm-1.5.3-105.el7.x86_64, no this issue.

4. Test with qemu-kvm-rhev-2.3.0-2.el7.x86_64, hit this issue, too.


Based on above testing, in one word, this issue related with vhost=off and sndbuf=100, this issue exists on qemu-kvm-rhev-2.3.0-2.el7.x86_64, too. So it is not a regression bz.
Comment 1 weliao 2015-10-20 03:40 EDT
Created attachment 1084640 [details]
script
Comment 4 Karen Noel 2015-10-20 06:32:40 EDT
> Based on above testing, in one word, this issue related with vhost=off and sndbuf=100, this issue exists on qemu-kvm-rhev-2.3.0-2.el7.x86_64, too. So it is not a regression bz.

Is this bug a regression from RHEL 7.1 with qemu-kvm-rhev?

Does this bug happen with RHEL 7.2 qemu-kvm?

Thanks.
Comment 5 weliao 2015-10-26 05:33:57 EDT
(In reply to Karen Noel from comment #4)
> > Based on above testing, in one word, this issue related with vhost=off and sndbuf=100, this issue exists on qemu-kvm-rhev-2.3.0-2.el7.x86_64, too. So it is not a regression bz.
> 
> Is this bug a regression from RHEL 7.1 with qemu-kvm-rhev?
> 
> Does this bug happen with RHEL 7.2 qemu-kvm?
> 
> Thanks.
test on RHEL7.1
3.10.0-229.el7.x86_64
qemu-kvm-rhev-2.1.2-23.el7_1.10.x86_64 no this issue
qemu-kvm-1.5.3-86.el7_1.8.x86_64 no this issue

test on RHEL7.2 qemu-kvm-1.5.3-105.el7.x86_64, no this issue.
Comment 6 jason wang 2015-12-02 00:08:41 EST
Can this be reproduced on recent 7.2? Please try both qemu-kvm and qemu-kvm-rhev.

Thanks
Comment 7 weliao 2015-12-02 02:04:17 EST
hi, jison
I retest on http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL-7.2-20151030.0/compose/Server/x86_64/os/

host:
kernel:
3.10.0-330.el7.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.3.x86_64

guest:
kernel:
3.10.0-329.el7.x86_64

has this issue.

qemu-kvm-1.5.3-105.el7_2.1.x86_64 no this issue.
Comment 9 jason wang 2016-07-04 02:21:01 EDT
Hi:

Can you test and bisect this on upstream qemu?

Thanks
Comment 10 weliao 2016-07-11 23:33:54 EDT
Hi Jason,
[root@dhcp-8-244 qemu]# git bisect bad
33cd52b5d7b9adfd009e95f07e6c64dd88ae2a31 is the first bad commit
commit 33cd52b5d7b9adfd009e95f07e6c64dd88ae2a31
Author: Alexander Graf <agraf@suse.de>
Date:   Tue Jul 1 16:14:41 2014 +0200

    sysbus: Make devices spawnable via -device
    
    Now that we can properly map sysbus devices that haven't been connected to
    something forcefully by C code, we can allow the -device command line option
    to spawn them.
    
    For machines that don't implement dynamic sysbus assignment in their board
    files we add a new bool "has_dynamic_sysbus" to the machine class.
    When that property is false (default), we bail out when we see dynamically
    spawned sysbus devices, like we did before.
    
    Signed-off-by: Alexander Graf <agraf@suse.de>

:040000 040000 2d5e815332a86dea5055eab840ce764791932afa 5baf78772391a2951fc7165fdf914c1bdfb71801 M	hw
:040000 040000 8c504f04461f4afa618df733111e58b3ef5e7c79 d314fa9b5a25b3ead7bb068a514226ddf58aa203 M	include
:100644 100644 8999f364dd1a0a5615801d5fc51b14d7206c81fb f4a6e5e05bce248d72176eb92979c4e10ebdfd07 M	vl.c
Comment 12 jason wang 2016-08-01 23:07:36 EDT
(In reply to weliao from comment #10)
> Hi Jason,
> [root@dhcp-8-244 qemu]# git bisect bad
> 33cd52b5d7b9adfd009e95f07e6c64dd88ae2a31 is the first bad commit
> commit 33cd52b5d7b9adfd009e95f07e6c64dd88ae2a31
> Author: Alexander Graf <agraf@suse.de>
> Date:   Tue Jul 1 16:14:41 2014 +0200
> 
>     sysbus: Make devices spawnable via -device
>     
>     Now that we can properly map sysbus devices that haven't been connected
> to
>     something forcefully by C code, we can allow the -device command line
> option
>     to spawn them.
>     
>     For machines that don't implement dynamic sysbus assignment in their
> board
>     files we add a new bool "has_dynamic_sysbus" to the machine class.
>     When that property is false (default), we bail out when we see
> dynamically
>     spawned sysbus devices, like we did before.
>     
>     Signed-off-by: Alexander Graf <agraf@suse.de>
> 
> :040000 040000 2d5e815332a86dea5055eab840ce764791932afa
> 5baf78772391a2951fc7165fdf914c1bdfb71801 M	hw
> :040000 040000 8c504f04461f4afa618df733111e58b3ef5e7c79
> d314fa9b5a25b3ead7bb068a514226ddf58aa203 M	include
> :100644 100644 8999f364dd1a0a5615801d5fc51b14d7206c81fb
> f4a6e5e05bce248d72176eb92979c4e10ebdfd07 M	vl.c

Can hardly believe this is the one we want, it does not modify anything relate to the bz itself. Is the issue existed in 7.2?
Comment 13 weliao 2016-08-08 02:52:33 EDT
yes, The issue existed in 7.2.
Comment 14 jason wang 2016-09-02 03:58:12 EDT
I could not reproduce this issue, could you please try simple command line? E.g

$qemu_path $img_path \
           -netdev tap,id=hn0,queues=$queues,vhost=off,sndbuf=100 \
           -device virtio-net-pci,netdev=hn0,id=v0 \
           -m 6G -enable-kvm -cpu host $@ -vnc :11 \
           -smp 2 -monitor stdio
Comment 15 weliao 2016-09-02 05:49:07 EDT
Hi Jason,
   used your command line no this issue, I think because set smp=2, if used "-smp 5" also had this issue. "-smp 4" no this issue.
   my host cpuinfo:
# cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 1600.125
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 3350.726
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 1
cpu cores	: 4
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 1599.992
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 2
cpu cores	: 4
apicid		: 4
initial apicid	: 4
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 1600.125
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 3
cpu cores	: 4
apicid		: 6
initial apicid	: 6
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 4
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 3129.593
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 5
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 3711.179
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 1
cpu cores	: 4
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 6
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 2388.632
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 2
cpu cores	: 4
apicid		: 5
initial apicid	: 5
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 7
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping	: 9
microcode	: 0x1c
cpu MHz		: 2593.031
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 3
cpu cores	: 4
apicid		: 7
initial apicid	: 7
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bogomips	: 6784.31
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:
Comment 16 jason wang 2016-09-06 06:26:23 EDT
Could not reproduce with smp=1,3,5,7 :(. If possible, could you pls share your environments with me for debugging?

Thanks
Comment 18 Zhengtong 2017-05-18 01:57:26 EDT
Hit the same issue on ppc74le platform.
Comment 19 Zhengtong 2017-05-18 01:58:06 EDT
sorry , ppc64le...
Comment 20 xiywang 2017-06-05 05:44:17 EDT
reproduced on ovs backend but could not reproduce on macvtap backend.
Comment 21 jason wang 2017-06-07 01:42:33 EDT
(In reply to xiywang from comment #20)
> reproduced on ovs backend but could not reproduce on macvtap backend.

Could not reproduce on my side still. Could you please share your:

1) qemu cli
2) pktgen scrip
3) host&guest kernel version

And please try the simple cli in comment #14.

Thanks
Comment 22 jason wang 2017-06-08 23:48:11 EDT
Corner case, move to 7.5.
Comment 23 xiywang 2017-06-12 03:10:54 EDT
Could not reproduce on ovs backend either now.

host&guest: 3.10.0-679.el7.x86_64
qemu-kvm-rhev-2.9.0-8.el7.x86_64

1. boot a guest
/usr/libexec/qemu-kvm -name rhel7.4 -cpu IvyBridge -m 4096 -realtime mlock=off -smp 5 \
-drive file=/home/nfs_root/rhel7.4.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,snapshot=off -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 \
-netdev tap,id=hostnet0,vhost=off,sndbuf=100,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,queues=4 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a1:d0:5f,vectors=10,mq=on,host_mtu=65520 \
-monitor stdio -device qxl-vga,id=video0 -serial unix:/tmp/console,server,nowait -vnc :1 -spice port=5900,disable-ticketing

2. in guest
# sh pktgen.sh eth0 "10.73.72.146" "3c:a8:2a:1f:ae:f0"
Adding queue 0 of eth0
Result: OK: rem_device_all
Result: OK: add_device=eth0@0
Result: OK: Note! max_before_softirq is obsoleted -- Do not use
Configuring devices eth0@0
Result: OK: queue_map_min=0
Result: OK: queue_map_max=0
Result: OK: count=10000000
Result: OK: min_pkt_size=60
Result: OK: max_pkt_size=60
Result: OK: dst_min=10.73.72.146
Result: OK: dstmac 3c:a8:2a:1f:ae:f0
Result: OK: udp_src_min=0
Result: OK: udp_src_max=65535
Result: OK: udp_dst_min=0
Result: OK: udp_dst_max=65535
Running ...ctrl^C to stop

^C

3. after 15s, stop guest in hmp
(qemu) stop

4. after 30s, continue guest in hmp
(qemu) c

5. in guest
Ctrl+c to stop pktgen.sh
network in guest works fine.


Additional info:
# cat pktgen.sh 
#!/bin/sh
# usage sh pktgen.sh $device $host_ip $host_mac_address $queues

modprobe -r pktgen
modprobe pktgen
echo reset > /proc/net/pktgen/pgctrl

ifconfig $1 up

function pgset(){
	local result

	echo $1 > $PGDEV
	result=`cat $PGDEV | fgrep "Result: OK"`
	if [ "$reset" = "" ]; then
		cat $PGDEV | fgrep Result:
	fi
}

function pg(){
	echo inject > $PGDEV
	cat $PGDEV
}

for i in 0 `seq $(($4-1))`
do
	echo "Adding queue 0 of $1"
	dev=$1@$i
	PGDEV=/proc/net/pktgen/kpktgend_$i
	pgset "rem_device_all"
	pgset "add_device $dev"
	pgset "max_before_softirq 100000"

	#Configure the individual devices
	echo "Configuring devices $dev"
	PGDEV=/proc/net/pktgen/$dev
	
	pgset "queue_map_min $i"
	pgset "queue_map_max $i"
	pgset "count 10000000"
	pgset "min_pkt_size 60"
	pgset "max_pkt_size 60"
	pgset "dst $2"
	pgset "dst_mac $3"
	pgset "udp_src_min 0"
	pgset "udp_src_max 65535"
	pgset "udp_dst_min 0"
	pgset "udp_dst_max 65535"
done

PGDEV=/proc/net/pktgen/pgctrl
echo "Running ...ctrl^C to stop"
pgset "start"
echo "Done"
Comment 24 tiama 2017-07-20 02:25:41 EDT
With bridge backend hit this issue too.

Versions:
host&guest: 3.10.0-693.el7.x86_64
qemu-kvm-rhev-2.9.0-16.el7.x86_64


Steps:
1. Boot VM with 
/usr/libexec/qemu-kvm \
-name 'RHEL7.4'  \
-drive id=drive_image1,if=none,snapshot=off,aio=native,cache=none,format=qcow2,file=/home/0706test/rhel74-64-virtio.qcow2 \
-device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=0x3 \
-device virtio-net-pci,netdev=dev1,mac=9a:e8:e9:ea:eb:ea,id=net1\
-netdev tap,id=dev1,vhost=off,sndbuf=100,script=/etc/ifup_script,downscript=/etc/ifdown_script\
-m 8192  \
-smp 4  \
-cpu 'Haswell-noTSX',+kvm_pv_unhalt \
-vnc :1 \
-monitor stdio


2. Do pktgen test using pktgen.sh.


3. Do ping from host to guest.  After 3 seconds, the network in guest is broken and can not recover. 



Note: 
1. pktgen.sh is same with Comment 23.
2. This issue occurs before doing stop/cont guest.
Comment 25 Zhengtong 2017-07-21 00:52:39 EDT
Hit the issue on Power9 with RHEL-ALT-7.4.

Note You need to log in before you can comment on or make changes to this bug.