> The guest already uses page-sized RX allocations. A datagram can exceed > one RX buffer. Growing every posted buffer to hold a full datagram would > increase virtqueue memory use and make small queued datagrams retain large > backing allocations. With delayed reads, a bounded receive queue could > then fill after only a few messages. > > Define START and EOM flags for datagram packets. Mark outgoing messages > with both flags, and let vhost split a message across guest RX buffers, > keeping START on the first fragment and EOM on the last. When a data > packet meets a descriptor with no payload space, vhost returns that > descriptor with zero used bytes. It drops datagrams but requeues stream > and seqpacket data for a later buffer. > > Reassemble consecutive fragments in the guest before tap or socket > delivery. Bound a partial message to 64 fragments and 64 KiB. Discard > incomplete messages on malformed packets, a new START, a peer mismatch, > an intervening non-datagram packet, or virtqueue teardown. Require complete > framing for host and loopback ingress. > > A QEMU reproducer now delivers a 9 KiB datagram as one message and all > 16 messages of a delayed-read burst. Paired host/guest selftests cover > 64 KiB messages and the burst through both a userspace backend and the > patched Linux vhost backend, with stream and seqpacket controls. A nested > vhost-vsock guest posting header-only RX buffers also passes stream and > seqpacket receive tests. > > Signed-off-by: Sergio Lopez <[email protected]>
Sashiko has reviewed this patch and found no issues. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=7
