Skip to content

Add generic packet buffering API

Mark McLoughlin qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13net: factor tap_read_packet() out of tap_send()net.c+19 -90 replies
2/13net: move the tap buffer into TAPStatenet.c+3 -30 replies
3/13net: vlan clients with no fd_can_read() can always receivenet.c+10 -60 replies
4/13net: only read from tapfd when we can sendnet.c+8 -10 replies
5/13net: add fd_readv() handler to qemu_new_vlan_client() argshw/dp8393x.c hw/e1000.c hw/eepro100.c +16 more+40 -350 replies
6/13net: re-name vc->fd_read() to vc->receive()hw/dp8393x.c hw/e1000.c hw/eepro100.c +17 more+57 -560 replies
7/13net: pass VLANClientState* as first arg to receive handlershw/dp8393x.c hw/e1000.c hw/eepro100.c +16 more+90 -900 replies
8/13net: add return value to packet receive handlerhw/dp8393x.c hw/e1000.c hw/eepro100.c +15 more+126 -950 replies
9/13net: return status from qemu_deliver_packet()net.c+17 -30 replies
10/13net: split out packet queueing and flushing into separate functionsnet.c+98 -570 replies
11/13net: add qemu_send_packet_async()net.c net.h+70 -210 replies
12/13net: make use of async packet sending API in tap clientnet.c+20 -40 replies
13/13virtio-net: implement rx packet queueinghw/virtio-net.c+4 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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 :-)