diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-10-21 21:29:39 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-10-29 20:43:27 +0100 |
commit | 09d0a8ea7facc8b1581c9bd85c3ea6f5aa62ab7d (patch) | |
tree | 8e63319da812a6ac76ccafa3b6e9a8474978fd19 /io_uring/io_uring.h | |
parent | io_uring/net: clean up io_msg_copy_hdr (diff) | |
download | linux-09d0a8ea7facc8b1581c9bd85c3ea6f5aa62ab7d.tar.xz linux-09d0a8ea7facc8b1581c9bd85c3ea6f5aa62ab7d.zip |
io_uring: move max entry definition and ring sizing into header
In preparation for needing this somewhere else, move the definitions
for the maximum CQ and SQ ring size into io_uring.h. Make the
rings_size() helper available as well, and have it take just the setup
flags argument rather than the fill ring pointer. That's all that is
needed.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | io_uring/io_uring.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 9cd9a127e9ed..4a471a810f02 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -65,6 +65,11 @@ static inline bool io_should_wake(struct io_wait_queue *iowq) return dist >= 0 || atomic_read(&ctx->cq_timeouts) != iowq->nr_timeouts; } +#define IORING_MAX_ENTRIES 32768 +#define IORING_MAX_CQ_ENTRIES (2 * IORING_MAX_ENTRIES) + +unsigned long rings_size(unsigned int flags, unsigned int sq_entries, + unsigned int cq_entries, size_t *sq_offset); bool io_cqe_cache_refill(struct io_ring_ctx *ctx, bool overflow); int io_run_task_work_sig(struct io_ring_ctx *ctx); void io_req_defer_failed(struct io_kiocb *req, s32 res); |