qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: peter.maydell@linaro.org, qemu-devel@nongnu.org
Cc: "Denis V. Lunev" <den@openvz.org>,
	Jason Wang <jasowang@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Vincenzo Maffione <v.maffione@gmail.com>
Subject: [Qemu-devel] [PULL for 2.5 1/9] e1000: fix hang of win2k12 shutdown with flood ping
Date: Mon,  7 Dec 2015 11:26:05 +0800	[thread overview]
Message-ID: <1449458773-7141-2-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1449458773-7141-1-git-send-email-jasowang@redhat.com>

From: "Denis V. Lunev" <den@openvz.org>

e1000 driver in Win2k12 is really well rotten. It 100% hangs on shutdown
of UP VM under flood ping. The guest checks card state and reinjects
itself interrupt in a loop. This is fatal for UP machine.

There is no good way to fix this misbehavior but to kludge it. The
emulation has interrupt throttling register aka ITR which limits
interrupt rate and allows the guest to proceed this phase.
There is no problem with this kludge for Linux guests - it adjust the
value of it itself.

On the other hand according to the initial research in
    commit e9845f0985f088dd01790f4821026df0afba5795
    Author: Vincenzo Maffione <v.maffione@gmail.com>
    Date:   Fri Aug 2 18:30:52 2013 +0200

    e1000: add interrupt mitigation support

    ...

    Interrupt mitigation boosts performance when the guest suffers from
    an high interrupt rate (i.e. receiving short UDP packets at high packet
    rate). For some numerical results see the following link
    http://info.iet.unipi.it/~luigi/papers/20130520-rizzo-vm.pdf

this should also boost performance a bit.

See https://bugzilla.redhat.com/show_bug.cgi?id=874406 for additional
details.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Vincenzo Maffione <v.maffione@gmail.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/e1000.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index c877e06..bec06e9 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -447,6 +447,11 @@ static void e1000_reset(void *opaque)
         e1000_link_down(d);
     }
 
+    /* Throttle interrupts to prevent guest (e.g Win 2012) from
+     * reinjecting interrupts endlessly. TODO: fix non ITR case.
+     */
+    d->mac_reg[ITR] = 250;
+
     /* Some guests expect pre-initialized RAH/RAL (AddrValid flag + MACaddr) */
     d->mac_reg[RA] = 0;
     d->mac_reg[RA + 1] = E1000_RAH_AV;
-- 
2.5.0

  reply	other threads:[~2015-12-07  3:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07  3:26 [Qemu-devel] [PULL for 2.5 0/9] Net patches Jason Wang
2015-12-07  3:26 ` Jason Wang [this message]
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 2/9] net: pcnet: add check to validate receive data size(CVE-2015-7504) Jason Wang
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 3/9] pcnet: fix rx buffer overflow(CVE-2015-7512) Jason Wang
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 4/9] vmxnet3: silence warning Jason Wang
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 5/9] net/vmxnet3.c: fix a build error when enabling debug output Jason Wang
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 6/9] lan9118: fix emulation of MAC address loaded bit in E2P_CMD register Jason Wang
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 7/9] lan9118: log and ignore access to invalid registers, rather than aborting Jason Wang
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 8/9] net/vmxnet3: fix debug macro pattern for vmxnet3 Jason Wang
2015-12-07  3:26 ` [Qemu-devel] [PULL for 2.5 9/9] net/vmxnet3: remove redundant VMW_SHPRN(...) definition Jason Wang
2015-12-07 11:10 ` [Qemu-devel] [PULL for 2.5 0/9] Net patches Peter Maydell
2015-12-07 11:11   ` Peter Maydell
2015-12-07 14:02     ` 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=1449458773-7141-2-git-send-email-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=den@openvz.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=v.maffione@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).