From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring <io-uring@vger.kernel.org>
Subject: Re: [PATCH liburing 1/6] tests: test the query interface
Date: Fri, 19 Sep 2025 15:11:26 +0100 [thread overview]
Message-ID: <8fe7837b-e12d-47d6-93ac-3580b6ac1127@gmail.com> (raw)
In-Reply-To: <71ff0fec25ae279ba6bdc1ce81e3ad86995340f1.1757589613.git.asml.silence@gmail.com>
On 9/11/25 12:26, Pavel Begunkov wrote:
> Add the header / definitions and tests for the query interface.
...> +static int test_chain_loop(void)
> +{
> + int ret;
> + struct io_uring_query_opcode op1, op2;
> + struct io_uring_query_hdr hdr2 = {
> + .query_op = IO_URING_QUERY_OPCODES,
> + .query_data = uring_ptr_to_u64(&op2),
> + .size = sizeof(struct io_uring_query_opcode),
> + };
> + struct io_uring_query_hdr hdr1 = {
> + .query_op = IO_URING_QUERY_OPCODES,
> + .query_data = uring_ptr_to_u64(&op1),
> + .size = sizeof(struct io_uring_query_opcode),
> + };
> + struct io_uring_query_hdr hdr_self_circular = {
> + .query_op = IO_URING_QUERY_OPCODES,
> + .query_data = uring_ptr_to_u64(&op1),
> + .size = sizeof(struct io_uring_query_opcode),
> + .next_entry = uring_ptr_to_u64(&hdr_self_circular),
> + };
> +
> + hdr1.next_entry = uring_ptr_to_u64(&hdr2);
> + hdr2.next_entry = uring_ptr_to_u64(&hdr1);
> + ret = io_uring_query(NULL, &hdr1);
> + if (!ret) {
> + fprintf(stderr, "chain loop failed %i\n", ret);
> + return T_EXIT_FAIL;
> + }
> +
> + ret = io_uring_query(NULL, &hdr_self_circular);
> + if (!ret) {
> + fprintf(stderr, "chain loop failed %i\n", ret);
> + return T_EXIT_FAIL;
> + }
> +
> + return T_EXIT_PASS;
> +}
It might be a good idea not to test the capping and add
a "cycle + SIGKILL" test instead. I'll do that later
--
Pavel Begunkov
next prev parent reply other threads:[~2025-09-19 14:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 11:26 [PATCH liburing 0/6] Add query and mock tests Pavel Begunkov
2025-09-11 11:26 ` [PATCH liburing 1/6] tests: test the query interface Pavel Begunkov
2025-09-19 14:11 ` Pavel Begunkov [this message]
2025-09-11 11:26 ` [PATCH liburing 2/6] tests: add t_submit_and_wait_single helper Pavel Begunkov
2025-09-11 11:26 ` [PATCH liburing 3/6] tests: introduce t_iovec_data_length helper Pavel Begunkov
2025-09-11 11:26 ` [PATCH liburing 4/6] tests: add t_sqe_prep_cmd helper Pavel Begunkov
2025-09-11 11:26 ` [PATCH liburing 5/6] tests: add helper for iov data verification Pavel Begunkov
2025-09-11 11:26 ` [PATCH liburing 6/6] tests: add mock file based tests Pavel Begunkov
2025-09-19 13:15 ` [PATCH liburing 0/6] Add query and mock tests Jens Axboe
2025-09-19 16:56 ` Jens Axboe
2025-09-22 7:55 ` Pavel Begunkov
2025-09-22 12:00 ` 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=8fe7837b-e12d-47d6-93ac-3580b6ac1127@gmail.com \
--to=asml.silence@gmail.com \
--cc=io-uring@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).