Skip to content

vsock/virtio: fix skb overhead accounting to preserve full buf_alloc

Stefano Garzarella kvm lkml netdev stable virtualization 4 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesApplied 2/2
  2. v32 patches 9 repliesSuperseded
  3. v21 patch 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch9 repliesSuperseded

Changes in v4 from the cover letter

- 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]

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2vsock/virtio: reset connection on receiving queue overflownet/vmw_vsock/virtio_transport_common.c+15 -50 repliesApplied
2/2vsock/virtio: fix skb overhead accounting to preserve full buf_allocnet/vmw_vsock/virtio_transport_common.c+8 -10 repliesApplied

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH net v4 0/2] vsock/virtio: fix skb overhead accounting to preserve full buf_alloc

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]

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(-)
Signature · 1 line
2.54.0