diff options
| author | David Carlier <devnexen@gmail.com> | 2026-10-16 14:27:15 +0100 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-10-21 11:58:21 +0200 |
| commit | d7bb20b91122fd1e8ecbe6ff9fd13b8eefff8240 (patch) | |
| tree | f7b8e8abef1ebb7984fb37cd23b97c6a0a1812aa /include | |
| parent | a006b921ad32940676993bfae460b9f57547b79b (diff) | |
vsock: support SO_INQ on stream sockets
SO_INQ makes recvmsg() return the bytes left in the receive queue in an
SCM_INQ cmsg, saving a SIOCINQ call per receive. AF_UNIX stream sockets
support it, AF_VSOCK fails with ENOPROTOOPT.
Add it for SOCK_STREAM, reusing the hint already computed for io_uring.
As with TCP_INQ, 1 is reported once the stream is finished so the caller
reads again and sees EOF, and accepted sockets inherit the setting from
the listener. No cmsg is sent when the transport cannot report the queue
length.
SOCK_SEQPACKET is refused, as on AF_UNIX: its transport callback counts
messages, not bytes.
Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20261016132716.272018-3-devnexen@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/af_vsock.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index 5549298c1ec6..e8481f12312e 100644 --- a/include/net/af_vsock.h +++ b/include/net/af_vsock.h @@ -68,6 +68,7 @@ struct vsock_sock { u64 buffer_size; u64 buffer_min_size; u64 buffer_max_size; + bool recvmsg_inq; /* Private to transport. */ void *trans; |
