[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL V2 6/7] e1000: Fixing interrupts pace.
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL V2 6/7] e1000: Fixing interrupts pace. |
Date: |
Wed, 30 Mar 2016 09:22:54 +0800 |
From: Sameeh Jubran <address@hidden>
This patch introduces an upper bound for number of interrupts
per second. Without this bound an interrupt storm can occur as
it has been observed on Windows 10 when disabling the device.
According to the SPEC - Intel PCI/PCI-X Family of Gigabit
Ethernet Controllers Software Developer's Manual, section
13.4.18 - the Ethernet controller guarantees a maximum
observable interrupt rate of 7813 interrupts/sec. If there is
no upper bound this could lead to an interrupt storm by e1000
(when mit_delay < 500) causing interrupts to fire at a very high
pace.
Thus if mit_delay < 500 then the delay should be set to the
minimum delay possible which is 500. This can be calculated
easily as follows:
Interval = 10^9 / (7813 * 256) = 500.
Signed-off-by: Sameeh Jubran <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
hw/net/e1000.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 0387fa0..09b9ab5 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -357,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) +
--
2.5.0
- [Qemu-devel] [PULL V2 0/7] Net patches, Jason Wang, 2016/03/29
- [Qemu-devel] [PULL V2 1/7] net/filter-mirror:Add filter-mirror, Jason Wang, 2016/03/29
- [Qemu-devel] [PULL V2 2/7] tests/test-filter-mirror:add filter-mirror unit test, Jason Wang, 2016/03/29
- [Qemu-devel] [PULL V2 3/7] net/filter-mirror: Change filter_mirror_send interface, Jason Wang, 2016/03/29
- [Qemu-devel] [PULL V2 6/7] e1000: Fixing interrupts pace.,
Jason Wang <=
- [Qemu-devel] [PULL V2 4/7] net/filter-mirror: implement filter-redirector, Jason Wang, 2016/03/29
- [Qemu-devel] [PULL V2 5/7] tests/test-filter-redirector: Add unit test for filter-redirector, Jason Wang, 2016/03/29
- [Qemu-devel] [PULL V2 7/7] Revert "e1000: fix hang of win2k12 shutdown with flood ping", Jason Wang, 2016/03/29
- Re: [Qemu-devel] [PULL V2 0/7] Net patches, Peter Maydell, 2016/03/30