> On Thu, Jul 03, 2025 at 11:05:14AM +0800, Xuewei Niu wrote:
> >Resend: the previous message was rejected due to HTML
> >Resend: forgot to reply all...
> >
> >> On Mon, Jun 30, 2025 at 03:57:26PM +0800, Xuewei Niu wrote:
> >> >Wrap the ioctl in `ioctl_i
Resend: the previous message was rejected due to HTML
Resend: forgot to reply all...
> On Mon, Jun 30, 2025 at 03:57:26PM +0800, Xuewei Niu wrote:
> >Wrap the ioctl in `ioctl_int()`, which takes a pointer to the actual
> >int value and an expected int value. The function will n
Resend: forgot to reply all...
> On Mon, Jun 30, 2025 at 03:57:27PM +0800, Xuewei Niu wrote:
> >Add SIOCINQ ioctl tests for both SOCK_STREAM and SOCK_SEQPACKET.
> >
> >The client waits for the server to send data, and checks if the SIOCINQ
> >ioctl value matches the dat
> On Jul 2, 2025, at 17:58, Stefano Garzarella wrote:
>
> On Mon, Jun 30, 2025 at 03:57:25PM +0800, Xuewei Niu wrote:
>
> IMO here you should not reset the author to you, but you should keep
> Dexuan as authour of this patch.
Well, I did that. However, `./scripts/checkpa
> On Jul 2, 2025, at 09:09, Jakub Kicinski wrote:
>
> On Mon, 30 Jun 2025 15:57:23 +0800 Xuewei Niu wrote:
>> Introduce SIOCINQ ioctl support for vsock, indicating the length of unread
>> bytes.
>>
>> Similar with SIOCOUTQ ioctl, the information is transport
Add SIOCINQ ioctl tests for both SOCK_STREAM and SOCK_SEQPACKET.
The client waits for the server to send data, and checks if the SIOCINQ
ioctl value matches the data size. After consuming the data, the client
checks if the SIOCINQ value is 0.
Signed-off-by: Xuewei Niu
---
tools/testing/vsock
Wrap the ioctl in `ioctl_int()`, which takes a pointer to the actual
int value and an expected int value. The function will not return until
either the ioctl returns the expected value or a timeout occurs, thus
avoiding immediate failure.
Signed-off-by: Xuewei Niu
---
tools/testing/vsock/util.c
ly.
Signed-off-by: Dexuan Cui
Signed-off-by: Xuewei Niu
---
net/vmw_vsock/hyperv_transport.c | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index 31342ab502b4..64f1290a9ae7 100644
-
Add support for SIOCINQ ioctl, indicating the length of bytes unread in the
socket. The value is obtained from `vsock_stream_has_data()`.
Signed-off-by: Xuewei Niu
---
net/vmw_vsock/af_vsock.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/net/vmw_vsock/af_vsock.c b
ff-by: Xuewei Niu
--
v1->v2:
https://lore.kernel.org/lkml/20250519070649.3063874-1-niuxuewei@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
> On Mon, Jun 30, 2025 at 03:38:24PM +0800, Xuewei Niu wrote:
> >Introduce SIOCINQ ioctl support for vsock, indicating the length of unread
> >bytes.
>
> I think something went wrong with this version of the series, because I
> don't see the patch introducing
Add SIOCINQ ioctl tests for both SOCK_STREAM and SOCK_SEQPACKET.
The client waits for the server to send data, and checks if the SIOCINQ
ioctl value matches the data size. After consuming the data, the client
checks if the SIOCINQ value is 0.
Signed-off-by: Xuewei Niu
---
tools/testing/vsock
ly.
Signed-off-by: Dexuan Cui
Signed-off-by: Xuewei Niu
---
net/vmw_vsock/hyperv_transport.c | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index 31342ab502b4..64f1290a9ae7 100644
-
Wrap the ioctl in `ioctl_int()`, which takes a pointer to the actual
int value and an expected int value. The function will not return until
either the ioctl returns the expected value or a timeout occurs, thus
avoiding immediate failure.
Signed-off-by: Xuewei Niu
---
tools/testing/vsock/util.c
ff-by: Xuewei Niu
--
v1->v2:
https://lore.kernel.org/lkml/20250519070649.3063874-1-niuxuewei@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
> On Tue, Jun 17, 2025 at 12:53:46PM +0800, Xuewei Niu wrote:
> >Add SIOCINQ ioctl tests for both SOCK_STREAM and SOCK_SEQPACKET.
> >
> >The client waits for the server to send data, and checks if the SIOCINQ
> >ioctl value matches the data size. After consuming the da
> On Tue, Jun 17, 2025 at 12:53:45PM +0800, Xuewei Niu wrote:
> >Wrap the ioctl in `ioctl_int()`, which takes a pointer to the actual
> >int value and an expected int value. The function will not return until
> >either the ioctl returns the expected value or a timeout occ
Wrap the ioctl in `ioctl_int()`, which takes a pointer to the actual
int value and an expected int value. The function will not return until
either the ioctl returns the expected value or a timeout occurs, thus
avoiding immediate failure.
Signed-off-by: Xuewei Niu
---
tools/testing/vsock/util.c
Add SIOCINQ ioctl tests for both SOCK_STREAM and SOCK_SEQPACKET.
The client waits for the server to send data, and checks if the SIOCINQ
ioctl value matches the data size. After consuming the data, the client
checks if the SIOCINQ value is 0.
Signed-off-by: Xuewei Niu
---
tools/testing/vsock
Add support for SIOCINQ ioctl, indicating the length of bytes unread in the
socket. The value is obtained from `vsock_stream_has_data()`.
Signed-off-by: Xuewei Niu
---
net/vmw_vsock/af_vsock.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/net/vmw_vsock/af_vsock.c b
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
--
v1->v2:
https://lore.kernel.org/lkml/20250519070649.3063874-1-niuxuewei@antgroup.com/
- Use net-next t
> On Mon, Jun 16, 2025 at 03:42:53PM +0200, Luigi Leonardi wrote:
> >On Fri, Jun 13, 2025 at 11:11:50AM +0800, Xuewei Niu wrote:
> >>This patch adds support for SIOCINQ ioctl, which returns the number of
> >>bytes unread in the socket.
> >>
> >>Signe
> On Fri, Jun 13, 2025 at 11:11:52AM +0800, Xuewei Niu wrote:
> >This patch adds SIOCINQ ioctl tests for both SOCK_STREAM and
> >SOCK_SEQPACKET.
> >
> >The client waits for the server to send data, and checks if the SIOCINQ
> >ioctl value matches the data size. Aft
> On Fri, Jun 13, 2025 at 11:11:50AM +0800, Xuewei Niu wrote:
> >This patch adds support for SIOCINQ ioctl, which returns the number of
> >bytes unread in the socket.
> >
> >Signed-off-by: Xuewei Niu
> >---
> > include/net/af_vsock.h |
This patch adds SIOCINQ ioctl tests for both SOCK_STREAM and
SOCK_SEQPACKET.
The client waits for the server to send data, and checks if the SIOCINQ
ioctl value matches the data size. After consuming the data, the client
checks if the SIOCINQ value is 0.
Signed-off-by: Xuewei Niu
---
tools
The value of the SIOCINQ is obtained by `virtio_transport_unread_bytes()`,
which is generic for all virtio transports. The function acquires the
`rx_lock` and returns the value of `rx_bytes`.
Signed-off-by: Xuewei Niu
---
drivers/vhost/vsock.c | 1 +
include/linux
This patch adds support for SIOCINQ ioctl, which returns the number of
bytes unread in the socket.
Signed-off-by: Xuewei Niu
---
include/net/af_vsock.h | 2 ++
net/vmw_vsock/af_vsock.c | 22 ++
2 files changed, 24 insertions(+)
diff --git a/include/net/af_vsock.h b
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
--
v1->v2:
https://lore.kernel.org/lkml/20250519070649.3063874-1-niuxue
> On Thu, 12 Jun 2025 at 10:21, Xuewei Niu wrote:
> >
> > > On Thu, 12 Jun 2025 at 08:50, Xuewei Niu wrote:
> > > >
> > > > > On Thu, Jun 12, 2025 at 01:32:01PM +0800, Xuewei Niu wrote:
> > > > > > No comments since last month.
> On Thu, 12 Jun 2025 at 08:50, Xuewei Niu wrote:
> >
> > > On Thu, Jun 12, 2025 at 01:32:01PM +0800, Xuewei Niu wrote:
> > > > No comments since last month.
> > > >
> > > > The patch [1], which adds SIOCINQ ioctl support for vsock, depends on
> On Thu, Jun 12, 2025 at 01:32:01PM +0800, Xuewei Niu wrote:
> > No comments since last month.
> >
> > The patch [1], which adds SIOCINQ ioctl support for vsock, depends on this
> > patch. Could I get more eyes on this one?
> >
> >
No comments since last month.
The patch [1], which adds SIOCINQ ioctl support for vsock, depends on this
patch. Could I get more eyes on this one?
[1]:
https://lore.kernel.org/lkml/bbn4lvdwh42m2zvi3rdyws66y5ulew32rchtz3kxirqlllkr63@7toa4tcepax3/#t
Thanks,
Xuewei
> On Wed, 21 May 2025 at 10:58, Stefano Garzarella wrote:
> >
> > Forgot to CC Arseniy.
> >
> > On Wed, 21 May 2025 at 10:57, Stefano Garzarella
> > wrote:
> > >
> > > On Wed, May 21, 2025 at 10:06:13AM +0800, Xuewei Niu wrote:
> > > &
> On Wed, May 21, 2025 at 10:06:13AM +0800, Xuewei Niu wrote:
> >> On Mon, May 19, 2025 at 03:06:48PM +0800, Xuewei Niu wrote:
> >> >The virtio_vsock_sock has a new field called bytes_unread as the return
> >> >value of the SIOCINQ ioctl.
> >> >
> On Mon, May 19, 2025 at 03:06:48PM +0800, Xuewei Niu wrote:
> >The virtio_vsock_sock has a new field called bytes_unread as the return
> >value of the SIOCINQ ioctl.
> >
> >Though the rx_bytes exists, we introduce a bytes_unread field to the
> >virtio_vsock_s
> On Mon, May 19, 2025 at 03:06:49PM +0800, Xuewei Niu wrote:
> >This patch adds two tests for ioctl SIOCINQ for SOCK_STREAM and
> >SOCK_SEQPACKET. The client waits for the server to send data, and checks if
> >the return value of the SIOCINQ is the size of the data. Then, con
> 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
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
Xuewei Niu (3):
vsock: Add support for SIOCINQ ioctl
vsock/virtio: Add SIOCINQ
This patch adds support for SIOCINQ ioctl, which returns the number of
bytes unread in the socket.
Signed-off-by: Xuewei Niu
---
include/net/af_vsock.h | 2 ++
net/vmw_vsock/af_vsock.c | 22 ++
2 files changed, 24 insertions(+)
diff --git a/include/net/af_vsock.h b
This patch adds two tests for ioctl SIOCINQ for SOCK_STREAM and
SOCK_SEQPACKET. The client waits for the server to send data, and checks if
the return value of the SIOCINQ is the size of the data. Then, consumes the
data and checks if the value is 0.
Signed-off-by: Xuewei Niu
---
tools/testing
inconsistency.
The byte_unread is increased by the length of the skbuff when skbuff is
enqueued, and it is decreased when dequeued.
Signed-off-by: Xuewei Niu
---
drivers/vhost/vsock.c | 1 +
include/linux/virtio_vsock.h| 2 ++
net/vmw_vsock/virtio_transport.c| 1
Hi, MST!
> > include/linux/virtio_vsock.h| 2 +-
> > include/net/af_vsock.h | 25 ++-
> > include/uapi/linux/virtio_vsock.h | 1 +
> > include/uapi/linux/vm_sockets.h | 14 ++
> > net/vmw_vsock/af_vsock.c| 116 +--
> > net/v
The new request is called `IOCTL_VM_SOCKETS_GET_LOCAL_CIDS`. And the old
one, `IOCTL_VM_SOCKETS_GET_LOCAL_CID` is retained.
For the transport that supports multi-devices:
* `IOCTL_VM_SOCKETS_GET_LOCAL_CID` returns "-1";
* `IOCTL_VM_SOCKETS_GET_LOCAL_CIDS` returns a vector of CIDS. The usage is
sh
Adds a new argument, named "src_cid", to let them know which `virtio_vsock`
to be selected.
Signed-off-by: Xuewei Niu
---
include/net/af_vsock.h | 2 +-
net/vmw_vsock/af_vsock.c | 15 +--
net/vmw_vsock/virtio_transport.c | 4 ++--
net/vmw_vsock/vsock_
Adds a new argument, named "cid", to let them know which `virtio_vsock` to
be selected.
Signed-off-by: Xuewei Niu
---
include/linux/virtio_vsock.h| 2 +-
net/vmw_vsock/virtio_transport.c| 5 ++---
net/vmw_vsock/virtio_transport_common.c | 6 +++---
3 files
The devices are inserted into the list when probing.
The kernel will deny devices from being registered if there are conflicts
existing in CIDs or orders.
Signed-off-by: Xuewei Niu
---
include/net/af_vsock.h | 16 ++
include/uapi/linux/vm_sockets.h | 6 +
net/vmw_vsock
ce, but is required for the
mode of multiple devices.
Signed-off-by: Xuewei Niu
---
include/uapi/linux/virtio_vsock.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/virtio_vsock.h
b/include/uapi/linux/virtio_vsock.h
index 64738838bee5..b62ec7d2ab1e 100644
--- a/include/
amp;host_port);
n = write(fd, buffer);
```
# Use Cases
We've completed a POC with Kata Containers, Ztunnel, which is a
purpose-built per-node proxy for Istio ambient mesh, and TSI. Please refer
to the following link for more details.
Link: https://bit.ly/4bdPJbU
Xuewei Niu (5):
vsock/virtio:
48 matches
Mail list logo