rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abdiel Janulgue <abdiel.janulgue@gmail.com>
To: Alexandre Courbot <acourbot@nvidia.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: Wed, 9 Jul 2025 14:59:03 +0300	[thread overview]
Message-ID: <0206a7fa-ce7f-46af-8f1d-f9dedbb0a3d8@gmail.com> (raw)
In-Reply-To: <DB288AEQSBTC.63WK79TB77TW@nvidia.com>

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.

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?

Anyways, thanks for the code above I'll look into this in detail and 
pick bits to integrate into v3 :)

/Abdiel


  reply	other threads:[~2025-07-09 11:59 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 [this message]
2025-07-11  7:05             ` Alexandre Courbot
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=0206a7fa-ce7f-46af-8f1d-f9dedbb0a3d8@gmail.com \
    --to=abdiel.janulgue@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).