public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: David Wei <dw@davidwei.uk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH liburing 3/3] examples/zcrx: add refill queue allocation modes
Date: Sun, 20 Apr 2025 17:28:44 -0700	[thread overview]
Message-ID: <7a941493-9924-4086-acaa-55cd428d25a2@davidwei.uk> (raw)
In-Reply-To: <6a52feca4f8842c6aa3ad4595c1d1da8150f6fc1.1745146129.git.asml.silence@gmail.com>

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?

> +		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);


  reply	other threads:[~2025-04-21  0:28 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 [this message]
2025-04-21  6:38     ` 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=7a941493-9924-4086-acaa-55cd428d25a2@davidwei.uk \
    --to=dw@davidwei.uk \
    --cc=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