From patchwork Mon Jun 22 12:49:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 487201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5739C140157 for ; Mon, 22 Jun 2015 22:49:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=MgjOobbW; dkim-atps=neutral Received: from localhost ([::1]:40000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z71AX-00072O-JZ for incoming@patchwork.ozlabs.org; Mon, 22 Jun 2015 08:49:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z71AD-0006l6-7g for qemu-devel@nongnu.org; Mon, 22 Jun 2015 08:49:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z71A9-0001no-QS for qemu-devel@nongnu.org; Mon, 22 Jun 2015 08:49:25 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:34328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z71A9-0001ni-KW for qemu-devel@nongnu.org; Mon, 22 Jun 2015 08:49:21 -0400 Received: by wicnd19 with SMTP id nd19so75575308wic.1 for ; Mon, 22 Jun 2015 05:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=POiVpDMV6e9O/xu/uNF2pVEQwh0F02CcQ5xEVOEjuwY=; b=MgjOobbWQp+/E/YE6HFKPFp2ciYE3IjCvCIccQGQ4hWQGNgGy3rK015hb9yU2qbT46 yGwczpGf00ajCF0TTs04hxRYBja5FtQe4sNdurmmZdC/qNRfOG22DYqGMJd28JDADFaL IB16DUHrN2n3qv1PTRqraYqGR+9KlxmoTwuRD/emd9nE5PI7k0lNWVY6HHcCZ3adbIci KeLPJ7vWkffYK89+1UdlWzdY83BsGGwCCQLf0XjS9u0vcjU8wtrLnICzZnVmpmTFWTuE H0NOPTdBUtE/FaIfZi7cDGJchaaIkIiFq/Bqc+MizzXLlPDhcXXfN6HpDvJfP4xwxyal S2ww== X-Received: by 10.194.85.116 with SMTP id g20mr51471040wjz.154.1434977360986; Mon, 22 Jun 2015 05:49:20 -0700 (PDT) Received: from localhost (host86-186-232-168.range86-186.btcentralplus.com. [86.186.232.168]) by mx.google.com with ESMTPSA id wx9sm30372553wjb.6.2015.06.22.05.49.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 05:49:18 -0700 (PDT) Date: Mon, 22 Jun 2015 13:49:16 +0100 From: Stefan Hajnoczi To: Bug 1467240 <1467240@bugs.launchpad.net> Message-ID: <20150622124916.GC783@stefanha-thinkpad.redhat.com> References: <20150621112608.24532.97250.malonedeb@gac.canonical.com> <20150622104929.29785.71346.malone@chaenomeles.canonical.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150622104929.29785.71346.malone@chaenomeles.canonical.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22d Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [Bug 1467240] Re: Regression - bridged networking broken for Mac OS X guest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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... > tap_update_fd_handler read_poll 0 write_poll 0 enabled 1 > tap_update_fd_handler read_poll 1 write_poll 0 enabled 1 > e1000_can_receive lu 2 rctl_en 0 pci_master 4 has_rxbufs 0 > tap_update_fd_handler read_poll 0 write_poll 0 enabled 1 > tap_update_fd_handler read_poll 1 write_poll 0 enabled 1 > e1000_can_receive lu 2 rctl_en 0 pci_master 4 has_rxbufs 0 > tap_update_fd_handler read_poll 0 write_poll 0 enabled 1 > e1000_link_down link down > tap_update_fd_handler read_poll 1 write_poll 0 enabled 1 > e1000_can_receive lu 0 rctl_en 0 pci_master 4 has_rxbufs 0 > tap_update_fd_handler read_poll 0 write_poll 0 enabled 1 > tap_update_fd_handler read_poll 1 write_poll 0 enabled 1 > e1000_can_receive lu 0 rctl_en 0 pci_master 4 has_rxbufs 1 > tap_update_fd_handler read_poll 0 write_poll 0 enabled 1 > tap_update_fd_handler read_poll 1 write_poll 0 enabled 1 > 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 index bab8e2a..ea58373 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -185,6 +185,7 @@ e1000_link_up(E1000State *s) { s->mac_reg[STATUS] |= E1000_STATUS_LU; s->phy_reg[PHY_STATUS] |= MII_SR_LINK_STATUS; + qemu_flush_queued_packets(qemu_get_queue(s->nic)); } static bool