All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang Haoyu" <zhanghy@sangfor.com>
To: "Jason Wang" <jasowang@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>, kvm <kvm@vger.kernel.org>
Subject: Re: [question] e1000 interrupt storm happened becauseof its correspondingioapic->irr bit always set
Date: Mon, 25 Aug 2014 16:27:16 +0800	[thread overview]
Message-ID: <201408251627141961019@sangfor.com> (raw)
In-Reply-To: 53FAE5EB.8080809@redhat.com

>>>> Hi, all
>>>>
>>>> I use a qemu-1.4.1/qemu-2.0.0 to run win7 guest, and encounter e1000 NIC interrupt storm, 
>>>> because "if (!ent->fields.mask && (ioapic->irr & (1 << i)))" is always true in __kvm_ioapic_update_eoi().
>>>>
>>>> Any ideas?
>>> We meet this several times: search the autoneg patches for an example of
>>> workaround for this in qemu, and patch kvm: ioapic: conditionally delay
>>> irq delivery during eoi broadcast for an workaround in kvm (rejected).
>>>
>> Thanks, Jason,
>> I searched "e1000 autoneg" in gmane.comp.emulators.qemu, and found below patches, 
>> http://thread.gmane.org/gmane.comp.emulators.qemu/143001/focus=143007
>
>This series is the first try to fix the guest hang during guest
>hibernation or driver enable/disable.
>> http://thread.gmane.org/gmane.comp.emulators.qemu/284105/focus=284765
>> http://thread.gmane.org/gmane.comp.emulators.qemu/186159/focus=187351
>
>Those are follow-up that tries to fix the bugs introduced by the autoneg
>hack.
>> which one tries to fix this problem, or all of them?
>
>As you can see, those kinds of hacking may not as good as we expect
>since we don't know exactly how e1000 works. Only the register function
>description from Intel's manual may not be sufficient. And you can
>search e1000 in the archives and you can find some behaviour of e1000
>registers were not fictionalized like what spec said. It was really
>suggested to use virtio-net instead of e1000 in guest. 

We support both, virtio-net is the recommended option, 
with regard to some guest (e.g., windows server 2000), virtio-net is not supported, e1000 is the last option.
 
>>
>>> That was probably caused by something wrong in e1000 emulation which
>>> causes interrupt to be injected into windows guest before its interrupt
>>> handler is registered. And Windows guest does not have a mechanism to
>>> detect and disable irq in such condition.
>>>
>> Sorry, I don't understand,
>> I think one interrupt should not been enabled before its handler is successfully registered, 
>> is it possible that e1000 emulation inject the interrupt before the interrupt is succesfully enabled?
>>
>> Thanks,
>> Zhang Haoyu
>>  
>>> e1000 emulation is far from stable and complete (e.g run e1000 ethtool
>>> selftest in linux guest may see lots of errors). It's complicate and
>>> subtle (even has undocumented registers and behaviour). You should
>>> better consider to use virtio which are more stable and fast in a kvm
>>> guest (unless some intel guys are involved to improve e1000 emulation).
>>>
>>> Thanks
>>>> Thanks,
>>>> Zhang Haoyu


WARNING: multiple messages have this Message-ID (diff)
From: "Zhang Haoyu" <zhanghy@sangfor.com>
To: "Jason Wang" <jasowang@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>, kvm <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [question] e1000 interrupt storm happened becauseof its correspondingioapic->irr bit always set
Date: Mon, 25 Aug 2014 16:27:16 +0800	[thread overview]
Message-ID: <201408251627141961019@sangfor.com> (raw)
In-Reply-To: 53FAE5EB.8080809@redhat.com

