Thread (13 messages) 13 messages, 3 authors, 2025-06-16
STALE359d
Revisions (7)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v4 [diff vs current]
  6. v4 [diff vs current]
  7. v5 [diff vs current]

[PATCH net-next v2 0/3] vsock: Introduce SIOCINQ ioctl support

From: Xuewei Niu <hidden>
Date: 2025-06-13 03:12:07
Also in: kvm, lkml, virtualization

This patchset introduces SIOCINQ ioctl support for vsock, indicating the
length of unread bytes.

Similar with SIOCOUTQ ioctl, the information is transport-dependent.

The first patch introduces a new callback, unread_bytes, in vsock
transport, and adds ioctl support in AF_VSOCK.

The second patch implements the SIOCINQ ioctl for all virtio-based transports.

The last one adds two test cases to check the functionality. The changes
have been tested, and the results are as expected.

Signed-off-by: Xuewei Niu <redacted>

--

v1->v2:
https://lore.kernel.org/lkml/20250519070649.3063874-1-niuxuewei.nxw@antgroup.com/ (local)
- Use net-next tree.
- Reuse `rx_bytes` to count unread bytes.
- Wrap ioctl syscall with an int pointer argument to implement a retry
  mechanism.

Xuewei Niu (3):
  vsock: Add support for SIOCINQ ioctl
  vsock/virtio: Add SIOCINQ support for all virtio based transports
  test/vsock: Add ioctl SIOCINQ tests

 drivers/vhost/vsock.c                   |  1 +
 include/linux/virtio_vsock.h            |  1 +
 include/net/af_vsock.h                  |  2 +
 net/vmw_vsock/af_vsock.c                | 22 +++++++
 net/vmw_vsock/virtio_transport.c        |  1 +
 net/vmw_vsock/virtio_transport_common.c | 13 ++++
 net/vmw_vsock/vsock_loopback.c          |  1 +
 tools/testing/vsock/util.c              | 36 ++++++++---
 tools/testing/vsock/util.h              |  2 +
 tools/testing/vsock/vsock_test.c        | 83 ++++++++++++++++++++++++-
 10 files changed, 152 insertions(+), 10 deletions(-)

-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help