[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250530145026.GB293473@ziepe.ca>
Date: Fri, 30 May 2025 11:50:26 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Abdiel Janulgue <abdiel.janulgue@...il.com>, dakr@...nel.org,
lyude@...hat.com, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Valentin Obst <kernel@...entinobst.de>,
open list <linux-kernel@...r.kernel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>, airlied@...hat.com,
rust-for-linux@...r.kernel.org,
"open list:DMA MAPPING HELPERS" <iommu@...ts.linux.dev>,
Petr Tesarik <petr@...arici.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Sui Jingfeng <sui.jingfeng@...ux.dev>,
Randy Dunlap <rdunlap@...radead.org>,
Michael Kelley <mhklinux@...look.com>
Subject: Re: [PATCH 1/2] rust: add initial scatterlist bindings
On Fri, May 30, 2025 at 11:44:26PM +0900, Alexandre Courbot wrote:
> I would be fully on board with a simpler design, definitely. The reason
> why I've tried to keep some doors open is that as you mentioned
> scatterlist is used in many different ways, and I am not familiar enough
> with all these uses to draw a line and say "we will never ever need to
> do that".
I think it would be better to grow as needed. It is hard to speculate.
We also have the new two step DMA API, so it may very well be the only
use for this stuff is very simple mappings of VVec like things for
DMA, and maybe this all gets rewritten to use the new DMA API and not
scatterlist.
Having a rust user facing API that allows for that would be a great
thing.
IOW I would maybe reframe the task here, it is not to create simple
naive wrappers around scatterlist but to provide a nice rust API to go
from VVec/etc to DMA mapping of that VVec/etc.
> Like unmapping a buffer and remapping it later sounds like a plausible
> use (say, if the device's own DMA space is limited), so preserving at
> least 2 states sounds sensible.
I don't think so, there is no such thing as a "device's own DMA space
is limited" in modern HW, and if it was a problem you wouldn't solve
it by swapping the same scatterlist in and out..
Jason
Powered by blists - more mailing lists