Re: [PATCH v2 1/2] rust: introduce abstractions for fwctlg
From: Jason Gunthorpe
Date: Wed Jan 28 2026 - 10:04:59 EST
On Wed, Jan 28, 2026 at 03:01:25PM +0100, Danilo Krummrich wrote:
> There is no second memory allocation. In the implementation of
> fwctl::Device::new() above we call _fwctl_alloc_device() with a size (and
> layout) such that this allocation is suitable to initialize the second argument
> (i.e. data: impl PinInit<T, Error>) within this allocation.
You are talking about your suggestions now right?
Because what I see in Zi's patch doesn't match any of this?
+ bindings::_fwctl_alloc_device(
+ parent.as_raw(),
+ ops,
+ core::mem::size_of::<bindings::fwctl_device>(),
+ )
That is not allocating any memory for driver use ...
What you are explaining sounds good to me, though I don't quite get
the PinInit<> flow but I trust you on that. :)
Jason