Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5207B388E63 for ; Thu, 16 Jul 2026 18:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784224813; cv=none; b=nC8TEc3thzWCbePv02e47awnqjW9WnPFcnMt2b1vC1ntVQjNexSKw84ovFr62QhKJ9bxjyxoThuyzNtPCaPLF1Brr9xYewg9u4aJneTuI/LpRYjX/LUmUY1rc9JkxrDBwYHxZmVglBky8tPyxZHjxvJL6rGdcJG1HwsNt32K+Nc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784224813; c=relaxed/simple; bh=83mOg3Wh6U3fJQTFD9urnMsnCEwUpd5C9D50sSBw68U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GEot1yfOWdqmGRANCWTU7a1fEVjwQt0V1/Xvhg1FQYfweBZ2I15Sx66UhVYDqY39WCNHMSbGquDE6GtZKwj90dmTKNsWHySZb1GEDXClPlJSFaGzRKTmRJ/oewZSU8sueArantCw1wdpQXv7NRAlX3hhmh86vjGM9KgiAzXC/dM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QI1ZPb+P; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QI1ZPb+P" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-7eb545db3afso2062157a34.0 for ; Thu, 16 Jul 2026 11:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784224810; x=1784829610; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JRLd71T14YEzjDHBlYRHqio8//1GV8CoOyUJf4jM4wU=; b=QI1ZPb+PqOusL57cOU22ZBPVrDjCa5GO/Qrtknt4KBR5IEBuH50CXLxGT3vHNXag4v h3MzUsUppPT7XUsg0+P+nziJdpWB8Gaop4lgUd8qU7HnwysOSX0Rw85HU+HFQAjSp7s+ AnB+F2lOTTb8Y/WBqreEMZfiZhPXL2DsUxlNczC94atZNNajgz9/+kYvOqAUfaBH2bgC arf6seCmlRz1aTyj6WuuizC29JMd+1eNUgeR1FH/jGpm8DuiHnD2IhV8Nnl7RLWRZWyS EG0PWjIDcOB64NXbqwKtD/IL+MnS5P4RogJFlnwESVASq2IlVY/spezpl0dtxVIhrYYU FbRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784224810; x=1784829610; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=JRLd71T14YEzjDHBlYRHqio8//1GV8CoOyUJf4jM4wU=; b=SbYyBaF+WH3T9+LFKlnxmeBb5sAUIF66yG2H8dP5TZZrH4rQDUbzldz7NwA/qqh7ys 4F106kPSOPEkCRcSsCbNpf80UiYLlTrQqjss3opNazGU+oHTglS+n4NlUd3bGGDm72WC 64eCsUBwq0LApMjmCm7HMguF29UkZbNq4pTQJWCBn8bupFiqmT5IlCoSu/lynn7mBGi0 T9U8Efuw0f7G3UmqOZkYqxp95Dr6mb2cOuQnK1DyUhHztxBjYnlQeOVfl63uyBU3pgFp Wbv0GU6cC7bkXZ1Knl6lZobbdV9dZ61IKaDiBIYF1k3htQ3cbtC8g55c25Y3vHu5AlL5 Xhig== X-Forwarded-Encrypted: i=1; AHgh+RoHtwVWJA61kGi45etdpHn1DL0B7r8ajhyQlA/YmfQMsKYeF2o+gM1Yeoj+7lZyQZeAcwDRmU6FoPln@lists.linux.dev X-Gm-Message-State: AOJu0Yw28JgAai4N0c1XLg50f0R4GRxwhP617Ah6mS09AIdwvFlx8iNb cJuGT789u2gg3m4I3qZMMIsfDjJMTB/ie6si2t7whwBKT0zdYDPvKcWM X-Gm-Gg: AfdE7cnChiZ1+4J8o6AqHURqbh/QOEYNbSzUxI/Tgk33Nyq1nIcaKjAIFmdkN6eKnLc MAgZJ+tHzsAnpXfOm1xnI+VnYznkPXBI1GDAgsan6QdI2u/jWgCoshi0oa7JG2cniJks6uffKgl uZ4gCcr1wcPGR2KTOJSSTXaz4A/6uY7Fo3ILPeF8VQ8dTj4K1Pwm5JybRAEqw3izndUHkQfrEx/ yVoEO9uDXjBsyrUC5vAyf0G8w0HoRUDxN/D1LIBPjgIaRGFkyAvmTa5st4knPAFlfLyzVnS6oQG R37+fN4Ncfw/QA54JdbcjR4ZEcBwxs6U0FevC1IrVfyLm5fhHVoqlcOkleFx4kP0FrpnpKlRfk0 /w8TEyCTcD5thiiWCiw/SJG0IwMsB2AQvbJUeIw+cyPdUbvRnuS8cfZTaSoo5lakrFHigR+b+3j e/0r4j4D0uEo2JI9fDdrVs5fKsnaeg0efK9zFxTJkaCxugpEEdfpGrjOfibRpty+M= X-Received: by 2002:a05:6820:a09:b0:6a3:e200:4161 with SMTP id 006d021491bc7-6a47054320bmr93600eaf.7.1784224810078; Thu, 16 Jul 2026 11:00:10 -0700 (PDT) Received: from localhost ([2a03:2880:ff:7::]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6a38a4bd734sm12138962eaf.4.2026.07.16.11.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 11:00:09 -0700 (PDT) From: Joanne Koong To: miklos@szeredi.hu Cc: jlayton@kernel.org, libaokun@linux.alibaba.com, axboe@kernel.dk, bernd@bsbernd.com, amir73il@gmail.com, fuse-devel@lists.linux.dev Subject: [PATCH v6 6/6] docs: fuse: document io-uring buffer pool and zero-copy uapi Date: Thu, 16 Jul 2026 10:59:08 -0700 Message-ID: <20260716175908.2339738-7-joannelkoong@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260716175908.2339738-1-joannelkoong@gmail.com> References: <20260716175908.2339738-1-joannelkoong@gmail.com> Precedence: bulk X-Mailing-List: fuse-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add documentation for fuse over io-uring usage of buffer pools and zero-copy. Signed-off-by: Joanne Koong --- .../filesystems/fuse/fuse-io-uring.rst | 36 ++++- Documentation/filesystems/fuse/index.rst | 1 + .../fuse/uapi/fuse-uapi-io-uring.rst | 129 ++++++++++++++++++ 3 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 Documentation/filesystems/fuse/uapi/fuse-uapi-io-uring.rst diff --git a/Documentation/filesystems/fuse/fuse-io-uring.rst b/Documentation/filesystems/fuse/fuse-io-uring.rst index d73dd0dbd238..29f98057500d 100644 --- a/Documentation/filesystems/fuse/fuse-io-uring.rst +++ b/Documentation/filesystems/fuse/fuse-io-uring.rst @@ -11,6 +11,9 @@ and works. For generic details about FUSE see fuse.rst. This document also covers the current interface, which is still in development and might change. +For the userspace protocol, see +Documentation/filesystems/fuse/uapi/fuse-uapi-io-uring.rst. + Limitations =========== As of now not all requests types are supported through io-uring, userspace @@ -95,5 +98,34 @@ Sending requests with CQEs | uring_cmd_flags`` and put the index of the registered bufpool in +``sqe->buf_index``. The same registered buffer can be reused for the server's +backing-store I/O as well (e.g. ``IORING_OP_READ_FIXED`` / +``IORING_OP_WRITE_FIXED``). + +When using registered bufpools, every SQE the server submits must follow the +standard fixed-buffer protocol: set ``IORING_URING_CMD_FIXED`` in +``sqe->uring_cmd_flags`` and put the index of the registered bufpool in +``sqe->buf_index``. + +Zero-copy +========= +Requirements: + +* The server must be privileged (``CAP_SYS_ADMIN``). +* A zero-copy queue: ``ADD_QUEUE`` with the ``FUSE_URING_ZERO_COPY`` flag set. +* A buffer pool: ``ADD_BUFPOOL``. +* For each entry, ``REGISTER`` with ``ent_zero_copy_buf_index`` set to the + index this entry uses in the server's io_uring registered-buffer table. + This is where the kernel registers the request's pages for the server to + access (it is separate from the payload pool). On a non-zero-copy queue this + field must be 0. + +Zero-copy is selected per open file. The server sets the open-file flag in +the ``FUSE_OPEN`` / ``FUSE_CREATE`` reply: + +``FOPEN_IO_URING_ZERO_COPY`` + Reads/writes on this open file should use zero-copy. + +For a request that is zero-copied, the kernel sets ``FUSE_URING_ENT_ZERO_COPY`` +in ``fuse_uring_ent_in_out.flags`` and places the request's pages at the +entry's ``ent_zero_copy_buf_index``. The server then issues +``IORING_OP_READ_FIXED`` / ``IORING_OP_WRITE_FIXED`` against that index to +transfer the data directly to/from the client's pages. + +For such a request, ``payload_sz`` includes the zero-copied page bytes +(transferred via the registered buffer at ``ent_zero_copy_buf_index``). Any +non-page-backed args (e.g. op headers) are still copied through the pool +payload buffer at ``offset``. -- 2.52.0