Thread (102 messages) 102 messages, 9 authors, 2025-02-07

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

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)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help