From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH liburing 2/4] test/sendzc: test registered vectored buffers
Date: Fri, 7 Mar 2025 16:22:44 +0000 [thread overview]
Message-ID: <d56231867c95e9f9cc54981db6b636a70047571d.1741364284.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
---
test/send-zerocopy.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/test/send-zerocopy.c b/test/send-zerocopy.c
index c8eafe28..680481a0 100644
--- a/test/send-zerocopy.c
+++ b/test/send-zerocopy.c
@@ -69,6 +69,7 @@ static size_t page_sz;
static char *tx_buffer, *rx_buffer;
static struct iovec buffers_iov[__BUF_NR];
+static bool has_regvec;
static bool has_sendzc;
static bool has_sendmsg;
static bool hit_enomem;
@@ -96,6 +97,7 @@ static int probe_zc_support(void)
has_sendzc = p->ops_len > IORING_OP_SEND_ZC;
has_sendmsg = p->ops_len > IORING_OP_SENDMSG_ZC;
+ has_regvec = p->ops_len > IORING_OP_READV_FIXED;
io_uring_queue_exit(&ring);
free(p);
return 0;
@@ -448,6 +450,11 @@ static int do_test_inet_send(struct io_uring *ring, int sock_client, int sock_se
else
io_uring_prep_sendmsg(sqe, sock_client, &msghdr[i], msg_flags);
+ if (real_fixed_buf) {
+ sqe->ioprio |= IORING_RECVSEND_FIXED_BUF;
+ sqe->buf_index = conf->buf_index;
+ }
+
if (!conf->iovec) {
io = &iov[i];
iov_len = 1;
@@ -619,7 +626,11 @@ static int test_inet_send(struct io_uring *ring)
conf.tcp = tcp;
regbuf = conf.mix_register || conf.fixed_buf;
- if (conf.iovec && (!conf.use_sendmsg || regbuf || conf.cork))
+ if (!tcp && conf.long_iovec)
+ continue;
+ if (conf.use_sendmsg && regbuf && !has_regvec)
+ continue;
+ if (conf.iovec && (!conf.use_sendmsg || conf.cork))
continue;
if (!conf.zc) {
if (regbuf)
@@ -637,7 +648,7 @@ static int test_inet_send(struct io_uring *ring)
continue;
if (!client_connect && conf.addr == NULL)
continue;
- if (conf.use_sendmsg && (regbuf || !has_sendmsg))
+ if (conf.use_sendmsg && !has_sendmsg)
continue;
if (msg_zc_set && !conf.zc)
continue;
--
2.48.1
next prev parent reply other threads:[~2025-03-07 16:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 16:22 [PATCH liburing 0/4] vectored registered buffer support and tests Pavel Begunkov
2025-03-07 16:22 ` [PATCH liburing 1/4] Add vectored registered buffer req init helpers Pavel Begunkov
2025-03-07 17:10 ` Caleb Sander Mateos
2025-03-07 17:26 ` Pavel Begunkov
2025-03-07 18:06 ` Jens Axboe
2025-03-07 16:22 ` Pavel Begunkov [this message]
2025-03-07 16:22 ` [PATCH liburing 3/4] tests/helpers: add t_create_socketpair_ip Pavel Begunkov
2025-03-07 16:22 ` [PATCH liburing 4/4] tests: targeted registered vector tests Pavel Begunkov
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=d56231867c95e9f9cc54981db6b636a70047571d.1741364284.git.asml.silence@gmail.com \
[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