public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix e1000 can_receive handler
@ 2008-05-07 21:40 Anthony Liguori
  2008-05-08 13:26 ` Aurelien Jarno
  0 siblings, 1 reply; 7+ messages in thread
From: Anthony Liguori @ 2008-05-07 21:40 UTC (permalink / raw)
  To: kvm-devel; +Cc: Anthony Liguori, Avi Kivity

The current logic of the can_receive handler is to allow packets whenever the
receiver is disabled or when there are descriptors available in the ring.

I think the logic ought to be to allow packets whenever the receiver is enabled
and there are descriptors available in the ring.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/qemu/hw/e1000.c b/qemu/hw/e1000.c
index 0728539..01f8983 100644
--- a/qemu/hw/e1000.c
+++ b/qemu/hw/e1000.c
@@ -520,8 +520,8 @@ e1000_can_receive(void *opaque)
 {
     E1000State *s = opaque;
 
-    return (!(s->mac_reg[RCTL] & E1000_RCTL_EN) ||
-            s->mac_reg[RDH] != s->mac_reg[RDT]);
+    return ((s->mac_reg[RCTL] & E1000_RCTL_EN) &&
+	    s->mac_reg[RDH] != s->mac_reg[RDT]);
 }
 
 static void

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-09  7:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-07 21:40 [PATCH] Fix e1000 can_receive handler Anthony Liguori
2008-05-08 13:26 ` Aurelien Jarno
2008-05-08 14:03   ` Anthony Liguori
2008-05-08 17:02     ` Avi Kivity
2008-05-08 17:21       ` Avi Kivity
2008-05-08 18:41       ` Anthony Liguori
2008-05-09  7:47         ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox