From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6M2s-0005nj-VP for qemu-devel@nongnu.org; Tue, 19 May 2009 05:55:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6M2n-0005j1-S9 for qemu-devel@nongnu.org; Tue, 19 May 2009 05:55:37 -0400 Received: from [199.232.76.173] (port=34888 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6M2n-0005iq-Mo for qemu-devel@nongnu.org; Tue, 19 May 2009 05:55:33 -0400 Received: from mail08.svc.cra.dublin.eircom.net ([159.134.118.24]:48744) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1M6M2n-0006em-7H for qemu-devel@nongnu.org; Tue, 19 May 2009 05:55:33 -0400 From: Mark McLoughlin Date: Tue, 19 May 2009 10:55:22 +0100 Message-Id: <1242726931-5726-1-git-send-email-markmc@redhat.com> Subject: [Qemu-devel] [PATCH 0/13] Add generic packet buffering API List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Hi, This patch series works towards two[1] goals: 1) Merging the code in qemu-kvm which drains the tap file descriptor when it is readable and buffers a packet if it fails to add it to the NIC receive queue 2) Using the new TAP_SETSNDBUF ioctl() to put a limit on the number of in-flight packets allowed on a tap device; in this case, if a NIC pops a packet from its transmit queue, we need to be able to buffer said packet if the tap queue is full Rather than having each host backend and each NIC implement packet buffering itself, the idea is to add extend the VLAN send queue to do buffering. The API is fairly simple: - A qemu_send_packet() variant which takes a completion callback is added; if this returns zero, the sender should stop it's send queue until the completion callback is invoked - The VLANClientState receive() handler can now return zero, indicating that no space is available to receive the packet; when space becomes available later, the receiver must call qemu_flush_queued_packets() to re-queue any buffered packets which, in turn, will also cause the sender to re-start Note, these patches depend on two patches sent to the list by Jan Kiszka: [PATCH 01/11] net: Don't deliver to disabled interfaces in qemu_sendv_packet [PATCH 02/11] net: Fix and improved ordered packet delivery Cheers, Mark. [1] - Eagle-eyed readers will notice that I've neglected to actually meet goal (2) with the patch set. Patience, patience :-)