From patchwork Fri May 3 06:22:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 241150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 57D2C2C00D0 for ; Fri, 3 May 2013 16:22:37 +1000 (EST) Received: from localhost ([::1]:39224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UY9O7-0003va-65 for incoming@patchwork.ozlabs.org; Fri, 03 May 2013 02:22:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UY9Nr-0003uB-Go for qemu-devel@nongnu.org; Fri, 03 May 2013 02:22:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UY9Nq-00008R-DP for qemu-devel@nongnu.org; Fri, 03 May 2013 02:22:19 -0400 Received: from mail-pb0-x230.google.com ([2607:f8b0:400e:c01::230]:34875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UY9Nq-000088-6z for qemu-devel@nongnu.org; Fri, 03 May 2013 02:22:18 -0400 Received: by mail-pb0-f48.google.com with SMTP id ma3so739037pbc.35 for ; Thu, 02 May 2013 23:22:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=dnOUZqfo8R4cdbOJBnO+LBO+k/H+pdHhbhABMOS3CN0=; b=bp2kyDgIAFY2P9RaaBnqE/5t4Rjm3IHOsopCY58QmQ+lbJ8V0IPDTnWyV2p31TK34L DO4tg/TccW/wYXMWLxv65B8C+IbcZ5DGq/9oRL4P16eqL8YViCv3VxfkXq3bsaU0e67L r1Ey6K/T+CX9e42CQUFq5oAqwpHT8KplYTmpVaJhN77/nS3MtX5TjSd/qE7qaW8W0KC5 D+vFqEz6T8CbnR0Z2Sl6Q8UTUenWprSsAsRw3YXjnF8FQsMFpF5UO4JHZmTzPcxd+HnF 5zS3H/wVRGo3ZTh5rG6ZSapXpBbCD9ZLNfPnFgRE8WAcP6Gz0KJufF60JI0vLqVBqj1r uCqA== X-Received: by 10.68.172.65 with SMTP id ba1mr12445835pbc.166.1367562136596; Thu, 02 May 2013 23:22:16 -0700 (PDT) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPSA id k2sm11500586pat.7.2013.05.02.23.22.13 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 23:22:15 -0700 (PDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Fri, 3 May 2013 16:22:03 +1000 Message-Id: <1367562123-1686-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQklhtNKSwCYlq3hEYYxUSR8A2B/pdIgzmW+CHFY6N2uT18XKO9kzFTRONvemKu28AgdvASd X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::230 Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , David Gibson Subject: [Qemu-devel] [PATCH] spapr_llan: fix device reenabling 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 Normally, the "tap" device is polled by QEMU if a guest NIC can receive packets. If a guest NIC is stopped during transfer (rmmod or ifdown), it may still have packets in a queue which have to be send to the guest before QEMU enables polling of a "tap" interface via tap_update_fd_handler(). However the spapr_llan device was missing the qemu_flush_queued_packets() call so the tap_send_completed() callback was never called and therefore "tap" interface polling was not enabled ever. The patch fixes this problem. Signed-off-by: Alexey Kardashevskiy --- hw/net/spapr_llan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index cca3d1a..46f7d5f 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -336,6 +336,8 @@ static target_ulong h_register_logical_lan(PowerPCCPU *cpu, spapr_vio_dma_set(sdev, VLAN_BD_ADDR(rec_queue), 0, VLAN_BD_LEN(rec_queue)); dev->isopen = 1; + qemu_flush_queued_packets(qemu_get_queue(dev->nic)); + return H_SUCCESS; }