Skip to content

vsock: SOCK_LINGER rework

Michal Luczaj kvm lkml netdev virtualization 6 versions – Applied

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

Get series with b4
b4 am [email protected] change-id 20250304-vsock-linger-9026e5f9986c

Versions newest first

  1. v6 Latest5 patches 5 repliesApplied 5/5
  2. v55 patches 7 repliesSuperseded
  3. v43 patches 11 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v34 patches13 repliesSuperseded
v23 patches9 repliesSuperseded
v12 patches6 repliesSuperseded

Changes in v6 from the cover letter

- Make vsock_wait_sent() return bool, parametrize enable_so_linger() with timeout, don't open code DIV_ROUND_UP [Stefano]
- Link to v5: https://lore.kernel.org/r/[email protected]

Patches in v6 All 5 applied

#Subject and filesSizeRepliesApplied
1/5vsock/virtio: Linger on unsent datanet/vmw_vsock/virtio_transport_common.c+3 -10 repliesApplied
2/5vsock: Move lingering logic to af_vsock coreinclude/net/af_vsock.h net/vmw_vsock/af_vsock.c net/vmw_vsock/virtio_transport_common.c+36 -210 repliesApplied
3/5vsock/test: Introduce vsock_wait_sent() helpertools/testing/vsock/util.c tools/testing/vsock/util.h tools/testing/vsock/vsock_test.c+32 -171 replyApplied
4/5vsock/test: Introduce enable_so_linger() helpertools/testing/vsock/util.c tools/testing/vsock/util.h tools/testing/vsock/vsock_test.c+15 -91 replyApplied
5/5vsock/test: Add test for an unexpectedly lingering close()tools/testing/vsock/vsock_test.c+52 -01 replyApplied

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchStefano Garzarella
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH net-next v6 0/5] vsock: SOCK_LINGER rework

Change vsock's lingerning to wait on close() until all data is sent, i.e. until workers picked all the packets for processing.

Changes in v6:
- Make vsock_wait_sent() return bool, parametrize enable_so_linger() with timeout, don't open code DIV_ROUND_UP [Stefano]
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- Move unsent_bytes fetching logic to utils.c
- Add a helper for enabling SO_LINGER
- Accommodate for close() taking a long time for reasons unrelated to lingering
- Separate and redo the testcase [Stefano]
- Enrich the comment [Stefano]
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- While in virtio, stick to virtio_transport_unsent_bytes() [Stefano]
- Squash the indentation reduction [Stefano]
- Pull SOCK_LINGER check into vsock_linger() [Stefano]
- Don't explicitly pass sk->sk_lingertime [Stefano]
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Set "vsock/virtio" topic where appropriate
- Do not claim that Hyper-V and VMCI ever lingered [Stefano]
- Move lingering to af_vsock core [Stefano]
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Comment that some transports do not implement unsent_bytes [Stefano]
- Reduce the indentation of virtio_transport_wait_close() [Stefano]
- Do not linger on shutdown(), expand the commit messages [Paolo]
- Link to v1: https://lore.kernel.org/r/[email protected]

Changes in v1:
- Do not assume unsent_bytes() is implemented by all transports [Stefano]
- Link to v0: https://lore.kernel.org/netdev/[email protected]/

---
Michal Luczaj (5):
vsock/virtio: Linger on unsent data
vsock: Move lingering logic to af_vsock core vsock/test: Introduce vsock_wait_sent() helper vsock/test: Introduce enable_so_linger() helper vsock/test: Add test for an unexpectedly lingering close()

 include/net/af_vsock.h                  |  1 +
 net/vmw_vsock/af_vsock.c                | 33 +++++++++++++
 net/vmw_vsock/virtio_transport_common.c | 21 +--------
 tools/testing/vsock/util.c              | 38 +++++++++++++++
 tools/testing/vsock/util.h              |  2 +
 tools/testing/vsock/vsock_test.c        | 83 +++++++++++++++++++++++----------
 6 files changed, 134 insertions(+), 44 deletions(-)

---
base-commit: f44092606a3f153bb7e6b277006b1f4a5b914cfc
change-id: 20250304-vsock-linger-9026e5f9986c

Best regards,

Signature · 1 line
Michal Luczaj <[email protected]>