[PATCH 0/3] vsock: Introduce SIOCINQ ioctl support

Xuewei Niu posted 3 patches 7 months ago
There is a newer version of this series
drivers/vhost/vsock.c                   |   1 +
include/linux/virtio_vsock.h            |   2 +
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 |  17 ++++
net/vmw_vsock/vsock_loopback.c          |   1 +
tools/testing/vsock/vsock_test.c        | 102 ++++++++++++++++++++++++
8 files changed, 148 insertions(+)
[PATCH 0/3] vsock: Introduce SIOCINQ ioctl support
Posted by Xuewei Niu 7 months ago
This patchset introduces SIOCINQ ioctl support for vsock, indicating the
number of unread bytes.

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

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            |   2 +
 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 |  17 ++++
 net/vmw_vsock/vsock_loopback.c          |   1 +
 tools/testing/vsock/vsock_test.c        | 102 ++++++++++++++++++++++++
 8 files changed, 148 insertions(+)

-- 
2.34.1
Re: [PATCH 0/3] vsock: Introduce SIOCINQ ioctl support
Posted by Stefano Garzarella 7 months ago
On Mon, May 19, 2025 at 03:06:46PM +0800, Xuewei Niu wrote:
>This patchset introduces SIOCINQ ioctl support for vsock, indicating the
>number of unread bytes.

Thanks for this work, but please use net-next tree since this is a new 
feature: 
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev

Thanks,
Stefano

>
>Similar to 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 <niuxuewei.nxw@antgroup.com>
>
>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            |   2 +
> 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 |  17 ++++
> net/vmw_vsock/vsock_loopback.c          |   1 +
> tools/testing/vsock/vsock_test.c        | 102 ++++++++++++++++++++++++
> 8 files changed, 148 insertions(+)
>
>-- 
>2.34.1
>
Re: [PATCH 0/3] vsock: Introduce SIOCINQ ioctl support
Posted by Xuewei Niu 7 months ago
> On Mon, May 19, 2025 at 03:06:46PM +0800, Xuewei Niu wrote:
> >This patchset introduces SIOCINQ ioctl support for vsock, indicating the
> >number of unread bytes.
> 
> Thanks for this work, but please use net-next tree since this is a new 
> feature: 
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev
> 
> Thanks,
> Stefano

Will do.

> >Similar to 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 <niuxuewei.nxw@antgroup.com>
> >
> >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            |   2 +
> > 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 |  17 ++++
> > net/vmw_vsock/vsock_loopback.c          |   1 +
> > tools/testing/vsock/vsock_test.c        | 102 ++++++++++++++++++++++++
> > 8 files changed, 148 insertions(+)
> >
> >-- 
> >2.34.1
> >