This patch enables the IORING_SETUP_SQE128 flag during io_uring
initialization to support the FUSE protocol requirements.

The FUSE-over-io_uring implementation embeds a protocol-specific
structure directly into the Submission Queue Entry (SQE)
to pass metadata such as the queue ID and commit ID.

Enabling SQE128 expands the SQE size to 128 bytes, providing 80 bytes
of available command space. This ensures sufficient room for the FUSE
headers and future protocol extensions.

Suggested-by: Kevin Wolf <[email protected]>
Suggested-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Brian Song <[email protected]>
---
 util/fdmon-io_uring.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c
index d2433d1d99..e6efc8d8f7 100644
--- a/util/fdmon-io_uring.c
+++ b/util/fdmon-io_uring.c
@@ -452,10 +452,15 @@ static const FDMonOps fdmon_io_uring_ops = {
 void fdmon_io_uring_setup(AioContext *ctx, Error **errp)
 {
     int ret;
+    int flags;

     ctx->io_uring_fd_tag = NULL;

-    ret = io_uring_queue_init(FDMON_IO_URING_ENTRIES, &ctx->fdmon_io_uring, 0);
+    /* Needed by FUSE-over-io_uring */
+    flags = IORING_SETUP_SQE128;
+
+    ret = io_uring_queue_init(FDMON_IO_URING_ENTRIES,
+                              &ctx->fdmon_io_uring, flags);
     if (ret != 0) {
         error_setg_errno(errp, -ret, "Failed to initialize io_uring");
         return;
--
2.43.0


Reply via email to