[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DB288AEQSBTC.63WK79TB77TW@nvidia.com>
Date: Thu, 03 Jul 2025 16:03:51 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Alexandre Courbot" <acourbot@...dia.com>, "Abdiel Janulgue"
<abdiel.janulgue@...il.com>, <jgg@...pe.ca>, <lyude@...hat.com>,
<dakr@...nel.org>
Cc: "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 v2 1/2] rust: add initial scatterlist bindings
On Wed Jul 2, 2025 at 11:37 AM JST, Alexandre Courbot wrote:
> Thoughts? If Abdiel is comfortable with this I can submit a v3 with this design
> for review (putting myself as co-developer), on which Abdiel could then keep
> iterating, as I suspect this would be easier to understand than this long email
> :).
Figured I could just as well share the code with you and save both of us
some time. ^_^;
The top commit of this branch contains the proposal discussed:
https://github.com/Gnurou/linux/tree/scatterlists
The sample code has been updated to add dummy examples for the 3
use-cases discussed (reference to an existing `sg_table`, refcounted
reference, and owned data).
There are still things missing, including the typestate on `SGEntry`, as
it wasn't necessary to demonstrate the basic idea.
Note also that if we decide to only support DMA-mapped SG-entries, we
can remove a bunch of code, including the one that maps a `SGTable` if
the backing type implements `BorrowMut`.
For your consideration. :) Please feel free to take and use anything you
find useful.
Powered by blists - more mailing lists