summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-10-27 00:13:00 +0100
committerJens Axboe <axboe@kernel.dk>2022-10-27 07:13:33 -0600
commitb6b86534b01e7b7b48039d7adbe8594df502e7cf (patch)
tree3b7cf9cfc442faff1a3c01bcf7d4622790d65b14
parent8f9c93036dae1fdee6516f58e95e632b68daf0e1 (diff)
downloadliburing-next.tar.gz
liburing-next.tar.bz2
tests: test both TCP ends in send zc testsnext
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> Link: https://lore.kernel.org/r/83dce097a9930b47788cc5c14a9f19b0f901146e.1666807018.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/send-zerocopy.c11
1 files changed, 10 insertions, 1 deletions
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;