summaryrefslogtreecommitdiff
path: root/io_uring/zcrx.h
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2025-09-16 15:28:02 +0100
committerJens Axboe <axboe@kernel.dk>2025-09-16 12:37:21 -0600
commit705d2ac7b2044f1ca05ba6033183151a04dbff4d (patch)
tree4007929a276acf327d8aa62a19efad3856a54bef /io_uring/zcrx.h
parent8fd08d8dda3c6c4e9f0b73acdcf8a1cf391b0c8f (diff)
io_uring/zcrx: allow synchronous buffer return
Returning buffers via a ring is performant and convenient, but it becomes a problem when/if the user misconfigured the ring size and it becomes full. Add a synchronous way to return buffers back to the page pool via a new register opcode. It's supposed to be a reliable slow path for refilling. Signed-off-by: Pavel Begunkov <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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/io_uring/zcrx.h b/io_uring/zcrx.h
index a48871b5adad..33ef61503092 100644
--- a/io_uring/zcrx.h
+++ b/io_uring/zcrx.h
@@ -63,6 +63,8 @@ struct io_zcrx_ifq {
};
#if defined(CONFIG_IO_URING_ZCRX)
+int io_zcrx_return_bufs(struct io_ring_ctx *ctx,
+ void __user *arg, unsigned nr_arg);
int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
struct io_uring_zcrx_ifq_reg __user *arg);
void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx);
@@ -95,6 +97,11 @@ static inline struct io_mapped_region *io_zcrx_get_region(struct io_ring_ctx *ct
{
return NULL;
}
+static inline int io_zcrx_return_bufs(struct io_ring_ctx *ctx,
+ void __user *arg, unsigned nr_arg)
+{
+ return -EOPNOTSUPP;
+}
#endif
int io_recvzc(struct io_kiocb *req, unsigned int issue_flags);