From patchwork Fri Aug 10 13:27:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 176500 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 2FA3C2C007E for ; Fri, 10 Aug 2012 23:49:00 +1000 (EST) Received: from localhost ([::1]:46215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzpaE-0006WZ-Bd for incoming@patchwork.ozlabs.org; Fri, 10 Aug 2012 09:48:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzpGH-0003rq-0D for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzpGF-0007a6-CW for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:28:20 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:38571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzpGF-0007Zo-3t for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:28:19 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Aug 2012 14:28:17 +0100 Received: from d06nrmr1806.portsmouth.uk.ibm.com (9.149.39.193) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 10 Aug 2012 14:27:58 +0100 Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7ADRwsO868384 for ; Fri, 10 Aug 2012 14:27:58 +0100 Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7ADRvPm025403 for ; Fri, 10 Aug 2012 07:27:57 -0600 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.145]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q7ADRuol025364; Fri, 10 Aug 2012 07:27:56 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Fri, 10 Aug 2012 14:27:46 +0100 Message-Id: <1344605266-13644-4-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1344605266-13644-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1344605266-13644-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12081013-5024-0000-0000-0000037990A8 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.107 Cc: Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi , Stefano Stabellini Subject: [Qemu-devel] [PATCH 3/3] xen: flush queue when getting an event 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 From: Paolo Bonzini xen does not have a register that, when written, will cause can_receive to go from false to true. However, flushing the queue can be attempted whenever the front-end raises its side of the Xen event channel. There is a single event channel for tx and rx. Cc: Stefano Stabellini Cc: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- hw/xen_nic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xen_nic.c b/hw/xen_nic.c index 8b79bfb..cf7d559 100644 --- a/hw/xen_nic.c +++ b/hw/xen_nic.c @@ -415,6 +415,7 @@ static void net_event(struct XenDevice *xendev) { struct XenNetDev *netdev = container_of(xendev, struct XenNetDev, xendev); net_tx_packets(netdev); + qemu_flush_queued_packets(&netdev->nic->nc); } static int net_free(struct XenDevice *xendev)