From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 4548221D3D2 for ; Sat, 11 Apr 2026 12:16:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775909805; cv=none; b=H9m8t8RSu3QQoV9r3veQTcsLtIjv78424WHG1VIBPUI85x8yzH+WcHx2K3dWxidQgkHU2eXiwQvSQpI5LiGjZho89fApIhTOI8YI+cJItV03+OcBdlYO61U7+AA3tmMmIPCgT1M1H+U9kUXQlgZNIRKnSs1Wwxqz/Fp4LaDf2AA= 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.214.173 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-pl1-f173.google.com with SMTP id d9443c01a7336-2b0c8362d93so19141295ad.3 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=dy+gSnnHSl5sT+2uejf2Xq4W3e4cLTSLGBjny9arXg4sjWdHSiouUpFOlh+peuTRY3 ilJ6VKIKKXEFNp6Yuf2RdI21gbP4hCv+4p3aBCL+4g52vurfhu5hL0/ZdPfGIO9QmzYF DsrBXMqR2zToiXU2bFL8ZzSLXxlFdRs0tm0BBn/p6WP/ftXA3GhQtfBUEAoBPPDMTG5s bnp51d+5FcNfZG2NSL2sJiizZmiPX2jP0PYDHHc3MqtbIfdsvTQPRXwW1+NdfRXxNvNZ N57aquSWqqI8QsSa0Ho+vPoLKS2T44soVweyDpIzv49E4hhVhjQ7YmqQjYuAM7SbJZjC znDA== X-Forwarded-Encrypted: i=1; AJvYcCWqqaq8WypO/UoN53CBme009+S/TkYySytsfLGPH9OGEVbr7LSA7cfynHxqVrnvYursAGEjgivqtwspQmg=@vger.kernel.org X-Gm-Message-State: AOJu0YzX5hehpHZnOfwJjkRw2lYQ4uVl62Gkw7TglGNDwy0fRI0vKdOP TbEBqcQTJNpo+l+DQJi50LtrZ8MSOkH9zTsb3Upcx+C3BEJcBnGPopP8akmj7WPg49U2+5lRNKC EQ1ZKtCw= X-Gm-Gg: AeBDievCQO0b+K+EwtjSjV6v/1tXHZYZtUIAvP55dU8xDyhUeuhd8RPnSe+Nj3nIQNa f3pcxpRqc/jWpPzB9lez93nrJzFj9rikrrEmgKeRoLXVhUnqz+uSOnWql9h1T77XPVtpERWYb34 TIOiElAeHXo24ohMNTrkbXANKQXN7YPJmJB2V36rNLb87ox3fLgg5Q/AFgERSfexVtr1ZOtEWij QEuThuVAgQM9baiRrpa6s/6LKaaOhiHPS5IRErOfhwMrj78TQ9qOHnly/3xL8upugjH/0Rb3o7u 7aSPHqbmJicd/GeB1UlkAdAf+MMqQhxdlhu5Pd7W9v4T3Lwhsy6xqjZzs3yu/G88AgCRSPvorub PewIz3+Hhgl3c47txd5qcuGOD0vrflGSbunB1JoiVBJWQ7XQ8yABUYMJs2RRRC5Gqb/+vc1Y+Ag KLq6xiIUv0eEChxOdwiA== 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: linux-kernel@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