On Mon, May 18, 2026 at 11:06:54AM +0200, Stefano Garzarella wrote:
Patch 1 resets the connection when we can no longer queue packets,
this prevents silent data loss, and both peers are notified.

Patch 2 increases the total budget to `buf_alloc * 2` for payload
plus skb overhead similar to how SO_RCVBUF is doubled to reserve
space for sk_buff metadata. This preserves the full buf_alloc for
payload under normal operation, while still bounding the skb queue
growth.

In the future, we plan to improve how we handle the merging of packets
to minimize overhead and avoid closing connections.

v4:
- Split the buf_alloc check to be sure the credit is still respected and
 to avoid overflow of buf_used [sashiko]
- call virtio_transport_do_close() and vsock_remove_sock() to properly
 close the connection and remove the socket from the connect table
 [sashiko]

sashiko reports 2 issues on the second patch but both IMO are pre-existing: https://sashiko.dev/#/patchset/20260518090656.134588-1-sgarzare%40redhat.com

The first one related 32-bit architectures should be fixed, but can be a follow up since not introduced by this series.

The secong one related to a low value set by the user as buffer size, it's also pre-existing and I don't think we can do much.

Please let me know if you prefer to add another patch to this series to fix the first issue, or just send another patch.

Thanks,
Stefano



v3: https://lore.kernel.org/netdev/[email protected]/
- Split in 2 patches [MST]

v2: https://lore.kernel.org/netdev/[email protected]/
- Close the connection when we can no longer queue new packets instead
 of losing data.
- No longer announce the reduced buf_alloc to avoid violating the
 spec. [MST]

v1: https://lore.kernel.org/netdev/[email protected]/

Stefano Garzarella (2):
 vsock/virtio: reset connection on receiving queue overflow
 vsock/virtio: fix skb overhead accounting to preserve full buf_alloc

net/vmw_vsock/virtio_transport_common.c | 29 ++++++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)

--
2.54.0



Reply via email to