[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] cxl: Multi-headed device design
|
From: |
Gregory Price |
|
Subject: |
Re: [RFC] cxl: Multi-headed device design |
|
Date: |
Mon, 29 May 2023 14:13:07 -0400 |
On Wed, May 17, 2023 at 03:18:59PM +0100, Jonathan Cameron wrote:
> >
> > i.e. an SLD does not require an FM-Owned LD for management, but an MHD,
> > MLD, and DCD all do (at least in theory).
>
> DCD 'might' though I don't think anything in the spec rules that you 'must'
> control the SLD/MLD via the FM-API, it's just a spec provided option.
> From our point of view we don't want to get more creative so lets assume
> it does.
>
> I can't immediately think of reason for a single head SLD to have an FM owned
> LD, though it may well have an MCTP CCI for querying stuff about it from an
> FM.
>
Before I go running off into the woods, it seems like it would be simple
enough to simply make an FM-LD "device" which simply links a mhXXX device
and implements its own Mailbox CCI.
Maybe not "realistic", but to my mind this appears as a separate
character device in /dev/cxl/*. Maybe the realism here doesn't matter,
since we're just implementing for the sake of testing. This is just a
straightforward way to pipe a DCD request into the device and trigger
DCD event log entries.
As commented early, this is done as a QEMU fed event. If that's
sufficient, a hack like this feels like it would be at least mildly
cleaner and easier to test against.
Example: consider a user wanting to issue a DCD command to add capacity.
Real world: this would be some out of band communication, and eventually
this results in a DCD command to the device that results in a
capacity-event showing up in the log. Maybe it happens over TCP and
drills down to a Redfish event that talks to the BMC that issues a
command over etc etc MTCP emulations, etc.
With a simplistic /dev/cxl/memX-fmld device a user can simply issue these
commands without all that, and the effect is the same.
On the QEMU side you get something like:
-device cxl-type3,volatile-memdev=mem0,bus=rp0,mhd-head=0,id=mem0,mhd-main=true
-device cxl-mhsld,type3=mem0,bus=rp0,headid=0,id=mhsld1,shmid=XXXXX
-device cxl-fmld,mhsld=mdsld1,bus=rp1,id=mem0-fmld,shmid=YYYYY
on the Linux side you get:
/dev/cxl/mem0
/dev/cxl/mem0-fmld
in this example, the shmid for mhsld is a shared memory region created
with mkipc that implements the shared state (basically section bitmap
tracking and the actual plumbing for DCD, etc). This limits the emulation
of the mhsld to a single host for now, but that seems sufficient.
The shmid for cxl-fmld implements any shared state for the fmld,
including a mutex, that allows all hosts attached to the mhsld to have
access to the fmld. This may or may not be realistic, but it would
allow all head-attached hosts to send DCD commands over its own local
fabric, ratehr than going out of band.
This gets us to the point where, at a minimum, each host can issue its
own DCD commands to add capacity to itself. That's step 1.
Step 2 is allow Host A to issue a DCD command to add capacity to Host B.
I suppose this could be done via a backgruond thread that waits on a
message to show up in the shared memory region?
Being somewhat unfamiliar with QEMU, is it kosher to start background
threads that just wait on events like this, or is that generally frowed
upon? If done this way, it would stimplify the creation and startup
sequence at least.
~Gregory