diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-05-01 13:17:16 +0100 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-05-02 09:24:42 -0600 |
| commit | 782dfa329ac9d1b5ca7b6df56a7696bac58cb829 (patch) | |
| tree | 8c61999073b7393c90379db5e0639be2a760abaa /io_uring/zcrx.h | |
| parent | 6c9589aa08471f8984cdb5e743d2a2c048dc2403 (diff) | |
io_uring/zcrx: split out memory holders from area
In the data path users of struct io_zcrx_area don't need to know what
kind of memory it's backed by. Only keep there generic bits in there and
and split out memory type dependent fields into a new structure. It also
logically separates the step that actually imports the memory, e.g.
pinning user pages, from the generic area initialisation.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/b60fc09c76921bf69e77eb17e07eb4decedb3bf4.1746097431.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/zcrx.h')
| -rw-r--r-- | io_uring/zcrx.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/io_uring/zcrx.h b/io_uring/zcrx.h index e3c7c4e647f1..9c22807af807 100644 --- a/io_uring/zcrx.h +++ b/io_uring/zcrx.h @@ -7,6 +7,13 @@ #include <net/page_pool/types.h> #include <net/net_trackers.h> +struct io_zcrx_mem { + unsigned long size; + + struct page **pages; + unsigned long nr_folios; +}; + struct io_zcrx_area { struct net_iov_area nia; struct io_zcrx_ifq *ifq; @@ -14,13 +21,13 @@ struct io_zcrx_area { bool is_mapped; u16 area_id; - struct page **pages; - unsigned long nr_folios; /* freelist */ spinlock_t freelist_lock ____cacheline_aligned_in_smp; u32 free_count; u32 *freelist; + + struct io_zcrx_mem mem; }; struct io_zcrx_ifq { |
