From: Stefan Hajnoczi <stefanha@gmail.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Bo Yang <boyang@suse.com>, Stefan Hajnoczi <stefanha@gmail.com>,
qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 04/13] eepro100: Fix network hang when rx buffers run out
Date: Fri, 14 Sep 2012 09:46:51 +0100 [thread overview]
Message-ID: <1347612420-5704-5-git-send-email-stefanha@gmail.com> (raw)
In-Reply-To: <1347612420-5704-1-git-send-email-stefanha@gmail.com>
From: Bo Yang <boyang@suse.com>
This is reported by QA. When installing os with pxe, after the initial
kernel and initrd are loaded, the procedure tries to copy files from install
server to local harddisk, the network becomes stall because of running out of
receive descriptor.
[Whitespace fixes and removed qemu_notify_event() because Paolo's
earlier net patches have moved it into qemu_flush_queued_packets().
Additional info:
I can reproduce the network hang with a tap device doing a iPXE HTTP
boot as follows:
$ qemu -enable-kvm -m 1024 \
-netdev tap,id=netdev0,script=no,downscript=no \
-device i82559er,netdev=netdev0,romfile=80861209.rom \
-drive if=virtio,cache=none,file=test.img
iPXE> ifopen net0
iPXE> config # set static network configuration
iPXE> kernel http://mirror.bytemark.co.uk/fedora/linux/releases/17/Fedora/x86_64/os/images/pxeboot/vmlinuz
I needed a vanilla iPXE ROM to get to the iPXE prompt. I think the boot
prompt has been disabled in the ROMs that ship with QEMU to reduce boot
time.
During the vmlinuz HTTP download there is a network hang. hw/eepro100.c
has reached the end of the rx descriptor list. When the iPXE driver
replenishes the rx descriptor list we don't kick the QEMU net subsystem
and event loop, thereby leaving the tap netdev without its file
descriptor in select(2).
Stefan Hajnoczi <stefanha@gmail.com>]
Signed-off-by: Bo Yang <boyang@suse.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
---
hw/eepro100.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/eepro100.c b/hw/eepro100.c
index 50d117e..5b23116 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -1036,6 +1036,7 @@ static void eepro100_ru_command(EEPRO100State * s, uint8_t val)
}
set_ru_state(s, ru_ready);
s->ru_offset = e100_read_reg4(s, SCBPointer);
+ qemu_flush_queued_packets(&s->nic->nc);
TRACE(OTHER, logout("val=0x%02x (rx start)\n", val));
break;
case RX_RESUME:
@@ -1770,7 +1771,8 @@ static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size)
if (rfd_command & COMMAND_EL) {
/* EL bit is set, so this was the last frame. */
logout("receive: Running out of frames\n");
- set_ru_state(s, ru_suspended);
+ set_ru_state(s, ru_no_resources);
+ eepro100_rnr_interrupt(s);
}
if (rfd_command & COMMAND_S) {
/* S bit is set. */
--
1.7.10.4
next prev parent reply other threads:[~2012-09-14 8:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-14 8:46 [Qemu-devel] [PULL 00/13] Net patches Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 01/13] net: notify iothread after flushing queue Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 02/13] e1000: flush queue whenever can_receive can go from false to true Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 03/13] xen: flush queue when getting an event Stefan Hajnoczi
2012-09-14 8:46 ` Stefan Hajnoczi [this message]
2012-09-14 8:46 ` [Qemu-devel] [PATCH 05/13] net: add receive_disabled logic to iov delivery path Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 06/13] net: do not report queued packets as sent Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 07/13] net: add -netdev options to man page Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 08/13] net: clean up usbnet_receive() Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 09/13] net: fix usbnet_receive() packet drops Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 10/13] net: broadcast hub packets if at least one port can receive Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 11/13] net: asynchronous send/receive infrastructure for net/socket.c Stefan Hajnoczi
2012-09-14 8:46 ` [Qemu-devel] [PATCH 12/13] net: EAGAIN handling for net/socket.c UDP Stefan Hajnoczi
2012-09-14 8:47 ` [Qemu-devel] [PATCH 13/13] net: EAGAIN handling for net/socket.c TCP Stefan Hajnoczi
2012-09-17 18:19 ` [Qemu-devel] [PULL 00/13] Net patches Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347612420-5704-5-git-send-email-stefanha@gmail.com \
--to=stefanha@gmail.com \
--cc=aliguori@us.ibm.com \
--cc=boyang@suse.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).