linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/3] vsock: Introduce SIOCINQ ioctl support
@ 2025-06-17  4:53 Xuewei Niu
  2025-06-17  4:53 ` [PATCH net-next v3 1/3] vsock: Add support for SIOCINQ ioctl Xuewei Niu
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Xuewei Niu @ 2025-06-17  4:53 UTC (permalink / raw)
  To: sgarzare, mst, pabeni, jasowang, xuanzhuo, davem, netdev,
	stefanha, leonardi
  Cc: virtualization, kvm, linux-kernel, fupan.lfp, Xuewei Niu

Introduce SIOCINQ ioctl support for vsock, indicating the length of unread
bytes.

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

The first patch adds SIOCINQ ioctl support in AF_VSOCK.

The second patch wraps the ioctl into `ioctl_int()`, which implements a
retry mechanism to prevent immediate failure.

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 <niuxuewei.nxw@antgroup.com>

--

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

v2->v3:
https://lore.kernel.org/netdev/20250613031152.1076725-1-niuxuewei.nxw@antgroup.com/
- Update commit messages following the guidelines
- Remove `unread_bytes` callback and reuse `vsock_stream_has_data()`
- Move the tests to the end of array
- Split the refactoring patch
- Include <sys/ioctl.h> in the util.c

Xuewei Niu (3):
  vsock: Add support for SIOCINQ ioctl
  test/vsock: Add retry mechanism to ioctl wrapper
  test/vsock: Add ioctl SIOCINQ tests

 net/vmw_vsock/af_vsock.c         | 22 +++++++++
 tools/testing/vsock/util.c       | 37 ++++++++++----
 tools/testing/vsock/util.h       |  1 +
 tools/testing/vsock/vsock_test.c | 82 ++++++++++++++++++++++++++++++++
 4 files changed, 133 insertions(+), 9 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-06-27 11:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17  4:53 [PATCH net-next v3 0/3] vsock: Introduce SIOCINQ ioctl support Xuewei Niu
2025-06-17  4:53 ` [PATCH net-next v3 1/3] vsock: Add support for SIOCINQ ioctl Xuewei Niu
2025-06-17 14:39   ` Stefano Garzarella
2025-06-22 13:59     ` Xuewei Niu
2025-06-23 17:01       ` Stefano Garzarella
2025-06-25  8:03     ` [EXTERNAL] " Dexuan Cui
2025-06-25 13:32       ` Stefano Garzarella
2025-06-25 16:41         ` Dexuan Cui
2025-06-26  5:02         ` Xuewei Niu
2025-06-27  8:50           ` [EXTERNAL] " Dexuan Cui
2025-06-27 11:01             ` Stefano Garzarella
2025-06-27 11:42             ` Xuewei Niu
2025-06-17  4:53 ` [PATCH net-next v3 2/3] test/vsock: Add retry mechanism to ioctl wrapper Xuewei Niu
2025-06-17 15:10   ` Stefano Garzarella
2025-06-17 15:23     ` Xuewei Niu
2025-06-17  4:53 ` [PATCH net-next v3 3/3] test/vsock: Add ioctl SIOCINQ tests Xuewei Niu
2025-06-17 15:21   ` Stefano Garzarella
2025-06-17 15:31     ` Xuewei Niu

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).