From: David Wei <dw@davidwei.uk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH 2/5] io_uring/zcrx: move io_zcrx_iov_page
Date: Fri, 18 Apr 2025 08:07:23 -0700 [thread overview]
Message-ID: <ea4d80b2-ade4-4d98-95c2-0c3f22f0d246@davidwei.uk> (raw)
In-Reply-To: <af1f2e0947fcbee59c4f9e3707133d503d5589f0.1744815316.git.asml.silence@gmail.com>
On 2025-04-16 08:21, Pavel Begunkov wrote:
> We'll need io_zcrx_iov_page at the top to keep offset calculations
> closer together, move it there.
>
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
> io_uring/zcrx.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
> index 659438f4cfcf..0b56d5f84959 100644
> --- a/io_uring/zcrx.c
> +++ b/io_uring/zcrx.c
> @@ -31,6 +31,20 @@ static inline struct io_zcrx_ifq *io_pp_to_ifq(struct page_pool *pp)
> return pp->mp_priv;
> }
>
> +static inline struct io_zcrx_area *io_zcrx_iov_to_area(const struct net_iov *niov)
> +{
> + struct net_iov_area *owner = net_iov_owner(niov);
> +
> + return container_of(owner, struct io_zcrx_area, nia);
> +}
> +
> +static inline struct page *io_zcrx_iov_page(const struct net_iov *niov)
> +{
> + struct io_zcrx_area *area = io_zcrx_iov_to_area(niov);
> +
> + return area->pages[net_iov_idx(niov)];
> +}
> +
> #define IO_DMA_ATTR (DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_WEAK_ORDERING)
>
> static void __io_zcrx_unmap_area(struct io_zcrx_ifq *ifq,
> @@ -111,13 +125,6 @@ struct io_zcrx_args {
>
> static const struct memory_provider_ops io_uring_pp_zc_ops;
>
> -static inline struct io_zcrx_area *io_zcrx_iov_to_area(const struct net_iov *niov)
> -{
> - struct net_iov_area *owner = net_iov_owner(niov);
> -
> - return container_of(owner, struct io_zcrx_area, nia);
> -}
> -
> static inline atomic_t *io_get_user_counter(struct net_iov *niov)
> {
> struct io_zcrx_area *area = io_zcrx_iov_to_area(niov);
> @@ -140,13 +147,6 @@ static void io_zcrx_get_niov_uref(struct net_iov *niov)
> atomic_inc(io_get_user_counter(niov));
> }
>
> -static inline struct page *io_zcrx_iov_page(const struct net_iov *niov)
> -{
> - struct io_zcrx_area *area = io_zcrx_iov_to_area(niov);
> -
> - return area->pages[net_iov_idx(niov)];
> -}
> -
> static int io_allocate_rbuf_ring(struct io_zcrx_ifq *ifq,
> struct io_uring_zcrx_ifq_reg *reg,
> struct io_uring_region_desc *rd)
Reviewed-by: David Wei <dw@davidwei.uk>
next prev parent reply other threads:[~2025-04-18 15:07 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 [this message]
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
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=ea4d80b2-ade4-4d98-95c2-0c3f22f0d246@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