On Mon, Jun 22, 2015 at 10:49:29AM -0000, Jonathan Liu wrote:
> Yes, -device e1000-82545em is being used.
>
> Here is the debug output with the patch applied against QEMU git ad7020a7e7b27d468ecc2aacb04ba4eb09017074 after booting to desktop and waiting for DHCP to fallback to automatic private IP address:
> tap_update_fd_handler read_poll 1 write_poll 0 enabled 1
> e1000_can_receive lu 2 rctl_en 0 pci_master 0 has_rxbufs 0
The NIC is not ready to receive so incoming packets are queued...
On Mon, Jun 22, 2015 at 10:49:29AM -0000, Jonathan Liu wrote: 68ecc2aacb04ba4 eb09017074 after booting to desktop and waiting for DHCP to fallback to automatic private IP address: fd_handler read_poll 1 write_poll 0 enabled 1
> Yes, -device e1000-82545em is being used.
>
> Here is the debug output with the patch applied against QEMU git ad7020a7e7b27d4
> tap_update_
> e1000_can_receive lu 2 rctl_en 0 pci_master 0 has_rxbufs 0
The NIC is not ready to receive so incoming packets are queued...
> tap_update_ fd_handler read_poll 0 write_poll 0 enabled 1 fd_handler read_poll 1 write_poll 0 enabled 1 fd_handler read_poll 0 write_poll 0 enabled 1 fd_handler read_poll 1 write_poll 0 enabled 1 fd_handler read_poll 0 write_poll 0 enabled 1 fd_handler read_poll 1 write_poll 0 enabled 1 fd_handler read_poll 0 write_poll 0 enabled 1 fd_handler read_poll 1 write_poll 0 enabled 1 fd_handler read_poll 0 write_poll 0 enabled 1 fd_handler read_poll 1 write_poll 0 enabled 1
> tap_update_
> e1000_can_receive lu 2 rctl_en 0 pci_master 4 has_rxbufs 0
> tap_update_
> tap_update_
> e1000_can_receive lu 2 rctl_en 0 pci_master 4 has_rxbufs 0
> tap_update_
> e1000_link_down link down
> tap_update_
> e1000_can_receive lu 0 rctl_en 0 pci_master 4 has_rxbufs 0
> tap_update_
> tap_update_
> e1000_can_receive lu 0 rctl_en 0 pci_master 4 has_rxbufs 1
> tap_update_
> tap_update_
> e1000_can_receive lu 0 rctl_en 2 pci_master 4 has_rxbufs 1
Now the NIC is ready to receive packets but the link is still down.
Packets remain queued.
> tap_update_ fd_handler read_poll 0 write_poll 0 enabled 1
> e1000_link_up link up
We should flush queued packets now that the link has come back up.
Please try this patch:
diff --git a/hw/net/e1000.c b/hw/net/e1000.c up(E1000State *s) >mac_reg[ STATUS] |= E1000_STATUS_LU; >phy_reg[ PHY_STATUS] |= MII_SR_LINK_STATUS; queued_ packets( qemu_get_ queue(s- >nic));
index bab8e2a..ea58373 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -185,6 +185,7 @@ e1000_link_
{
s-
s-
+ qemu_flush_
}
static bool