>>>> Hi, all
>>>>
>>>> I use a qemu-1.4.1/qemu-2.0.0 to run win7 guest, and encounter e1000 NIC interrupt storm, 
>>>> because "if (!ent->fields.mask && (ioapic->irr & (1 << i)))" is always true in __kvm_ioapic_update_eoi().
>>>>
>>>> Any ideas?
>>> We meet this several times: search the autoneg patches for an example of
>>> workaround for this in qemu, and patch kvm: ioapic: conditionally delay
>>> irq delivery during eoi broadcast for an workaround in kvm (rejected).
>>>
>> Thanks, Jason,
>> I searched "e1000 autoneg" in gmane.comp.emulators.qemu, and found below patches, 
>> http://thread.gmane.org/gmane.comp.emulators.qemu/143001/focus=143007
>
>This series is the first try to fix the guest hang during guest
>hibernation or driver enable/disable.
>> http://thread.gmane.org/gmane.comp.emulators.qemu/284105/focus=284765
>> http://thread.gmane.org/gmane.comp.emulators.qemu/186159/focus=187351
>
>Those are follow-up that tries to fix the bugs introduced by the autoneg
>hack.
>> which one tries to fix this problem, or all of them?
>
>As you can see, those kinds of hacking may not as good as we expect
>since we don't know exactly how e1000 works. Only the register function
>description from Intel's manual may not be sufficient. And you can
>search e1000 in the archives and you can find some behaviour of e1000
>registers were not fictionalized like what spec said. It was really
>suggested to use virtio-net instead of e1000 in guest. 

We support both, virtio-net is the recommended option, 
with regard to some guest (e.g., windows server 2000), virtio-net is not supported, e1000 is the last option.
 
>>
>>> That was probably caused by something wrong in e1000 emulation which
>>> causes interrupt to be injected into windows guest before its interrupt
>>> handler is registered. And Windows guest does not have a mechanism to
>>> detect and disable irq in such condition.
>>>
>> Sorry, I don't understand,
>> I think one interrupt should not been enabled before its handler is successfully registered, 
>> is it possible that e1000 emulation inject the interrupt before the interrupt is succesfully enabled?
>>
>> Thanks,
>> Zhang Haoyu
>>  
>>> e1000 emulation is far from stable and complete (e.g run e1000 ethtool
>>> selftest in linux guest may see lots of errors). It's complicate and
>>> subtle (even has undocumented registers and behaviour). You should
>>> better consider to use virtio which are more stable and fast in a kvm
>>> guest (unless some intel guys are involved to improve e1000 emulation).
>>>
>>> Thanks
>>>> Thanks,
>>>> Zhang Haoyu

  reply	other threads:[~2014-08-25  8:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-23 10:36 [question] e1000 interrupt storm happened because of its corresponding ioapic->irr bit always set Zhang Haoyu
2014-08-23 10:36 ` [Qemu-devel] " Zhang Haoyu
2014-08-25  3:07 ` Jason Wang
2014-08-25  7:17   ` [question] e1000 interrupt storm happened becauseof " Zhang Haoyu
2014-08-25  7:17     ` [Qemu-devel] " Zhang Haoyu
2014-08-25  7:29     ` Jason Wang
2014-08-25  7:29       ` [Qemu-devel] " Jason Wang
2014-08-25  8:27       ` Zhang Haoyu [this message]
2014-08-25  8:27         ` [Qemu-devel] [question] e1000 interrupt storm happened becauseof its correspondingioapic->irr " Zhang Haoyu
2014-08-26  9:28       ` Zhang Haoyu
2014-08-26  9:28         ` [Qemu-devel] " Zhang Haoyu
2014-08-27  5:09         ` Jason Wang
2014-08-27  5:09           ` [Qemu-devel] " Jason Wang
2014-08-27  9:31           ` [Qemu-devel] [question] e1000 interrupt storm happened becauseofits " Zhang Haoyu
2014-08-28  7:12             ` Jason Wang
2014-08-28 12:55             ` [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofits " Zhang Haoyu
2014-08-29  2:50               ` Jason Wang
2014-08-29  3:14               ` [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofitscorrespondingioapic->irr " Zhang Haoyu
2014-08-29  4:07                 ` Zhang, Yang Z
2014-08-29  4:07                   ` [Qemu-devel] " Zhang, Yang Z
2014-08-29  4:28                   ` Jason Wang
2014-09-02 15:44               ` [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofits correspondingioapic->irr " Michael S. Tsirkin
2014-09-04  1:56                 ` [Qemu-devel] [question] e1000 interrupt stormhappenedbecauseofits " Zhang Haoyu
2014-09-04  4:57                   ` Jason Wang
2014-08-25  7:32     ` [question] e1000 interrupt storm happened becauseof its corresponding ioapic->irr " Jason Wang
2014-08-25  7:32       ` [Qemu-devel] " Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201408251627141961019@sangfor.com \
    --to=zhanghy@sangfor.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.