From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: asml.silence@gmail.com, David Wei <dw@davidwei.uk>
Subject: [PATCH v2 2/6] io_uring/zcrx: move io_zcrx_iov_page
Date: Sun, 20 Apr 2025 10:31:16 +0100 [thread overview]
Message-ID: <575617033a8b84a5985c7eb760b7121efdbe7e56.1745141261.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1745141261.git.asml.silence@gmail.com>
We'll need io_zcrx_iov_page at the top to keep offset calculations
closer together, move it there.
Reviewed-by: David Wei <dw@davidwei.uk>
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)
--
2.48.1
next prev parent reply other threads:[~2025-04-20 9:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-20 9:31 [PATCH v2 0/6] add support for multiple ifqs per io_uring Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 1/6] io_uring/zcrx: remove duplicated freelist init Pavel Begunkov
2025-04-20 9:31 ` Pavel Begunkov [this message]
2025-04-20 9:31 ` [PATCH v2 3/6] io_uring/zcrx: remove sqe->file_index check Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 4/6] io_uring/zcrx: let zcrx choose region for mmaping Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 5/6] io_uring/zcrx: move zcrx region to struct io_zcrx_ifq Pavel Begunkov
2025-04-20 9:31 ` [PATCH v2 6/6] io_uring/zcrx: add support for multiple ifqs Pavel Begunkov
2025-04-21 15:26 ` [PATCH v2 0/6] add support for multiple ifqs per io_uring 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=575617033a8b84a5985c7eb760b7121efdbe7e56.1745141261.git.asml.silence@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