linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support
@ 2025-07-06  4:36 Xuewei Niu
  2025-07-06  4:36 ` [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data() Xuewei Niu
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-06  4:36 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Stefano Garzarella, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: linux-hyperv, virtualization, netdev, linux-kernel, Xuewei Niu,
	fupan.lfp

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.

Thanks to @dexuan, the second patch is to fix the issue where hyper-v
`hvs_stream_has_data()` doesn't return the readable bytes.

The third 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

v3->v4:
https://lore.kernel.org/netdev/20250617045347.1233128-1-niuxuewei.nxw@antgroup.com/
- Hyper-v `hvs_stream_has_data()` returns the readable bytes
- Skip testing the null value for `actual` (int pointer)
- Rename `ioctl_int()` to `vsock_ioctl_int()`
- Fix a typo and a format issue in comments
- Remove the `RECEIVED` barrier.
- The return type of `vsock_ioctl_int()` has been changed to bool

v4->v5:
https://lore.kernel.org/netdev/20250630075727.210462-1-niuxuewei.nxw@antgroup.com/
- Put the hyper-v fix before the SIOCINQ ioctl implementation.
- Remove my SOB from the hyper-v fix patch.
- Move the `need_refill` initialization into the `case 1` block.
- Remove the `actual` argument from `vsock_ioctl_int()`.
- Replace `TIOCINQ` with `SIOCINQ`.

---
Xuewei Niu (4):
      hv_sock: Return the readable bytes in hvs_stream_has_data()
      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 +++++++++++
 net/vmw_vsock/hyperv_transport.c | 17 +++++++--
 tools/testing/vsock/util.c       | 30 ++++++++++-----
 tools/testing/vsock/util.h       |  1 +
 tools/testing/vsock/vsock_test.c | 79 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 137 insertions(+), 12 deletions(-)
---
base-commit: 5f712c3877f99d5b5e4d011955c6467ae0e535a6
change-id: 20250703-siocinq-9e2907939806

Best regards,
-- 
Xuewei Niu <niuxuewei.nxw@antgroup.com>


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

* [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data()
  2025-07-06  4:36 [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Xuewei Niu
@ 2025-07-06  4:36 ` Xuewei Niu
  2025-07-07 13:40   ` Stefano Garzarella
  2025-07-07 13:42   ` Stefano Garzarella
  2025-07-06  4:36 ` [PATCH net-next v5 2/4] vsock: Add support for SIOCINQ ioctl Xuewei Niu
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-06  4:36 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Stefano Garzarella, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: linux-hyperv, virtualization, netdev, linux-kernel, Xuewei Niu,
	fupan.lfp

When hv_sock was originally added, __vsock_stream_recvmsg() and
vsock_stream_has_data() actually only needed to know whether there
is any readable data or not, so hvs_stream_has_data() was written to
return 1 or 0 for simplicity.

However, now hvs_stream_has_data() should return the readable bytes
because vsock_data_ready() -> vsock_stream_has_data() needs to know the
actual bytes rather than a boolean value of 1 or 0.

The SIOCINQ ioctl support also needs hvs_stream_has_data() to return
the readable bytes.

Let hvs_stream_has_data() return the readable bytes of the payload in
the next host-to-guest VMBus hv_sock packet.

Note: there may be multpile incoming hv_sock packets pending in the
VMBus channel's ringbuffer, but so far there is not a VMBus API that
allows us to know all the readable bytes in total without reading and
caching the payload of the multiple packets, so let's just return the
readable bytes of the next single packet. In the future, we'll either
add a VMBus API that allows us to know the total readable bytes without
touching the data in the ringbuffer, or the hv_sock driver needs to
understand the VMBus packet format and parse the packets directly.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 net/vmw_vsock/hyperv_transport.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index 31342ab502b4fc35feb812d2c94e0e35ded73771..432fcbbd14d4f44bd2550be8376e42ce65122758 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -694,15 +694,26 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg,
 static s64 hvs_stream_has_data(struct vsock_sock *vsk)
 {
 	struct hvsock *hvs = vsk->trans;
+	bool need_refill;
 	s64 ret;
 
 	if (hvs->recv_data_len > 0)
-		return 1;
+		return hvs->recv_data_len;
 
 	switch (hvs_channel_readable_payload(hvs->chan)) {
 	case 1:
-		ret = 1;
-		break;
+		need_refill = !hvs->recv_desc;
+		if (!need_refill)
+			return -EIO;
+
+		hvs->recv_desc = hv_pkt_iter_first(hvs->chan);
+		if (!hvs->recv_desc)
+			return -ENOBUFS;
+
+		ret = hvs_update_recv_data(hvs);
+		if (ret)
+			return ret;
+		return hvs->recv_data_len;
 	case 0:
 		vsk->peer_shutdown |= SEND_SHUTDOWN;
 		ret = 0;

-- 
2.34.1


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

* [PATCH net-next v5 2/4] vsock: Add support for SIOCINQ ioctl
  2025-07-06  4:36 [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Xuewei Niu
  2025-07-06  4:36 ` [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data() Xuewei Niu
@ 2025-07-06  4:36 ` Xuewei Niu
  2025-07-06  4:36 ` [PATCH net-next v5 3/4] test/vsock: Add retry mechanism to ioctl wrapper Xuewei Niu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-06  4:36 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Stefano Garzarella, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: linux-hyperv, virtualization, netdev, linux-kernel, Xuewei Niu,
	fupan.lfp

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 <niuxuewei.nxw@antgroup.com>
---
 net/vmw_vsock/af_vsock.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 2e7a3034e965db30b6ee295370d866e6d8b1c341..bae6b89bb5fb7dd7a3a378f92097561a98a0c814 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1389,6 +1389,28 @@ static int vsock_do_ioctl(struct socket *sock, unsigned int cmd,
 	vsk = vsock_sk(sk);
 
 	switch (cmd) {
+	case SIOCINQ: {
+		ssize_t n_bytes;
+
+		if (!vsk->transport) {
+			ret = -EOPNOTSUPP;
+			break;
+		}
+
+		if (sock_type_connectible(sk->sk_type) &&
+		    sk->sk_state == TCP_LISTEN) {
+			ret = -EINVAL;
+			break;
+		}
+
+		n_bytes = vsock_stream_has_data(vsk);
+		if (n_bytes < 0) {
+			ret = n_bytes;
+			break;
+		}
+		ret = put_user(n_bytes, arg);
+		break;
+	}
 	case SIOCOUTQ: {
 		ssize_t n_bytes;
 

-- 
2.34.1


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

* [PATCH net-next v5 3/4] test/vsock: Add retry mechanism to ioctl wrapper
  2025-07-06  4:36 [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Xuewei Niu
  2025-07-06  4:36 ` [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data() Xuewei Niu
  2025-07-06  4:36 ` [PATCH net-next v5 2/4] vsock: Add support for SIOCINQ ioctl Xuewei Niu
@ 2025-07-06  4:36 ` Xuewei Niu
  2025-07-06  4:36 ` [PATCH net-next v5 4/4] test/vsock: Add ioctl SIOCINQ tests Xuewei Niu
  2025-07-07 13:44 ` [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Stefano Garzarella
  4 siblings, 0 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-06  4:36 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Stefano Garzarella, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: linux-hyperv, virtualization, netdev, linux-kernel, Xuewei Niu,
	fupan.lfp

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 <niuxuewei.nxw@antgroup.com>
---
 tools/testing/vsock/util.c | 30 +++++++++++++++++++++---------
 tools/testing/vsock/util.h |  1 +
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/tools/testing/vsock/util.c b/tools/testing/vsock/util.c
index 803f1e075b62228c25f9dffa1eff131b8072a06a..1e65c5abd85b8bcf5886272de15437d7be13eb89 100644
--- a/tools/testing/vsock/util.c
+++ b/tools/testing/vsock/util.c
@@ -17,6 +17,7 @@
 #include <unistd.h>
 #include <assert.h>
 #include <sys/epoll.h>
+#include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <linux/sockios.h>
 
@@ -101,28 +102,39 @@ void vsock_wait_remote_close(int fd)
 	close(epollfd);
 }
 
-/* Wait until transport reports no data left to be sent.
- * Return false if transport does not implement the unsent_bytes() callback.
+/* Wait until ioctl gives an expected int value.
+ * Return false if the op is not supported.
  */
-bool vsock_wait_sent(int fd)
+bool vsock_ioctl_int(int fd, unsigned long op, int expected)
 {
-	int ret, sock_bytes_unsent;
+	int actual, ret;
+	char name[32];
+
+	snprintf(name, sizeof(name), "ioctl(%lu)", op);
 
 	timeout_begin(TIMEOUT);
 	do {
-		ret = ioctl(fd, SIOCOUTQ, &sock_bytes_unsent);
+		ret = ioctl(fd, op, &actual);
 		if (ret < 0) {
 			if (errno == EOPNOTSUPP)
 				break;
 
-			perror("ioctl(SIOCOUTQ)");
+			perror(name);
 			exit(EXIT_FAILURE);
 		}
-		timeout_check("SIOCOUTQ");
-	} while (sock_bytes_unsent != 0);
+		timeout_check(name);
+	} while (actual != expected);
 	timeout_end();
 
-	return !ret;
+	return ret >= 0;
+}
+
+/* Wait until transport reports no data left to be sent.
+ * Return false if transport does not implement the unsent_bytes() callback.
+ */
+bool vsock_wait_sent(int fd)
+{
+	return vsock_ioctl_int(fd, SIOCOUTQ, 0);
 }
 
 /* Create socket <type>, bind to <cid, port>.
diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h
index fdd4649fe2d49f57c93c4aa5dfbb37b710c65918..142c02a6834acb7117aca485b661332b73754b63 100644
--- a/tools/testing/vsock/util.h
+++ b/tools/testing/vsock/util.h
@@ -87,6 +87,7 @@ int vsock_stream_listen(unsigned int cid, unsigned int port);
 int vsock_seqpacket_accept(unsigned int cid, unsigned int port,
 			   struct sockaddr_vm *clientaddrp);
 void vsock_wait_remote_close(int fd);
+bool vsock_ioctl_int(int fd, unsigned long op, int expected);
 bool vsock_wait_sent(int fd);
 void send_buf(int fd, const void *buf, size_t len, int flags,
 	      ssize_t expected_ret);

-- 
2.34.1


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

* [PATCH net-next v5 4/4] test/vsock: Add ioctl SIOCINQ tests
  2025-07-06  4:36 [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Xuewei Niu
                   ` (2 preceding siblings ...)
  2025-07-06  4:36 ` [PATCH net-next v5 3/4] test/vsock: Add retry mechanism to ioctl wrapper Xuewei Niu
@ 2025-07-06  4:36 ` Xuewei Niu
  2025-07-07 13:44 ` [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Stefano Garzarella
  4 siblings, 0 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-06  4:36 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Stefano Garzarella, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman
  Cc: linux-hyperv, virtualization, netdev, linux-kernel, Xuewei Niu,
	fupan.lfp

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 <niuxuewei.nxw@antgroup.com>
---
 tools/testing/vsock/vsock_test.c | 79 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c
index be6ce764f69480c0f9c3e2288fc19cd2e74be148..a66d2360133dd0e36940a5907679aeacc8af7714 100644
--- a/tools/testing/vsock/vsock_test.c
+++ b/tools/testing/vsock/vsock_test.c
@@ -24,6 +24,7 @@
 #include <linux/time64.h>
 #include <pthread.h>
 #include <fcntl.h>
+#include <linux/sockios.h>
 
 #include "vsock_test_zerocopy.h"
 #include "timeout.h"
@@ -1307,6 +1308,54 @@ static void test_unsent_bytes_client(const struct test_opts *opts, int type)
 	close(fd);
 }
 
+static void test_unread_bytes_server(const struct test_opts *opts, int type)
+{
+	unsigned char buf[MSG_BUF_IOCTL_LEN];
+	int client_fd;
+
+	client_fd = vsock_accept(VMADDR_CID_ANY, opts->peer_port, NULL, type);
+	if (client_fd < 0) {
+		perror("accept");
+		exit(EXIT_FAILURE);
+	}
+
+	for (int i = 0; i < sizeof(buf); i++)
+		buf[i] = rand() & 0xFF;
+
+	send_buf(client_fd, buf, sizeof(buf), 0, sizeof(buf));
+	control_writeln("SENT");
+
+	close(client_fd);
+}
+
+static void test_unread_bytes_client(const struct test_opts *opts, int type)
+{
+	unsigned char buf[MSG_BUF_IOCTL_LEN];
+	int fd;
+
+	fd = vsock_connect(opts->peer_cid, opts->peer_port, type);
+	if (fd < 0) {
+		perror("connect");
+		exit(EXIT_FAILURE);
+	}
+
+	control_expectln("SENT");
+	/* The data has arrived but has not been read. The expected is
+	 * MSG_BUF_IOCTL_LEN.
+	 */
+	if (!vsock_ioctl_int(fd, SIOCINQ, MSG_BUF_IOCTL_LEN)) {
+		fprintf(stderr, "Test skipped, SIOCINQ not supported.\n");
+		goto out;
+	}
+
+	recv_buf(fd, buf, sizeof(buf), 0, sizeof(buf));
+	/* All data has been consumed, so the expected is 0. */
+	vsock_ioctl_int(fd, SIOCINQ, 0);
+
+out:
+	close(fd);
+}
+
 static void test_stream_unsent_bytes_client(const struct test_opts *opts)
 {
 	test_unsent_bytes_client(opts, SOCK_STREAM);
@@ -1327,6 +1376,26 @@ static void test_seqpacket_unsent_bytes_server(const struct test_opts *opts)
 	test_unsent_bytes_server(opts, SOCK_SEQPACKET);
 }
 
+static void test_stream_unread_bytes_client(const struct test_opts *opts)
+{
+	test_unread_bytes_client(opts, SOCK_STREAM);
+}
+
+static void test_stream_unread_bytes_server(const struct test_opts *opts)
+{
+	test_unread_bytes_server(opts, SOCK_STREAM);
+}
+
+static void test_seqpacket_unread_bytes_client(const struct test_opts *opts)
+{
+	test_unread_bytes_client(opts, SOCK_SEQPACKET);
+}
+
+static void test_seqpacket_unread_bytes_server(const struct test_opts *opts)
+{
+	test_unread_bytes_server(opts, SOCK_SEQPACKET);
+}
+
 #define RCVLOWAT_CREDIT_UPD_BUF_SIZE	(1024 * 128)
 /* This define is the same as in 'include/linux/virtio_vsock.h':
  * it is used to decide when to send credit update message during
@@ -2276,6 +2345,16 @@ static struct test_case test_cases[] = {
 		.run_client = test_stream_transport_change_client,
 		.run_server = test_stream_transport_change_server,
 	},
+	{
+		.name = "SOCK_STREAM ioctl(SIOCINQ) functionality",
+		.run_client = test_stream_unread_bytes_client,
+		.run_server = test_stream_unread_bytes_server,
+	},
+	{
+		.name = "SOCK_SEQPACKET ioctl(SIOCINQ) functionality",
+		.run_client = test_seqpacket_unread_bytes_client,
+		.run_server = test_seqpacket_unread_bytes_server,
+	},
 	{},
 };
 

-- 
2.34.1


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

* Re: [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data()
  2025-07-06  4:36 ` [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data() Xuewei Niu
@ 2025-07-07 13:40   ` Stefano Garzarella
  2025-07-08  5:05     ` Xuewei Niu
  2025-07-07 13:42   ` Stefano Garzarella
  1 sibling, 1 reply; 11+ messages in thread
From: Stefano Garzarella @ 2025-07-07 13:40 UTC (permalink / raw)
  To: Xuewei Niu
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-hyperv, virtualization, netdev, linux-kernel,
	Xuewei Niu, fupan.lfp

On Sun, Jul 06, 2025 at 12:36:29PM +0800, Xuewei Niu wrote:

Again, this patch should have `From: Dexuan Cui <decui@microsoft.com>` 
on first line, and this is done automatically by `git format-patch` (or 
others tools) if the author is the right one in your branch.
I'm not sure what is going on on your side, but you should avoid to 
reset the original author.
Applying this patch we will have:

     commit ed36075e04ecbb1dd02a3d8eba5bfac6469d73e4
     Author: Xuewei Niu <niuxuewei97@gmail.com>
     Date:   Sun Jul 6 12:36:29 2025 +0800

         hv_sock: Return the readable bytes in hvs_stream_has_data()

This is not what we want, right?

>When hv_sock was originally added, __vsock_stream_recvmsg() and
>vsock_stream_has_data() actually only needed to know whether there
>is any readable data or not, so hvs_stream_has_data() was written to
>return 1 or 0 for simplicity.
>
>However, now hvs_stream_has_data() should return the readable bytes
>because vsock_data_ready() -> vsock_stream_has_data() needs to know the
>actual bytes rather than a boolean value of 1 or 0.
>
>The SIOCINQ ioctl support also needs hvs_stream_has_data() to return
>the readable bytes.
>
>Let hvs_stream_has_data() return the readable bytes of the payload in
>the next host-to-guest VMBus hv_sock packet.
>
>Note: there may be multpile incoming hv_sock packets pending in the
>VMBus channel's ringbuffer, but so far there is not a VMBus API that
>allows us to know all the readable bytes in total without reading and
>caching the payload of the multiple packets, so let's just return the
>readable bytes of the next single packet. In the future, we'll either
>add a VMBus API that allows us to know the total readable bytes without
>touching the data in the ringbuffer, or the hv_sock driver needs to
>understand the VMBus packet format and parse the packets directly.
>
>Signed-off-by: Dexuan Cui <decui@microsoft.com>

Your S-o-b was fine here, I was talking about the author.

Thanks,
Stefano

>---
> net/vmw_vsock/hyperv_transport.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
>diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
>index 31342ab502b4fc35feb812d2c94e0e35ded73771..432fcbbd14d4f44bd2550be8376e42ce65122758 100644
>--- a/net/vmw_vsock/hyperv_transport.c
>+++ b/net/vmw_vsock/hyperv_transport.c
>@@ -694,15 +694,26 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg,
> static s64 hvs_stream_has_data(struct vsock_sock *vsk)
> {
> 	struct hvsock *hvs = vsk->trans;
>+	bool need_refill;
> 	s64 ret;
>
> 	if (hvs->recv_data_len > 0)
>-		return 1;
>+		return hvs->recv_data_len;
>
> 	switch (hvs_channel_readable_payload(hvs->chan)) {
> 	case 1:
>-		ret = 1;
>-		break;
>+		need_refill = !hvs->recv_desc;
>+		if (!need_refill)
>+			return -EIO;
>+
>+		hvs->recv_desc = hv_pkt_iter_first(hvs->chan);
>+		if (!hvs->recv_desc)
>+			return -ENOBUFS;
>+
>+		ret = hvs_update_recv_data(hvs);
>+		if (ret)
>+			return ret;
>+		return hvs->recv_data_len;
> 	case 0:
> 		vsk->peer_shutdown |= SEND_SHUTDOWN;
> 		ret = 0;
>
>-- 
>2.34.1
>


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

* Re: [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data()
  2025-07-06  4:36 ` [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data() Xuewei Niu
  2025-07-07 13:40   ` Stefano Garzarella
@ 2025-07-07 13:42   ` Stefano Garzarella
  2025-07-08  5:17     ` Xuewei Niu
  1 sibling, 1 reply; 11+ messages in thread
From: Stefano Garzarella @ 2025-07-07 13:42 UTC (permalink / raw)
  To: Xuewei Niu
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-hyperv, virtualization, netdev, linux-kernel,
	Xuewei Niu, fupan.lfp

On Sun, Jul 06, 2025 at 12:36:29PM +0800, Xuewei Niu wrote:
>When hv_sock was originally added, __vsock_stream_recvmsg() and
>vsock_stream_has_data() actually only needed to know whether there
>is any readable data or not, so hvs_stream_has_data() was written to
>return 1 or 0 for simplicity.
>
>However, now hvs_stream_has_data() should return the readable bytes
>because vsock_data_ready() -> vsock_stream_has_data() needs to know the
>actual bytes rather than a boolean value of 1 or 0.
>
>The SIOCINQ ioctl support also needs hvs_stream_has_data() to return
>the readable bytes.
>
>Let hvs_stream_has_data() return the readable bytes of the payload in
>the next host-to-guest VMBus hv_sock packet.
>
>Note: there may be multpile incoming hv_sock packets pending in the

s/multpile/multiple

>VMBus channel's ringbuffer, but so far there is not a VMBus API that
>allows us to know all the readable bytes in total without reading and
>caching the payload of the multiple packets, so let's just return the
>readable bytes of the next single packet. In the future, we'll either
>add a VMBus API that allows us to know the total readable bytes without
>touching the data in the ringbuffer, or the hv_sock driver needs to
>understand the VMBus packet format and parse the packets directly.
>
>Signed-off-by: Dexuan Cui <decui@microsoft.com>
>---
> net/vmw_vsock/hyperv_transport.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
>diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
>index 31342ab502b4fc35feb812d2c94e0e35ded73771..432fcbbd14d4f44bd2550be8376e42ce65122758 100644
>--- a/net/vmw_vsock/hyperv_transport.c
>+++ b/net/vmw_vsock/hyperv_transport.c
>@@ -694,15 +694,26 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg,
> static s64 hvs_stream_has_data(struct vsock_sock *vsk)
> {
> 	struct hvsock *hvs = vsk->trans;
>+	bool need_refill;
> 	s64 ret;
>
> 	if (hvs->recv_data_len > 0)
>-		return 1;
>+		return hvs->recv_data_len;
>
> 	switch (hvs_channel_readable_payload(hvs->chan)) {
> 	case 1:
>-		ret = 1;
>-		break;
>+		need_refill = !hvs->recv_desc;
>+		if (!need_refill)
>+			return -EIO;
>+
>+		hvs->recv_desc = hv_pkt_iter_first(hvs->chan);
>+		if (!hvs->recv_desc)
>+			return -ENOBUFS;
>+
>+		ret = hvs_update_recv_data(hvs);
>+		if (ret)
>+			return ret;
>+		return hvs->recv_data_len;
> 	case 0:
> 		vsk->peer_shutdown |= SEND_SHUTDOWN;
> 		ret = 0;
>
>-- 
>2.34.1
>


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

* Re: [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support
  2025-07-06  4:36 [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Xuewei Niu
                   ` (3 preceding siblings ...)
  2025-07-06  4:36 ` [PATCH net-next v5 4/4] test/vsock: Add ioctl SIOCINQ tests Xuewei Niu
@ 2025-07-07 13:44 ` Stefano Garzarella
  2025-07-08  5:23   ` Xuewei Niu
  4 siblings, 1 reply; 11+ messages in thread
From: Stefano Garzarella @ 2025-07-07 13:44 UTC (permalink / raw)
  To: Xuewei Niu
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-hyperv, virtualization, netdev, linux-kernel,
	Xuewei Niu, fupan.lfp

On Sun, Jul 06, 2025 at 12:36:28PM +0800, Xuewei Niu wrote:
>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.
>
>Thanks to @dexuan, the second patch is to fix the issue where hyper-v
>`hvs_stream_has_data()` doesn't return the readable bytes.
>
>The third 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
>
>v3->v4:
>https://lore.kernel.org/netdev/20250617045347.1233128-1-niuxuewei.nxw@antgroup.com/
>- Hyper-v `hvs_stream_has_data()` returns the readable bytes
>- Skip testing the null value for `actual` (int pointer)
>- Rename `ioctl_int()` to `vsock_ioctl_int()`
>- Fix a typo and a format issue in comments
>- Remove the `RECEIVED` barrier.
>- The return type of `vsock_ioctl_int()` has been changed to bool
>
>v4->v5:
>https://lore.kernel.org/netdev/20250630075727.210462-1-niuxuewei.nxw@antgroup.com/
>- Put the hyper-v fix before the SIOCINQ ioctl implementation.
>- Remove my SOB from the hyper-v fix patch.

Has I mentioned, that was not the issue, but the wrong Author.

There are also other issue, not sure how you're sending them, but I 
guess there are some issues with you `git format-patch` configuration:

$ ./scripts/checkpatch.pl -g net-next..HEAD --codespell
-----------------------------------------------------------------------------------
Commit ed36075e04ec ("hv_sock: Return the readable bytes in hvs_stream_has_data()")
-----------------------------------------------------------------------------------
WARNING: 'multpile' may be misspelled - perhaps 'multiple'?
#23:
Note: there may be multpile incoming hv_sock packets pending in the
                    ^^^^^^^^

ERROR: Missing Signed-off-by: line by nominal patch author 'Xuewei Niu <niuxuewei97@gmail.com>'

total: 1 errors, 1 warnings, 0 checks, 29 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
       mechanically convert to the typical style using --fix or --fix-inplace.

Commit ed36075e04ec ("hv_sock: Return the readable bytes in hvs_stream_has_data()") has style problems, please review.
------------------------------------------------------------
Commit 4e5c39e373fa ("vsock: Add support for SIOCINQ ioctl")
------------------------------------------------------------
WARNING: From:/Signed-off-by: email address mismatch: 'From: Xuewei Niu <niuxuewei97@gmail.com>' != 'Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>'

total: 0 errors, 1 warnings, 0 checks, 28 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
       mechanically convert to the typical style using --fix or --fix-inplace.

Commit 4e5c39e373fa ("vsock: Add support for SIOCINQ ioctl") has style problems, please review.
------------------------------------------------------------------------
Commit 3eb323b2d9f4 ("test/vsock: Add retry mechanism to ioctl wrapper")
------------------------------------------------------------------------
WARNING: From:/Signed-off-by: email address mismatch: 'From: Xuewei Niu <niuxuewei97@gmail.com>' != 'Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>'

total: 0 errors, 1 warnings, 62 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
       mechanically convert to the typical style using --fix or --fix-inplace.

Commit 3eb323b2d9f4 ("test/vsock: Add retry mechanism to ioctl wrapper") has style problems, please review.

NOTE: If any of the errors are false positives, please report
       them to the maintainer, see CHECKPATCH in MAINTAINERS.

>- Move the `need_refill` initialization into the `case 1` block.
>- Remove the `actual` argument from `vsock_ioctl_int()`.
>- Replace `TIOCINQ` with `SIOCINQ`.
>
>---
>Xuewei Niu (4):
>      hv_sock: Return the readable bytes in hvs_stream_has_data()
>      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 +++++++++++
> net/vmw_vsock/hyperv_transport.c | 17 +++++++--
> tools/testing/vsock/util.c       | 30 ++++++++++-----
> tools/testing/vsock/util.h       |  1 +
> tools/testing/vsock/vsock_test.c | 79 ++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 137 insertions(+), 12 deletions(-)
>---
>base-commit: 5f712c3877f99d5b5e4d011955c6467ae0e535a6
>change-id: 20250703-siocinq-9e2907939806
>
>Best regards,
>-- 
>Xuewei Niu <niuxuewei.nxw@antgroup.com>
>


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

* Re: [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data()
  2025-07-07 13:40   ` Stefano Garzarella
@ 2025-07-08  5:05     ` Xuewei Niu
  0 siblings, 0 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-08  5:05 UTC (permalink / raw)
  To: Stefano Garzarella, Xuewei Niu
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-hyperv, virtualization, netdev, linux-kernel,
	fupan.lfp



On 2025/7/7 21:40, Stefano Garzarella wrote:
> On Sun, Jul 06, 2025 at 12:36:29PM +0800, Xuewei Niu wrote:
> 
> Again, this patch should have `From: Dexuan Cui <decui@microsoft.com>` on first line, and this is done automatically by `git format-patch` (or others tools) if the author is the right one in your branch.
> I'm not sure what is going on on your side, but you should avoid to reset the original author.
> Applying this patch we will have:
> 
>     commit ed36075e04ecbb1dd02a3d8eba5bfac6469d73e4
>     Author: Xuewei Niu <niuxuewei97@gmail.com>
>     Date:   Sun Jul 6 12:36:29 2025 +0800
> 
>         hv_sock: Return the readable bytes in hvs_stream_has_data()
> 
> This is not what we want, right?
> 
>> When hv_sock was originally added, __vsock_stream_recvmsg() and
>> vsock_stream_has_data() actually only needed to know whether there
>> is any readable data or not, so hvs_stream_has_data() was written to
>> return 1 or 0 for simplicity.
>>
>> However, now hvs_stream_has_data() should return the readable bytes
>> because vsock_data_ready() -> vsock_stream_has_data() needs to know the
>> actual bytes rather than a boolean value of 1 or 0.
>>
>> The SIOCINQ ioctl support also needs hvs_stream_has_data() to return
>> the readable bytes.
>>
>> Let hvs_stream_has_data() return the readable bytes of the payload in
>> the next host-to-guest VMBus hv_sock packet.
>>
>> Note: there may be multpile incoming hv_sock packets pending in the
>> VMBus channel's ringbuffer, but so far there is not a VMBus API that
>> allows us to know all the readable bytes in total without reading and
>> caching the payload of the multiple packets, so let's just return the
>> readable bytes of the next single packet. In the future, we'll either
>> add a VMBus API that allows us to know the total readable bytes without
>> touching the data in the ringbuffer, or the hv_sock driver needs to
>> understand the VMBus packet format and parse the packets directly.
>>
>> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> 
> Your S-o-b was fine here, I was talking about the author.

I misunderstood the meaning of author. Sorry about that.

Will update this in v6.

Thanks,
Xuewei 
> Thanks,
> Stefano
> 
>> ---
>> net/vmw_vsock/hyperv_transport.c | 17 ++++++++++++++---
>> 1 file changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
>> index 31342ab502b4fc35feb812d2c94e0e35ded73771..432fcbbd14d4f44bd2550be8376e42ce65122758 100644
>> --- a/net/vmw_vsock/hyperv_transport.c
>> +++ b/net/vmw_vsock/hyperv_transport.c
>> @@ -694,15 +694,26 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg,
>> static s64 hvs_stream_has_data(struct vsock_sock *vsk)
>> {
>>     struct hvsock *hvs = vsk->trans;
>> +    bool need_refill;
>>     s64 ret;
>>
>>     if (hvs->recv_data_len > 0)
>> -        return 1;
>> +        return hvs->recv_data_len;
>>
>>     switch (hvs_channel_readable_payload(hvs->chan)) {
>>     case 1:
>> -        ret = 1;
>> -        break;
>> +        need_refill = !hvs->recv_desc;
>> +        if (!need_refill)
>> +            return -EIO;
>> +
>> +        hvs->recv_desc = hv_pkt_iter_first(hvs->chan);
>> +        if (!hvs->recv_desc)
>> +            return -ENOBUFS;
>> +
>> +        ret = hvs_update_recv_data(hvs);
>> +        if (ret)
>> +            return ret;
>> +        return hvs->recv_data_len;
>>     case 0:
>>         vsk->peer_shutdown |= SEND_SHUTDOWN;
>>         ret = 0;
>>
>> -- 
>> 2.34.1
>>





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

* Re: [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data()
  2025-07-07 13:42   ` Stefano Garzarella
@ 2025-07-08  5:17     ` Xuewei Niu
  0 siblings, 0 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-08  5:17 UTC (permalink / raw)
  To: Stefano Garzarella, Xuewei Niu
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-hyperv, virtualization, netdev, linux-kernel,
	fupan.lfp



On 2025/7/7 21:42, Stefano Garzarella wrote:
> On Sun, Jul 06, 2025 at 12:36:29PM +0800, Xuewei Niu wrote:
>> When hv_sock was originally added, __vsock_stream_recvmsg() and
>> vsock_stream_has_data() actually only needed to know whether there
>> is any readable data or not, so hvs_stream_has_data() was written to
>> return 1 or 0 for simplicity.
>>
>> However, now hvs_stream_has_data() should return the readable bytes
>> because vsock_data_ready() -> vsock_stream_has_data() needs to know the
>> actual bytes rather than a boolean value of 1 or 0.
>>
>> The SIOCINQ ioctl support also needs hvs_stream_has_data() to return
>> the readable bytes.
>>
>> Let hvs_stream_has_data() return the readable bytes of the payload in
>> the next host-to-guest VMBus hv_sock packet.
>>
>> Note: there may be multpile incoming hv_sock packets pending in the
> 
> s/multpile/multiple

Will do.

Thanks,
Xuewei

>> VMBus channel's ringbuffer, but so far there is not a VMBus API that
>> allows us to know all the readable bytes in total without reading and
>> caching the payload of the multiple packets, so let's just return the
>> readable bytes of the next single packet. In the future, we'll either
>> add a VMBus API that allows us to know the total readable bytes without
>> touching the data in the ringbuffer, or the hv_sock driver needs to
>> understand the VMBus packet format and parse the packets directly.
>>
>> Signed-off-by: Dexuan Cui <decui@microsoft.com>
>> ---
>> net/vmw_vsock/hyperv_transport.c | 17 ++++++++++++++---
>> 1 file changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
>> index 31342ab502b4fc35feb812d2c94e0e35ded73771..432fcbbd14d4f44bd2550be8376e42ce65122758 100644
>> --- a/net/vmw_vsock/hyperv_transport.c
>> +++ b/net/vmw_vsock/hyperv_transport.c
>> @@ -694,15 +694,26 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg,
>> static s64 hvs_stream_has_data(struct vsock_sock *vsk)
>> {
>>     struct hvsock *hvs = vsk->trans;
>> +    bool need_refill;
>>     s64 ret;
>>
>>     if (hvs->recv_data_len > 0)
>> -        return 1;
>> +        return hvs->recv_data_len;
>>
>>     switch (hvs_channel_readable_payload(hvs->chan)) {
>>     case 1:
>> -        ret = 1;
>> -        break;
>> +        need_refill = !hvs->recv_desc;
>> +        if (!need_refill)
>> +            return -EIO;
>> +
>> +        hvs->recv_desc = hv_pkt_iter_first(hvs->chan);
>> +        if (!hvs->recv_desc)
>> +            return -ENOBUFS;
>> +
>> +        ret = hvs_update_recv_data(hvs);
>> +        if (ret)
>> +            return ret;
>> +        return hvs->recv_data_len;
>>     case 0:
>>         vsk->peer_shutdown |= SEND_SHUTDOWN;
>>         ret = 0;
>>
>> -- 
>> 2.34.1
>>


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

* Re: [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support
  2025-07-07 13:44 ` [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Stefano Garzarella
@ 2025-07-08  5:23   ` Xuewei Niu
  0 siblings, 0 replies; 11+ messages in thread
From: Xuewei Niu @ 2025-07-08  5:23 UTC (permalink / raw)
  To: Stefano Garzarella, Xuewei Niu
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-hyperv, virtualization, netdev, linux-kernel,
	fupan.lfp



On 2025/7/7 21:44, Stefano Garzarella wrote:
> On Sun, Jul 06, 2025 at 12:36:28PM +0800, Xuewei Niu wrote:
>> 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.
>>
>> Thanks to @dexuan, the second patch is to fix the issue where hyper-v
>> `hvs_stream_has_data()` doesn't return the readable bytes.
>>
>> The third 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
>>
>> v3->v4:
>> https://lore.kernel.org/netdev/20250617045347.1233128-1-niuxuewei.nxw@antgroup.com/
>> - Hyper-v `hvs_stream_has_data()` returns the readable bytes
>> - Skip testing the null value for `actual` (int pointer)
>> - Rename `ioctl_int()` to `vsock_ioctl_int()`
>> - Fix a typo and a format issue in comments
>> - Remove the `RECEIVED` barrier.
>> - The return type of `vsock_ioctl_int()` has been changed to bool
>>
>> v4->v5:
>> https://lore.kernel.org/netdev/20250630075727.210462-1-niuxuewei.nxw@antgroup.com/
>> - Put the hyper-v fix before the SIOCINQ ioctl implementation.
>> - Remove my SOB from the hyper-v fix patch.
> 
> Has I mentioned, that was not the issue, but the wrong Author.

I see it now. I'll update the author in v6. 
> There are also other issue, not sure how you're sending them, but I guess there are some issues with you `git format-patch` configuration:

I was using my personal email. I have changed to the right email now.

Hope everything goes fine with the next version.

Thanks,
Xuewei

> 
> $ ./scripts/checkpatch.pl -g net-next..HEAD --codespell
> -----------------------------------------------------------------------------------
> Commit ed36075e04ec ("hv_sock: Return the readable bytes in hvs_stream_has_data()")
> -----------------------------------------------------------------------------------
> WARNING: 'multpile' may be misspelled - perhaps 'multiple'?
> #23:
> Note: there may be multpile incoming hv_sock packets pending in the
>                    ^^^^^^^^
> 
> ERROR: Missing Signed-off-by: line by nominal patch author 'Xuewei Niu <niuxuewei97@gmail.com>'
> 
> total: 1 errors, 1 warnings, 0 checks, 29 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> Commit ed36075e04ec ("hv_sock: Return the readable bytes in hvs_stream_has_data()") has style problems, please review.
> ------------------------------------------------------------
> Commit 4e5c39e373fa ("vsock: Add support for SIOCINQ ioctl")
> ------------------------------------------------------------
> WARNING: From:/Signed-off-by: email address mismatch: 'From: Xuewei Niu <niuxuewei97@gmail.com>' != 'Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>'
> 
> total: 0 errors, 1 warnings, 0 checks, 28 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> Commit 4e5c39e373fa ("vsock: Add support for SIOCINQ ioctl") has style problems, please review.
> ------------------------------------------------------------------------
> Commit 3eb323b2d9f4 ("test/vsock: Add retry mechanism to ioctl wrapper")
> ------------------------------------------------------------------------
> WARNING: From:/Signed-off-by: email address mismatch: 'From: Xuewei Niu <niuxuewei97@gmail.com>' != 'Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>'
> 
> total: 0 errors, 1 warnings, 62 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> Commit 3eb323b2d9f4 ("test/vsock: Add retry mechanism to ioctl wrapper") has style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>       them to the maintainer, see CHECKPATCH in MAINTAINERS.
> 
>> - Move the `need_refill` initialization into the `case 1` block.
>> - Remove the `actual` argument from `vsock_ioctl_int()`.
>> - Replace `TIOCINQ` with `SIOCINQ`.
>>
>> ---
>> Xuewei Niu (4):
>>      hv_sock: Return the readable bytes in hvs_stream_has_data()
>>      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 +++++++++++
>> net/vmw_vsock/hyperv_transport.c | 17 +++++++--
>> tools/testing/vsock/util.c       | 30 ++++++++++-----
>> tools/testing/vsock/util.h       |  1 +
>> tools/testing/vsock/vsock_test.c | 79 ++++++++++++++++++++++++++++++++++++++++
>> 5 files changed, 137 insertions(+), 12 deletions(-)
>> ---
>> base-commit: 5f712c3877f99d5b5e4d011955c6467ae0e535a6
>> change-id: 20250703-siocinq-9e2907939806
>>
>> Best regards,
>> -- 
>> Xuewei Niu <niuxuewei.nxw@antgroup.com>
>>


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

end of thread, other threads:[~2025-07-08  6:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-06  4:36 [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Xuewei Niu
2025-07-06  4:36 ` [PATCH net-next v5 1/4] hv_sock: Return the readable bytes in hvs_stream_has_data() Xuewei Niu
2025-07-07 13:40   ` Stefano Garzarella
2025-07-08  5:05     ` Xuewei Niu
2025-07-07 13:42   ` Stefano Garzarella
2025-07-08  5:17     ` Xuewei Niu
2025-07-06  4:36 ` [PATCH net-next v5 2/4] vsock: Add support for SIOCINQ ioctl Xuewei Niu
2025-07-06  4:36 ` [PATCH net-next v5 3/4] test/vsock: Add retry mechanism to ioctl wrapper Xuewei Niu
2025-07-06  4:36 ` [PATCH net-next v5 4/4] test/vsock: Add ioctl SIOCINQ tests Xuewei Niu
2025-07-07 13:44 ` [PATCH net-next v5 0/4] vsock: Introduce SIOCINQ ioctl support Stefano Garzarella
2025-07-08  5:23   ` 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).