Re: [PATCH v8 01/27] cxl: add type2 device basic support
From: Dan Williams <hidden>
Date: 2025-02-05 20:05:56
Also in:
linux-cxl
From: Dan Williams <hidden>
Date: 2025-02-05 20:05:56
Also in:
linux-cxl
Dan Williams wrote: [..]
I think there is a benefit from a driver being able to do someting like:
struct my_cxl_accelerator_context {
...
struct cxl_dev_state cxlds;
...
};
Even if the rule is that direct consumption of 'struct cxl_dev_state'
outside of the cxl core is unwanted.
C does not make this easy, so it is either make the definition of
'struct cxl_dev_state' public to CXL accelerator drivers so that they
know the size, or add an allocation API that takes in the extra size
that accelerator needs to allocate the core CXL context.Jason has a novel approach to this problem of defining an allocation interface that lets the caller register a caller provided data structure that wraps a core internal object. Have a look at fwctl_alloc_device() for inspiration: http://lore.kernel.org/1-v3-960f17f90f17+516-fwctl_jgg@nvidia.com (local)