From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (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 5A4B7262FFC for ; Sat, 11 Apr 2026 12:16:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775909805; cv=none; b=EG08vQkYPmCMBXMOrNiUgPbB+Thb5OjOHzAUf6ibBV0AFbSemg/Xp4XhBSKFLCU7sjE8piUMrz7MAcv4hWV1rt10HhGk4kwF2kv1j4/AWVypjivYUYpYEdJkUl5YXolKxm+Q8JNhWmHpyXaVAtHBlr6GRb4KI9QRQ8Y0ADbjKC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775909805; c=relaxed/simple; bh=GB72JJsiotjmsTeSYOJVrOcPx/d3YFTtyU//wvnPopA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IInv+nj1E5CJYIpU+az+CI64Jpgwp9iIWMJkJH0wtjuGMk10qsFBO7yys2iUTcQDD4b6Z8htsqKJsI5FqNsvwFt7tAItSyxdXVV48J2ZuX/f74j3BYqP0tI51gLIZWyvbbquS79F3XJ60OhTedSBZ5xK9QFV90HOGPqVh8RYIHE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=furiosa.ai; spf=none smtp.mailfrom=furiosa.ai; dkim=pass (1024-bit key) header.d=furiosa.ai header.i=@furiosa.ai header.b=ajDJrE0A; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=furiosa.ai Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=furiosa.ai Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=furiosa.ai header.i=@furiosa.ai header.b="ajDJrE0A" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-c06cb8004e8so1234856a12.0 for ; Sat, 11 Apr 2026 05:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=furiosa.ai; s=google; t=1775909804; x=1776514604; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DzjRMQ0JdtxqBhtkAeDCS/1xK/Kh5wMUnQG+Jga1ziI=; b=ajDJrE0ASyqe3uMpVTFz6QIzc12P75ZZgBQCCdPyr5Aj8F3JbVyTql/seI6EgGW5X+ CgYOj3uJAibI6QgSw+Sn0koDEI8ywb9dBo11rOl4bf3EqfLsQp72YbURPY0UbwTbIVaE c02COpsiIU9BPOxYxuUthxNxXFyPq98jG2irg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775909804; x=1776514604; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DzjRMQ0JdtxqBhtkAeDCS/1xK/Kh5wMUnQG+Jga1ziI=; b=VFB24Ai8YQZ87zvzh6d+/xAd7goH/HW1lVVn1xJmIEulPs17f/vbTORAvH+Qq63p4p /o3fMGABk7+ychX4CFwDle3njX6vKNV/iJSA7jlzl01tmUNwHdA3cIvftgQzrlt1vWKd MP6oSENO6ODBg0OQGpoa646xjmWEc+wDtVVOhjyI74NqRXquIy5KGRRYiWtF19BphgSF Mq+ikvYqwbisX+bTWoqRpk7+VjBEkZaPaA8yWSBDrUnik44Y+2+xSBGqtUnYfwwFTc0B OujWV/vE645LzEXP39juYpbXzwBfsQvEhOEWnUGjHhcnyXc/NRXE9dh43jmEZptnnGkd hn8w== X-Forwarded-Encrypted: i=1; AJvYcCURSX4AwXWj8HJsPk2X9fm/vSxmjb9vlZMGVZEj4/par0pT0jVDwCr0ku8WGI1o65+/uA8Yen377w==@vger.kernel.org X-Gm-Message-State: AOJu0YzSdOH8E2T2BXXXcLBuENRVGh6SpKniU/YxIdBS+//EHCTU3D/G 1tvIwVTB5o4dnM/0+imVQT8SXWfSkNOvQxy/pjje847Bpzbufv7ZHQWZXnGpeOQCHCw= X-Gm-Gg: AeBDietbZCBQ+zTSlXOOlAcpp7rTkcN8H7gKvCYsZSOYh4DQxb3VkHYG/TmJozY1vcI yuVwFuPRqYJ5MpdACYxbwYwoTQWLPmYSuS35JyAs/sijp0qFrTS/IxrcEmawoRXDJaUwJi1G3Nz GSqBmAfPYloMHdIdQ+dODbCdmK5TuoGRNbegxqQzOTk0KGzdytLGbg5KERM57JA8r/BUbplTDZI 7uVedGhPCecMMFhvBeFtZgtCJ0LsUJjtYUg5b3B8LgbEYQHakGek6n5O909wUre+CZNmclNmR+a 4MP3g99iCl+8zwZDVgF1EXIbnpms/SZ5+Gxe9TsmLdeOAy0ohrqHyF2JgMZI55Ke3D9yMlqUlng rvrQyFFnFjdzocUlpqu99uEX8GQsmdSdN2viU4HK/Hy8slBM1jb61Ym1xyi/q71CkcEYPdlKd4g GqCUKQBluPVjG8Hr8NLA== X-Received: by 2002:a17:903:1103:b0:2b0:5a4c:726a with SMTP id d9443c01a7336-2b2d5aa7fa2mr69691975ad.43.1775909803528; Sat, 11 Apr 2026 05:16:43 -0700 (PDT) Received: from sidong ([61.83.209.48]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2d4f3a8f7sm59475805ad.71.2026.04.11.05.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Apr 2026 05:16:43 -0700 (PDT) Date: Sat, 11 Apr 2026 12:16:39 +0000 From: Sidong Yang To: Greg Kroah-Hartman Cc: Jens Axboe , Daniel Almeida , Caleb Sander Mateos , Benno Lossin , Miguel Ojeda , Arnd Bergmann , 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 Message-ID: References: <20260408140007.8401-1-sidong.yang@furiosa.ai> <2026040925-taunt-exit-0cb9@gregkh> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2026040925-taunt-exit-0cb9@gregkh> 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? Thanks, Sidong > > thanks, > > greg k-h