Add generic packet buffering API
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest13 patches 5 repliesIn review
Patches in v1 No applies recorded yet
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH 0/13] Add generic packet buffering API
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 :-)