From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkiZb-0006u2-SE for qemu-devel@nongnu.org; Fri, 20 Mar 2009 13:31:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkiZW-0006rE-51 for qemu-devel@nongnu.org; Fri, 20 Mar 2009 13:31:58 -0400 Received: from [199.232.76.173] (port=52903 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkiZV-0006r6-OJ for qemu-devel@nongnu.org; Fri, 20 Mar 2009 13:31:53 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:48635) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LkiZV-0004vJ-Al for qemu-devel@nongnu.org; Fri, 20 Mar 2009 13:31:53 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e31.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n2KHSxPu031706 for ; Fri, 20 Mar 2009 11:28:59 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n2KHVoh6200920 for ; Fri, 20 Mar 2009 11:31:50 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n2KHVouF024426 for ; Fri, 20 Mar 2009 11:31:50 -0600 Message-ID: <49C3D304.5070507@us.ibm.com> Date: Fri, 20 Mar 2009 12:31:48 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH][RESEND] qemu:e1000: Fix RX descriptor low threshold interrupt logic References: <20090319161936.24035.95774.stgit@kvm.aw> In-Reply-To: <20090319161936.24035.95774.stgit@kvm.aw> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Cc: alex.williamson@hp.com Alex Williamson wrote: > 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 > Applied to trunk and stable, thanks. Regards, Anthony Liguori > --- > > 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); > > > > >