* [Qemu-devel] [PATCH] qemu:e1000: Fix RX descriptor low threshold interrupt logic
@ 2009-03-11 22:56 Alex Williamson
0 siblings, 0 replies; only message in thread
From: Alex Williamson @ 2009-03-11 22:56 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.williamson
The RXDMT0 interrupt is supposed to fire when the number of free
RX descriptors drops to some fraction of the total descriptors.
However in practice, it seems like we're adding this interrupt
cause on every RX. Fix the logic to treat (tail - head) as the
number of free entries rather than the number of used entries.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---
hw/e1000.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/e1000.c b/hw/e1000.c
index e6155d6..1644201 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -666,8 +666,8 @@ e1000_receive(void *opaque, const uint8_t *buf, int size)
n = E1000_ICS_RXT0;
if ((rdt = s->mac_reg[RDT]) < s->mac_reg[RDH])
rdt += s->mac_reg[RDLEN] / sizeof(desc);
- if (((rdt - s->mac_reg[RDH]) * sizeof(desc)) << s->rxbuf_min_shift >=
- s->mac_reg[RDLEN])
+ if (((rdt - s->mac_reg[RDH]) * sizeof(desc)) <= s->mac_reg[RDLEN] >>
+ s->rxbuf_min_shift)
n |= E1000_ICS_RXDMT0;
set_ics(s, 0, n);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-11 22:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 22:56 [Qemu-devel] [PATCH] qemu:e1000: Fix RX descriptor low threshold interrupt logic Alex Williamson
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).