summaryrefslogtreecommitdiff
path: root/hw/net/e1000.c
diff options
context:
space:
mode:
authorYonghee Han <onstudy@samsung.com>2016-07-27 16:43:51 +0900
committerYonghee Han <onstudy@samsung.com>2016-07-27 01:00:25 -0700
commit186efde2677c31fb40d154a81a5f3731eab52414 (patch)
treeb43c1e7ee15fbdade66764b4b45f40dd3fad408e /hw/net/e1000.c
parenta03c4728275d119af5f66c4a69e8d9d5a1730031 (diff)
downloadqemu-186efde2677c31fb40d154a81a5f3731eab52414.tar.gz
qemu-186efde2677c31fb40d154a81a5f3731eab52414.tar.bz2
qemu-186efde2677c31fb40d154a81a5f3731eab52414.zip
Imported Upstream version 2.6.0upstream/2.6.0
Change-Id: I8e3ccf55257695533c385aa8706484c73a733251
Diffstat (limited to 'hw/net/e1000.c')
-rw-r--r--hw/net/e1000.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 34d082354..8e79b550e 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -25,6 +25,7 @@
*/
+#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/pci/pci.h"
#include "net/net.h"
@@ -356,6 +357,14 @@ set_interrupt_cause(E1000State *s, int index, uint32_t val)
}
mit_update_delay(&mit_delay, s->mac_reg[ITR]);
+ /*
+ * According to e1000 SPEC, the Ethernet controller guarantees
+ * a maximum observable interrupt rate of 7813 interrupts/sec.
+ * Thus if mit_delay < 500 then the delay should be set to the
+ * minimum delay possible which is 500.
+ */
+ mit_delay = (mit_delay < 500) ? 500 : mit_delay;
+
if (mit_delay) {
s->mit_timer_on = 1;
timer_mod(s->mit_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
@@ -447,11 +456,6 @@ 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;