Received: from eggs.gnu.org ([2001:4830:134:3::10]:35417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE7Ys-0007o1-9e for qemu-devel@nongnu.org; Thu, 13 Feb 2014 20:27:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WE7Yj-0005eg-6r for qemu-devel@nongnu.org; Thu, 13 Feb 2014 20:27:26 -0500 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:35182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WE7Yi-0005dz-Es for qemu-devel@nongnu.org; Thu, 13 Feb 2014 20:27:17 -0500 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Feb 2014 11:27:12 +1000 From: Alexey Kardashevskiy Date: Fri, 14 Feb 2014 12:27:04 +1100 Message-Id: <1392341224-18795-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH] 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: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf 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 --- 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 72b0513..a7f00db 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -408,6 +408,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.4.rc4