summaryrefslogtreecommitdiff
path: root/hw/net/e1000.c
diff options
context:
space:
mode:
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;