public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH liburing-next 1/1] tests: test both TCP ends in send zc tests
Date: Thu, 27 Oct 2022 00:13:00 +0100	[thread overview]
Message-ID: <83dce097a9930b47788cc5c14a9f19b0f901146e.1666807018.git.asml.silence@gmail.com> (raw)

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 <[email protected]>
---
 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


             reply	other threads:[~2022-10-26 23:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 23:13 Pavel Begunkov [this message]
2022-10-27 13:13 ` [PATCH liburing-next 1/1] tests: test both TCP ends in send zc tests Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83dce097a9930b47788cc5c14a9f19b0f901146e.1666807018.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox