From: Pavel Begunkov <asml.silence@gmail.com>
To: David Wei <dw@davidwei.uk>, io-uring@vger.kernel.org
Subject: Re: [PATCH liburing 3/3] examples/zcrx: add refill queue allocation modes
Date: Mon, 21 Apr 2025 07:38:57 +0100 [thread overview]
Message-ID: <04698484-e452-4e10-aaef-0ccda2378261@gmail.com> (raw)
In-Reply-To: <7a941493-9924-4086-acaa-55cd428d25a2@davidwei.uk>
On 4/21/25 01:28, David Wei wrote:
> On 2025-04-20 04:24, Pavel Begunkov wrote:
>> Refill queue creating is backed by the region api, which can either be
>> user or kernel allocated. Add an option to switch between the modes.
>>
>> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
>> ---
>> examples/zcrx.c | 46 ++++++++++++++++++++++++++++++++++++----------
>> 1 file changed, 36 insertions(+), 10 deletions(-)
>>
>> diff --git a/examples/zcrx.c b/examples/zcrx.c
>> index 8989c9a4..eafe1969 100644
>> --- a/examples/zcrx.c
>> +++ b/examples/zcrx.c
>> @@ -39,6 +39,13 @@
> [...]
>> @@ -128,6 +140,15 @@ static void setup_zcrx(struct io_uring *ring)
>> if (ret)
>> t_error(1, 0, "io_uring_register_ifq(): %d", ret);
>>
>> + if (cfg_rq_alloc_mode == RQ_ALLOC_USER) {
>
> cfg_rq_alloc_mode == RQ_ALLOC_KERNEL?
Good catch! I found it during testing but apparently forgot to
commit.
>
>> + ring_ptr = mmap(NULL, ring_size,
>> + PROT_READ | PROT_WRITE,
>> + MAP_SHARED | MAP_POPULATE,
>> + ring->ring_fd, region_reg.mmap_offset);
>> + if (ring_ptr == MAP_FAILED)
>> + t_error(1, 0, "mmap(): refill ring");
>> + }
>> +
>> rq_ring.khead = (unsigned int *)((char *)ring_ptr + reg.offsets.head);
>> rq_ring.ktail = (unsigned int *)((char *)ring_ptr + reg.offsets.tail);
>> rq_ring.rqes = (struct io_uring_zcrx_rqe *)((char *)ring_ptr + reg.offsets.rqes);
>
--
Pavel Begunkov
prev parent reply other threads:[~2025-04-21 6:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-20 11:24 [PATCH liburing 0/3] zcrx refill queue allocation modes Pavel Begunkov
2025-04-20 11:24 ` [PATCH liburing 1/3] examples: remove zcrx size limiting Pavel Begunkov
2025-04-21 0:22 ` David Wei
2025-04-21 6:40 ` Pavel Begunkov
2025-04-21 17:38 ` David Wei
2025-04-20 11:24 ` [PATCH liburing 2/3] examples/zcrx: constants for request types Pavel Begunkov
2025-04-21 0:25 ` David Wei
2025-04-20 11:24 ` [PATCH liburing 3/3] examples/zcrx: add refill queue allocation modes Pavel Begunkov
2025-04-21 0:28 ` David Wei
2025-04-21 6:38 ` Pavel Begunkov [this message]
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=04698484-e452-4e10-aaef-0ccda2378261@gmail.com \
--to=asml.silence@gmail.com \
--cc=dw@davidwei.uk \
--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