From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Abdiel Janulgue" <abdiel.janulgue@gmail.com>, <jgg@ziepe.ca>,
<lyude@redhat.com>, <dakr@kernel.org>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Valentin Obst" <kernel@valentinobst.de>,
"open list" <linux-kernel@vger.kernel.org>,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Robin Murphy" <robin.murphy@arm.com>,
airlied@redhat.com, rust-for-linux@vger.kernel.org,
"open list:DMA MAPPING HELPERS" <iommu@lists.linux.dev>,
"Petr Tesarik" <petr@tesarici.cz>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"Sui Jingfeng" <sui.jingfeng@linux.dev>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Michael Kelley" <mhklinux@outlook.com>
Subject: Re: [PATCH v2 1/2] rust: add initial scatterlist bindings
Date: Fri, 11 Jul 2025 16:05:59 +0900 [thread overview]
Message-ID: <DB91AA9OBJLO.34HG554WY12GX@nvidia.com> (raw)
In-Reply-To: <0206a7fa-ce7f-46af-8f1d-f9dedbb0a3d8@gmail.com>
Hi Abdiel,
On Wed Jul 9, 2025 at 8:59 PM JST, Abdiel Janulgue wrote:
> Hi,
>
> On 03/07/2025 10:03, Alexandre Courbot wrote:
>> 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.
>
> Sorry for the delay, just came back from a week vacation.
Welcome back!
>
> Regarding your question regarding why I dropped type-state, I thought
> the general consensus here is to drop this approach:
>
> https://lore.kernel.org/lkml/DAC20AXGABW2.X147X4JPMRBS@nvidia.com/
>
> I think I might have misunderstood after re-reading it now. What you
> probably meant was to have no intermediate state from initialized to
> mapped to create the sg_table?
Sorry, that was poorly phrased - and yes this is what I meant. Since we
have no use for unmapped SG tables at the moment, let's start with this
simple and working approach. We can always add more states/stuff later
if the need arises.
>
> Anyways, thanks for the code above I'll look into this in detail and
> pick bits to integrate into v3 :)
Looking forward to it! Please don't hesitate to reach out if anything is
unclear.
next prev parent reply other threads:[~2025-07-11 7:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 20:30 [PATCH v2 0/2] rust: add initial scatterlist abstraction Abdiel Janulgue
2025-06-26 20:30 ` [PATCH v2 1/2] rust: add initial scatterlist bindings Abdiel Janulgue
2025-06-30 8:34 ` Alexandre Courbot
2025-06-30 12:56 ` Alexandre Courbot
2025-07-02 2:37 ` Alexandre Courbot
2025-07-03 7:03 ` Alexandre Courbot
2025-07-09 11:59 ` Abdiel Janulgue
2025-07-11 7:05 ` Alexandre Courbot [this message]
2025-06-26 20:30 ` [PATCH v2 2/2] samples: rust: add sample code for " Abdiel Janulgue
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=DB91AA9OBJLO.34HG554WY12GX@nvidia.com \
--to=acourbot@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=abdiel.janulgue@gmail.com \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=herbert@gondor.apana.org.au \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=kernel@valentinobst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=m.szyprowski@samsung.com \
--cc=mhklinux@outlook.com \
--cc=ojeda@kernel.org \
--cc=petr@tesarici.cz \
--cc=rdunlap@infradead.org \
--cc=robin.murphy@arm.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=sui.jingfeng@linux.dev \
--cc=tmgross@umich.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.