public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: David Wei <dw@davidwei.uk>, io-uring@vger.kernel.org
Subject: Re: [PATCH 3/5] io_uring/zcrx: let zcrx choose region for mmaping
Date: Fri, 18 Apr 2025 16:52:02 +0100	[thread overview]
Message-ID: <99dd671f-5d4c-4742-816c-264f521ca78f@gmail.com> (raw)
In-Reply-To: <f0dfc45a-6916-4c1a-a917-2c0a3f05c8a7@davidwei.uk>

On 4/18/25 16:35, David Wei wrote:
> On 2025-04-16 08:21, Pavel Begunkov wrote:
>> In preparation for adding multiple ifqs, add a helper returning a region
>> for mmaping zcrx refill queue. For now it's trivial and returns the same
>> ctx global ->zcrx_region.
>>
>> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
>> ---
>>   io_uring/memmap.c | 10 ++++++----
>>   io_uring/zcrx.c   | 10 ++++++++++
>>   io_uring/zcrx.h   |  7 +++++++
>>   3 files changed, 23 insertions(+), 4 deletions(-)
>>
>> diff --git a/io_uring/memmap.c b/io_uring/memmap.c
>> index 76fcc79656b0..e53289b8d69d 100644
>> --- a/io_uring/memmap.c
>> +++ b/io_uring/memmap.c
>> @@ -13,6 +13,7 @@
>>   #include "memmap.h"
>>   #include "kbuf.h"
>>   #include "rsrc.h"
>> +#include "zcrx.h"
>>   
>>   static void *io_mem_alloc_compound(struct page **pages, int nr_pages,
>>   				   size_t size, gfp_t gfp)
>> @@ -258,7 +259,9 @@ static struct io_mapped_region *io_mmap_get_region(struct io_ring_ctx *ctx,
>>   						   loff_t pgoff)
>>   {
>>   	loff_t offset = pgoff << PAGE_SHIFT;
>> -	unsigned int bgid;
>> +	unsigned int id;
>> +
>> +	id = (offset & ~IORING_OFF_MMAP_MASK) >> IORING_OFF_PBUF_SHIFT;
> 
> We using the same IORING_OFF_PBUF_SHIFT?

Let me check that, and also it likely doesn't return the right
value to the user as well.

-- 
Pavel Begunkov


  reply	other threads:[~2025-04-18 15:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 15:21 [PATCH 0/5] add support for multiple ifqs per io_uring Pavel Begunkov
2025-04-16 15:21 ` [PATCH 1/5] io_uring/zcrx: remove duplicated freelist init Pavel Begunkov
2025-04-18 15:06   ` David Wei
2025-04-16 15:21 ` [PATCH 2/5] io_uring/zcrx: move io_zcrx_iov_page Pavel Begunkov
2025-04-18 15:07   ` David Wei
2025-04-16 15:21 ` [PATCH 3/5] io_uring/zcrx: let zcrx choose region for mmaping Pavel Begunkov
2025-04-18 15:35   ` David Wei
2025-04-18 15:52     ` Pavel Begunkov [this message]
2025-04-16 15:21 ` [PATCH 4/5] io_uring/zcrx: move zcrx region to struct io_zcrx_ifq Pavel Begunkov
2025-04-18 16:05   ` David Wei
2025-04-18 16:22     ` Pavel Begunkov
2025-04-18 18:52       ` David Wei
2025-04-16 15:21 ` [PATCH 5/5] io_uring/zcrx: add support for multiple ifqs Pavel Begunkov
2025-04-18 17:01   ` David Wei
2025-04-18 17:22     ` Pavel Begunkov
2025-04-18 18:54       ` David Wei

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=99dd671f-5d4c-4742-816c-264f521ca78f@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