qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] only check RCTL_EN in e1000_can_receive()
@ 2008-08-05 20:35 Charles Duffy
  2008-08-06 14:13 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Charles Duffy @ 2008-08-05 20:35 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

e1000_receive() has code to raise a receive overflow interrupt when the 
receive buffer head and tail match. However, with the present 
implementation of e1000_can_receive(), this code is unreachable -- and 
etherboot breaks as a result.

The attached quick-and-dirty patch fixes etherboot for e1000, and does 
not appear to break post-boot functionality.

[-- Attachment #2: qemu-e1000-receive-overflow-handler-reachability.patch --]
[-- Type: text/x-diff, Size: 430 bytes --]

Signed-off-by: Charles Duffy <charles_duffy@messageone.com>

Index: hw/e1000.c
===================================================================
--- hw/e1000.c	(revision 4985)
+++ hw/e1000.c	(working copy)
@@ -524,8 +524,7 @@
 {
     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);
 }
 
 static void

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

* Re: [Qemu-devel] [PATCH] only check RCTL_EN in e1000_can_receive()
  2008-08-05 20:35 [Qemu-devel] [PATCH] only check RCTL_EN in e1000_can_receive() Charles Duffy
@ 2008-08-06 14:13 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2008-08-06 14:13 UTC (permalink / raw)
  To: qemu-devel

Charles Duffy wrote:
> e1000_receive() has code to raise a receive overflow interrupt when 
> the receive buffer head and tail match. However, with the present 
> implementation of e1000_can_receive(), this code is unreachable -- and 
> etherboot breaks as a result.
>
> The attached quick-and-dirty patch fixes etherboot for e1000, and does 
> not appear to break post-boot functionality.

While this is a legitimate bug, it's probably only present in KVM or 
when using the slirp rate limiting.  Right in QEMU, a can_receive 
handler for a network card is largely ignored whereas in KVM, it is used 
to throttle receive for the tap device.

Nonetheless, the correct behaviour is to raise an interrupt when a 
packet could be received but no buffers are available so I've applied 
this patch.  Thanks.

Regards,

Anthony Liguori

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

end of thread, other threads:[~2008-08-06 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-05 20:35 [Qemu-devel] [PATCH] only check RCTL_EN in e1000_can_receive() Charles Duffy
2008-08-06 14:13 ` Anthony Liguori

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).