diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-07-20 10:00:08 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-07-20 10:00:08 +0100 |
commit | 9d5d247e32ae706b1f2dbcb841d987c539348ded (patch) | |
tree | 32abe3c66233025b942f480386d777126e805001 /hw | |
parent | 0b46a3f005458311d6fa479c1f5f8fe3da562d61 (diff) | |
parent | 323e7c117754e4d4ce6b4282d74ad01c99d67714 (diff) | |
download | qemu-9d5d247e32ae706b1f2dbcb841d987c539348ded.zip qemu-9d5d247e32ae706b1f2dbcb841d987c539348ded.tar.gz qemu-9d5d247e32ae706b1f2dbcb841d987c539348ded.tar.bz2 |
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
# gpg: Signature made Fri 20 Jul 2018 01:40:43 BST
# gpg: using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211
* remotes/jasowang/tags/net-pull-request:
tap: fix memory leak on success to create a tap device
e1000e: Prevent MSI/MSI-X storms
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/net/e1000e_core.c | 11 | ||||
-rw-r--r-- | hw/net/e1000e_core.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index 9504891..2a221c2 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -2023,6 +2023,7 @@ e1000e_msix_notify_one(E1000ECore *core, uint32_t cause, uint32_t int_cfg) effective_eiac = core->mac[EIAC] & cause; core->mac[ICR] &= ~effective_eiac; + core->msi_causes_pending &= ~effective_eiac; if (!(core->mac[CTRL_EXT] & E1000_CTRL_EXT_IAME)) { core->mac[IMS] &= ~effective_eiac; @@ -2119,6 +2120,13 @@ e1000e_send_msi(E1000ECore *core, bool msix) { uint32_t causes = core->mac[ICR] & core->mac[IMS] & ~E1000_ICR_ASSERTED; + core->msi_causes_pending &= causes; + causes ^= core->msi_causes_pending; + if (causes == 0) { + return; + } + core->msi_causes_pending |= causes; + if (msix) { e1000e_msix_notify(core, causes); } else { @@ -2156,6 +2164,9 @@ e1000e_update_interrupt_state(E1000ECore *core) core->mac[ICS] = core->mac[ICR]; interrupts_pending = (core->mac[IMS] & core->mac[ICR]) ? true : false; + if (!interrupts_pending) { + core->msi_causes_pending = 0; + } trace_e1000e_irq_pending_interrupts(core->mac[ICR] & core->mac[IMS], core->mac[ICR], core->mac[IMS]); diff --git a/hw/net/e1000e_core.h b/hw/net/e1000e_core.h index 7d8ff41..63a1551 100644 --- a/hw/net/e1000e_core.h +++ b/hw/net/e1000e_core.h @@ -109,6 +109,8 @@ struct E1000Core { NICState *owner_nic; PCIDevice *owner; void (*owner_start_recv)(PCIDevice *d); + + uint32_t msi_causes_pending; }; void |