qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [6864] e1000: Fix RX descriptor low threshold interrupt log


From: Anthony Liguori
Subject: [Qemu-devel] [6864] e1000: Fix RX descriptor low threshold interrupt logic ( Alex Williamson)
Date: Fri, 20 Mar 2009 16:13:47 +0000

Revision: 6864
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6864
Author:   aliguori
Date:     2009-03-20 16:13:47 +0000 (Fri, 20 Mar 2009)
Log Message:
-----------
e1000: Fix RX descriptor low threshold interrupt logic (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 <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

Modified Paths:
--------------
    trunk/hw/e1000.c

Modified: trunk/hw/e1000.c
===================================================================
--- trunk/hw/e1000.c    2009-03-20 16:13:41 UTC (rev 6863)
+++ trunk/hw/e1000.c    2009-03-20 16:13:47 UTC (rev 6864)
@@ -666,8 +666,8 @@
     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);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]