rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] scatterlist rust bindings
@ 2025-05-12  9:53 Abdiel Janulgue
  2025-05-12  9:53 ` [RFC PATCH 1/2] rust: add initial scatterlist bindings Abdiel Janulgue
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Abdiel Janulgue @ 2025-05-12  9:53 UTC (permalink / raw)
  To: dakr, lyude
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Valentin Obst, open list, Marek Szyprowski,
	Robin Murphy, airlied, rust-for-linux,
	open list:DMA MAPPING HELPERS, Petr Tesarik, Andrew Morton,
	Herbert Xu, Sui Jingfeng, Randy Dunlap, Michael Kelley,
	Abdiel Janulgue

Hi,

Here are the scatterlist bindings that has been brewing for a while in my
local tree while working with Nova code. The bindings are used mostly to
build the radix3 table from the GSP firmware which is loaded via dma.
This interface can be used on top of existing kernel scatterlist objects
or to allocate a new one from scratch.

Some questions still need to be resolved, which mostly come from
the DeviceSGTable::dma_map() function. Primarily, what if you call
bindings::dma_map_sgtable() on an already mapped sg_table? From my
experiments it doesn't seem to do anything and no indication is returned if
the call succeeded or not. Should we save the "mapping info" to a list
everytime we call DeviceSGTable::dma_map more than once?

Hoping this initial submission will generate some discussion. I'd like to
acknowledge valuable feedback from Danilo Krummrich and Lyude
Paul in shaping this up.

Abdiel Janulgue (2):
  rust: add initial scatterlist bindings
  samples: rust: add sample code for scatterlist bindings

 rust/bindings/bindings_helper.h |   1 +
 rust/helpers/helpers.c          |   1 +
 rust/helpers/scatterlist.c      |  25 +++
 rust/kernel/lib.rs              |   1 +
 rust/kernel/scatterlist.rs      | 275 ++++++++++++++++++++++++++++++++
 samples/rust/rust_dma.rs        |  14 +-
 6 files changed, 316 insertions(+), 1 deletion(-)
 create mode 100644 rust/helpers/scatterlist.c
 create mode 100644 rust/kernel/scatterlist.rs


base-commit: dd21715de3dfa6f6457432ce909e5f7eb142a7d2
-- 
2.43.0


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2025-05-26 13:04 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12  9:53 [RFC PATCH 0/2] scatterlist rust bindings Abdiel Janulgue
2025-05-12  9:53 ` [RFC PATCH 1/2] rust: add initial scatterlist bindings Abdiel Janulgue
2025-05-12 11:39   ` Daniel Almeida
2025-05-15 19:26     ` Lyude Paul
2025-05-15 21:11     ` Danilo Krummrich
2025-05-16 16:57       ` Daniel Almeida
2025-05-16 17:55         ` Danilo Krummrich
2025-05-12 16:42   ` Jason Gunthorpe
2025-05-12 20:01     ` Daniel Almeida
2025-05-12 20:10       ` Danilo Krummrich
2025-05-14  8:29   ` Alexandre Courbot
2025-05-14 12:50     ` Alexandre Courbot
2025-05-16  7:52       ` Abdiel Janulgue
2025-05-15 20:01   ` Lyude Paul
2025-05-16  7:52     ` Abdiel Janulgue
2025-05-26 13:04     ` Abdiel Janulgue
2025-05-12  9:53 ` [RFC PATCH 2/2] samples: rust: add sample code for " Abdiel Janulgue
2025-05-12 11:19 ` [RFC PATCH 0/2] scatterlist rust bindings Daniel Almeida
2025-05-14  7:00   ` Abdiel Janulgue
2025-05-14 12:12     ` Marek Szyprowski
2025-05-16  7:47       ` Abdiel Janulgue
2025-05-13  2:19 ` Herbert Xu
2025-05-13  5:50   ` Christoph Hellwig
2025-05-13  7:38     ` Petr Tesařík

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).