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 3/4] test: test iowq zc sends
Date: Fri,  2 Sep 2022 12:12:38 +0100	[thread overview]
Message-ID: <8562fc9c8860b0e6b92d20e4f773ce3bde7d9137.1662116617.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Add tests exercising io-wq paths with zc by setting IOSQE_ASYNC.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 test/send-zerocopy.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c
index 7b58ae7..8714b6f 100644
--- a/test/send-zerocopy.c
+++ b/test/send-zerocopy.c
@@ -239,7 +239,7 @@ static int prepare_ip(struct sockaddr_storage *addr, int *sock_client, int *sock
 static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_server,
 			     bool fixed_buf, struct sockaddr_storage *addr,
 			     size_t send_size, bool cork, bool mix_register,
-			     int buf_idx)
+			     int buf_idx, bool force_async)
 {
 	const unsigned zc_flags = 0;
 	struct io_uring_sqe *sqe;
@@ -285,6 +285,8 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se
 			io_uring_prep_send_set_addr(sqe, (const struct sockaddr *)addr,
 						    addr_len);
 		}
+		if (force_async)
+			sqe->flags |= IOSQE_ASYNC;
 	}
 
 	ret = io_uring_submit(ring);
@@ -389,7 +391,7 @@ static int test_inet_send(struct io_uring *ring)
 			return 1;
 		}
 
-		for (i = 0; i < 128; i++) {
+		for (i = 0; i < 256; i++) {
 			bool fixed_buf = i & 1;
 			struct sockaddr_storage *addr_arg = (i & 2) ? &addr : NULL;
 			size_t size = (i & 4) ? 137 : 4096;
@@ -398,6 +400,7 @@ static int test_inet_send(struct io_uring *ring)
 			bool aligned = i & 32;
 			bool large_buf = i & 64;
 			int buf_idx = aligned ? 0 : 1;
+			bool force_async = i & 128;
 
 			if (!tcp || !large_buf)
 				continue;
@@ -418,7 +421,7 @@ static int test_inet_send(struct io_uring *ring)
 
 			ret = do_test_inet_send(ring, sock_client, sock_server, fixed_buf,
 						addr_arg, size, cork, mix_register,
-						buf_idx);
+						buf_idx, force_async);
 			if (ret) {
 				fprintf(stderr, "send failed fixed buf %i, conn %i, addr %i, "
 					"cork %i\n",
-- 
2.37.2


  parent reply	other threads:[~2022-09-02 11:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 11:12 [PATCH liburing 0/4] zerocopy send API changes Pavel Begunkov
2022-09-02 11:12 ` [PATCH liburing 1/4] tests: verify that send addr is copied when async Pavel Begunkov
2022-09-02 11:12 ` [PATCH liburing 2/4] zc: adjust sendzc to the simpler uapi Pavel Begunkov
2022-09-02 11:12 ` Pavel Begunkov [this message]
2022-09-02 11:12 ` [PATCH liburing 4/4] examples: adjust zc bench to the new uapi Pavel Begunkov
2022-09-02 11:56 ` [PATCH liburing 0/4] zerocopy send API changes Ammar Faizi
2022-09-02 12:01   ` Ammar Faizi
2022-09-02 12:03     ` Jens Axboe
2022-09-02 12:07       ` Pavel Begunkov
2022-09-02 12:11         ` Jens Axboe
2022-09-02 11:57 ` 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=8562fc9c8860b0e6b92d20e4f773ce3bde7d9137.1662116617.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