public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Sidong Yang <sidong.yang@furiosa.ai>
Cc: Jens Axboe <axboe@kernel.dk>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Caleb Sander Mateos <csander@purestorage.com>,
	Benno Lossin <lossin@kernel.org>, Miguel Ojeda <ojeda@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	io-uring@vger.kernel.org
Subject: Re: [PATCH v4 0/5] Rust io_uring command abstraction for miscdevice
Date: Sat, 11 Apr 2026 14:27:14 +0200	[thread overview]
Message-ID: <2026041153-scope-five-fd24@gregkh> (raw)
In-Reply-To: <ado7p6jV6aapelBU@sidong>

On Sat, Apr 11, 2026 at 12:16:39PM +0000, Sidong Yang wrote:
> On Thu, Apr 09, 2026 at 07:25:23AM +0200, Greg Kroah-Hartman wrote:
> > On Wed, Apr 08, 2026 at 01:59:57PM +0000, Sidong Yang wrote:
> > > This series introduces Rust abstractions for io_uring commands
> > > (`IORING_OP_URING_CMD`) and wires them up to the miscdevice framework,
> > > allowing Rust drivers to handle io_uring passthrough commands.
> > > 
> > > The series is structured as follows:
> > > 
> > > 1. Add io_uring C headers to Rust bindings.
> > > 2. Zero-init pdu in io_uring_cmd_prep() to avoid UB from stale data.
> > > 3. Core io_uring Rust abstractions (IoUringCmd, QueuedIoUringCmd,
> > >    IoUringSqe, UringCmdAction type-state pattern).
> > > 4. MiscDevice trait extension with uring_cmd callback.
> > > 5. Sample demonstrating async uring_cmd handling via workqueue.
> > > 
> > > The sample completes asynchronously using a workqueue rather than
> > > `io_uring_cmd_complete_in_task()`.  The latter is primarily needed
> > > when completion originates from IRQ/softirq context (e.g. NVMe),
> > > whereas workqueue workers already run in process context and can
> > > safely call `io_uring_cmd_done()` directly.  A Rust binding for
> > > `complete_in_task` can be added in a follow-up series.
> > > 
> > > Copy-based `read_pdu()`/`write_pdu()` are kept instead of returning
> > > `&T`/`&mut T` references because the PDU is a `[u8; 32]` byte array
> > > whose alignment may not satisfy `T`'s requirements.
> > 
> > Samples are great and all, but I would really like to see a real user of
> > this before adding any more miscdev apis to the kernel.  Can you submit
> > this as a series that also adds the driver that needs this at the same
> > time?
> 
> Hi Greg,
> 
> Thank you for the review.
> 
> We have an out-of-tree C driver at Furiosa AI for our AI inference
> accelerator that uses uring_cmd.  This is our primary motivation for
> these abstractions.
> 
> We are considering upstreaming the driver and porting parts of it to
> Rust using these abstractions.  If we were to upstream the driver,
> would it need to be based on the accel subsystem (DRM)?  Or would a
> standalone PCI driver approach also be acceptable?

Yes, it must use the accel subsystem as that is the correct api for it.

thanks,

greg k-h

      reply	other threads:[~2026-04-11 12:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 13:59 [PATCH v4 0/5] Rust io_uring command abstraction for miscdevice Sidong Yang
2026-04-08 13:59 ` [PATCH v4 1/5] rust: bindings: add io_uring headers in bindings_helper.h Sidong Yang
2026-04-08 14:31   ` Miguel Ojeda
2026-04-09  1:20     ` Sidong Yang
2026-04-08 13:59 ` [PATCH v4 2/5] io_uring/cmd: zero-init pdu in io_uring_cmd_prep() to avoid UB Sidong Yang
2026-04-09  5:27   ` Greg Kroah-Hartman
2026-04-11 12:11     ` Sidong Yang
2026-04-08 14:00 ` [PATCH v4 3/5] rust: io_uring: introduce rust abstraction for io-uring cmd Sidong Yang
2026-04-08 14:00 ` [PATCH v4 4/5] rust: miscdevice: Add `uring_cmd` support Sidong Yang
2026-04-08 14:00 ` [PATCH v4 5/5] samples: rust: Add `uring_cmd` example to `rust_misc_device` Sidong Yang
2026-04-09  5:25 ` [PATCH v4 0/5] Rust io_uring command abstraction for miscdevice Greg Kroah-Hartman
2026-04-11 12:16   ` Sidong Yang
2026-04-11 12:27     ` Greg Kroah-Hartman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026041153-scope-five-fd24@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=daniel.almeida@collabora.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sidong.yang@furiosa.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox