public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] vsock/test: add recv_buf()/send_buf() utility functions and some improvements
@ 2023-09-15 12:14 Stefano Garzarella
  2023-09-15 12:14 ` [PATCH net-next 1/5] vsock/test: add recv_buf() utility function Stefano Garzarella
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Stefano Garzarella @ 2023-09-15 12:14 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Stefano Garzarella, Arseniy Krasnov, virtualization,
	oxffffaa, Bobby Eshleman

We recently found that some tests were failing [1].

The problem was that we were not waiting for all the bytes correctly,
so we had a partial read. I had initially suggested using MSG_WAITALL,
but this could have timeout problems.

Since we already had send_byte() and recv_byte() that handled the timeout,
but also the expected return value, I moved that code to two new functions
that we can now use to send/receive generic buffers.

The last commit is just an improvement to a test I found difficult to
understand while using the new functions.

@Arseniy a review and some testing are really appreciated :-)

[1] https://lore.kernel.org/netdev/63xflnwiohdfo6m3vnrrxgv2ulplencpwug5qqacugqh7xxpu3@tsczkuqgwurb/

Stefano Garzarella (5):
  vsock/test: add recv_buf() utility function
  vsock/test: use recv_buf() in vsock_test.c
  vsock/test: add send_buf() utility function
  vsock/test: use send_buf() in vsock_test.c
  vsock/test: track bytes in MSG_PEEK test for SOCK_SEQPACKET

 tools/testing/vsock/util.h       |   3 +
 tools/testing/vsock/util.c       | 124 ++++++++++++--------
 tools/testing/vsock/vsock_test.c | 187 ++++++-------------------------
 3 files changed, 117 insertions(+), 197 deletions(-)

-- 
2.41.0


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

end of thread, other threads:[~2023-09-17 16:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-15 12:14 [PATCH net-next 0/5] vsock/test: add recv_buf()/send_buf() utility functions and some improvements Stefano Garzarella
2023-09-15 12:14 ` [PATCH net-next 1/5] vsock/test: add recv_buf() utility function Stefano Garzarella
2023-09-15 19:23   ` Arseniy Krasnov
2023-09-15 12:14 ` [PATCH net-next 2/5] vsock/test: use recv_buf() in vsock_test.c Stefano Garzarella
2023-09-15 19:24   ` Arseniy Krasnov
2023-09-15 12:14 ` [PATCH net-next 3/5] vsock/test: add send_buf() utility function Stefano Garzarella
2023-09-15 19:25   ` Arseniy Krasnov
2023-09-15 12:14 ` [PATCH net-next 4/5] vsock/test: use send_buf() in vsock_test.c Stefano Garzarella
2023-09-15 19:26   ` Arseniy Krasnov
2023-09-15 12:14 ` [PATCH net-next 5/5] vsock/test: track bytes in MSG_PEEK test for SOCK_SEQPACKET Stefano Garzarella
2023-09-15 19:29   ` Arseniy Krasnov
2023-09-15 19:30 ` [PATCH net-next 0/5] vsock/test: add recv_buf()/send_buf() utility functions and some improvements Arseniy Krasnov
2023-09-17 16:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox