Received: from eggs.gnu.org ([2001:4830:134:3::10]:58986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLhoa-0001JW-Tl for qemu-devel@nongnu.org; Thu, 06 Mar 2014 18:35:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLhnz-0003Ql-F0 for qemu-devel@nongnu.org; Thu, 06 Mar 2014 18:35:00 -0500 From: Alexander Graf Date: Fri, 7 Mar 2014 00:34:06 +0100 Message-Id: <1394148857-19607-120-git-send-email-agraf@suse.de> In-Reply-To: <1394148857-19607-1-git-send-email-agraf@suse.de> References: <1394148857-19607-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 119/130] spapr-vlan: flush queue whenever can_receive can go from false to true List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Alexey Kardashevskiy , blauwirbel@gmail.com, qemu-ppc@nongnu.org, aliguori@amazon.com, aurelien@aurel32.net From: Alexey Kardashevskiy When the guests adds buffers to receive queue, the network device should flush its queue of pending packets. This is done with qemu_flush_queued_packets. This adds a call to qemu_flush_queued_packets() which wakes up the main loop and let QEMU update the network device status which now is "can receive". The patch basically does the same thing as e8b4c68 does. Suggested-by: Max Filippov Signed-off-by: Alexey Kardashevskiy Signed-off-by: Alexander Graf --- 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 1bd6f50..f6fbcb5 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -405,6 +405,8 @@ static target_ulong h_add_logical_lan_buffer(PowerPCCPU *cpu, dev->rx_bufs++; + qemu_flush_queued_packets(qemu_get_queue(dev->nic)); + DPRINTF("h_add_logical_lan_buffer(): Added buf ptr=%d rx_bufs=%d" " bd=0x%016llx\n", dev->add_buf_ptr, dev->rx_bufs, (unsigned long long)buf); -- 1.8.1.4