netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v5 0/5] vsock: SOCK_LINGER rework
@ 2025-05-20 22:55 Michal Luczaj
  2025-05-20 22:55 ` [PATCH net-next v5 1/5] vsock/virtio: Linger on unsent data Michal Luczaj
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Michal Luczaj @ 2025-05-20 22:55 UTC (permalink / raw)
  To: Stefano Garzarella, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Michael S. Tsirkin, Jason Wang,
	Xuan Zhuo, Eugenio Pérez, Stefan Hajnoczi
  Cc: virtualization, netdev, linux-kernel, kvm, Michal Luczaj

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 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/20250501-vsock-linger-v4-0-beabbd8a0847@rbox.co

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/20250430-vsock-linger-v3-0-ddbe73b53457@rbox.co

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/20250421-vsock-linger-v2-0-fe9febd64668@rbox.co

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/20250407-vsock-linger-v1-0-1458038e3492@rbox.co

Changes in v1:
- Do not assume `unsent_bytes()` is implemented by all transports [Stefano]
- Link to v0: https://lore.kernel.org/netdev/df2d51fd-03e7-477f-8aea-938446f47864@rbox.co/

Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
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              |  5 +++
 tools/testing/vsock/vsock_test.c        | 80 ++++++++++++++++++++++-----------
 6 files changed, 134 insertions(+), 44 deletions(-)
---
base-commit: 9ab0ac0e532afd167b3bec39b2eb25c53486dcb5
change-id: 20250304-vsock-linger-9026e5f9986c

Best regards,
-- 
Michal Luczaj <mhal@rbox.co>


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-05-21 23:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20 22:55 [PATCH net-next v5 0/5] vsock: SOCK_LINGER rework Michal Luczaj
2025-05-20 22:55 ` [PATCH net-next v5 1/5] vsock/virtio: Linger on unsent data Michal Luczaj
2025-05-20 22:55 ` [PATCH net-next v5 2/5] vsock: Move lingering logic to af_vsock core Michal Luczaj
2025-05-21 14:37   ` Stefano Garzarella
2025-05-20 22:55 ` [PATCH net-next v5 3/5] vsock/test: Introduce vsock_wait_sent() helper Michal Luczaj
2025-05-21 15:01   ` Stefano Garzarella
2025-05-21 23:06     ` Michal Luczaj
2025-05-20 22:55 ` [PATCH net-next v5 4/5] vsock/test: Introduce enable_so_linger() helper Michal Luczaj
2025-05-21 14:41   ` Stefano Garzarella
2025-05-21 23:08     ` Michal Luczaj
2025-05-20 22:55 ` [PATCH net-next v5 5/5] vsock/test: Add test for an unexpectedly lingering close() Michal Luczaj
2025-05-21 14:56   ` Stefano Garzarella
2025-05-21 23:17     ` Michal Luczaj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).