[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 08/60] eepro100: Fix network hang when rx buffers r
From: |
Michael Tokarev |
Subject: |
[Qemu-stable] [PATCH 08/60] eepro100: Fix network hang when rx buffers run out |
Date: |
Mon, 4 Feb 2013 14:40:18 +0400 |
From: Bo Yang <address@hidden>
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 <address@hidden>]
Signed-off-by: Bo Yang <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit 1069985fb132cd4324fc02d371f1e61492a1823f)
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/eepro100.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/eepro100.c b/hw/eepro100.c
index 6279ae3..5b62196 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:
@@ -1763,7 +1764,8 @@ static ssize_t nic_receive(VLANClientState *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
- [Qemu-stable] [PATCH 40/60] nbd: fixes to read-only handling, (continued)
- [Qemu-stable] [PATCH 40/60] nbd: fixes to read-only handling, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 28/60] Fixes related to processing of qemu's -numa option, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 51/60] vmdk: Fix data corruption bug in WRITE and READ handling, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 59/60] target-xtensa: fix ITLB/DTLB page protection flags, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 55/60] arm_boot: Change initrd load address to "halfway through RAM", Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 34/60] memory: fix rendering of a region obscured by another, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 13/60] usb-audio: fix usb version, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 37/60] target-sparc64: disable VGA cirrus, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 14/60] fpu/softfloat.c: Return correctly signed values from uint64_to_float32, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 52/60] uhci: Don't queue up packets after one with the SPD flag set, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 08/60] eepro100: Fix network hang when rx buffers run out,
Michael Tokarev <=
- [Qemu-stable] [PATCH 53/60] hw/qxl: qxl_send_events: nop if stopped, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 12/60] intel_hda: do not call msi_reset when only device state needs resetting, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 24/60] qxl: always update displaysurface on resize, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 36/60] PPC: Bamboo: Fix memory size DT property, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 17/60] net: notify iothread after flushing queue, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 31/60] linux-user: fix emulation of getdents, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 44/60] qcow2: Fix refcount table size calculation, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 43/60] qcow2: Fix avail_sectors in cluster allocation code, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 06/60] fix doc of using raw values with sendkey, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 48/60] ide: Fix crash with too long PRD, Michael Tokarev, 2013/02/04