All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH liburing-next 1/1] tests: test both TCP ends in send zc tests
@ 2022-10-26 23:13 Pavel Begunkov
  2022-10-27 13:13 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2022-10-26 23:13 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, asml.silence

Test sending data from both ends of a TCP connection to tests any
modifications need for zc in the accept path.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/send-zerocopy.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c
index a061d49..5030d63 100644
--- a/test/send-zerocopy.c
+++ b/test/send-zerocopy.c
@@ -445,14 +445,17 @@ static int test_inet_send(struct io_uring *ring)
 	int sock_client = -1, sock_server = -1;
 	int ret, j, i;
 
-	for (j = 0; j < 16; j++) {
+	for (j = 0; j < 32; j++) {
 		bool ipv6 = j & 1;
 		bool client_connect = j & 2;
 		bool msg_zc_set = j & 4;
 		bool tcp = j & 8;
+		bool swap_sockets = j & 16;
 
 		if (tcp && !client_connect)
 			continue;
+		if (swap_sockets && !tcp)
+			continue;
 
 		ret = prepare_ip(&addr, &sock_client, &sock_server, ipv6,
 				 client_connect, msg_zc_set, tcp);
@@ -460,6 +463,12 @@ static int test_inet_send(struct io_uring *ring)
 			fprintf(stderr, "sock prep failed %d\n", ret);
 			return 1;
 		}
+		if (swap_sockets) {
+			int tmp_sock = sock_client;
+
+			sock_client = sock_server;
+			sock_server = tmp_sock;
+		}
 
 		for (i = 0; i < 4096; i++) {
 			bool regbuf;
-- 
2.38.0


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

* Re: [PATCH liburing-next 1/1] tests: test both TCP ends in send zc tests
  2022-10-26 23:13 [PATCH liburing-next 1/1] tests: test both TCP ends in send zc tests Pavel Begunkov
@ 2022-10-27 13:13 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-10-27 13:13 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On Thu, 27 Oct 2022 00:13:00 +0100, Pavel Begunkov wrote:
> Test sending data from both ends of a TCP connection to tests any
> modifications need for zc in the accept path.
> 
> 

Applied, thanks!

[1/1] tests: test both TCP ends in send zc tests
      commit: b6b86534b01e7b7b48039d7adbe8594df502e7cf

Best regards,
-- 
Jens Axboe



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

end of thread, other threads:[~2022-10-27 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 23:13 [PATCH liburing-next 1/1] tests: test both TCP ends in send zc tests Pavel Begunkov
2022-10-27 13:13 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.