From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkhM0-00051F-Mv for qemu-devel@nongnu.org; Fri, 20 Mar 2009 12:13:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkhLz-00050U-6r for qemu-devel@nongnu.org; Fri, 20 Mar 2009 12:13:51 -0400 Received: from [199.232.76.173] (port=56738 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkhLy-00050N-VP for qemu-devel@nongnu.org; Fri, 20 Mar 2009 12:13:51 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43609 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LkhLy-0001P9-6i for qemu-devel@nongnu.org; Fri, 20 Mar 2009 12:13:50 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LkhLv-0007BW-QQ for qemu-devel@nongnu.org; Fri, 20 Mar 2009 16:13:47 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LkhLv-0007BS-Ft for qemu-devel@nongnu.org; Fri, 20 Mar 2009 16:13:47 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 20 Mar 2009 16:13:47 +0000 Subject: [Qemu-devel] [6864] e1000: Fix RX descriptor low threshold interrupt logic ( Alex Williamson) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Anthony Liguori 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);