diff mbox series

[liburing,v2,3/5] tests/zc: fix udp testing

Message ID f85ddc0dd0712ce17a5e7f73639c55d9c612cedf.1662404421.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series zc tests improvements | expand

Commit Message

Pavel Begunkov Sept. 5, 2022, 10:06 p.m. UTC
The tcp vs large_buf skip condition is not what we want and it skips udp
testing, fix it and also make sure we serialise cork requests with
IOSQE_IO_LINK as they might get executed OOO.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/send-zerocopy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c
index f80a5cd..bfe4cf7 100644
--- a/test/send-zerocopy.c
+++ b/test/send-zerocopy.c
@@ -285,6 +285,8 @@  static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se
 		}
 		if (force_async)
 			sqe->flags |= IOSQE_ASYNC;
+		if (cork && i != nr_reqs - 1)
+			sqe->flags |= IOSQE_IO_LINK;
 	}
 
 	sqe = io_uring_get_sqe(ring);
@@ -380,11 +382,9 @@  static int test_inet_send(struct io_uring *ring)
 			int buf_idx = aligned ? 0 : 1;
 			bool force_async = i & 128;
 
-			if (!tcp || !large_buf)
-				continue;
 			if (large_buf) {
 				buf_idx = 2;
-				if (!aligned || !tcp || small_send)
+				if (!aligned || !tcp || small_send || cork)
 					continue;
 			}
 			if (!buffers_iov[buf_idx].iov_base)