On Tue, 21 May 2024 16:38:53 -0700 fan <nifan....@gmail.com> wrote: > On Mon, May 20, 2024 at 05:50:12PM +0100, Jonathan Cameron wrote: > > On Wed, 1 May 2024 15:29:31 -0700 > > fan <nifan....@gmail.com> wrote: > > > > > From 873f59ec06c38645768ada452d9b18920a34723e Mon Sep 17 00:00:00 2001 > > > From: Fan Ni <fan...@samsung.com> > > > Date: Tue, 20 Feb 2024 09:48:31 -0800 > > > Subject: [PATCH] hw/cxl/events: Add qmp interfaces to add/release dynamic > > > capacity extents > > > Status: RO > > > Content-Length: 25172 > > > Lines: 731 > > > > > > To simulate FM functionalities for initiating Dynamic Capacity Add > > > (Opcode 5604h) and Dynamic Capacity Release (Opcode 5605h) as in CXL spec > > > r3.1 7.6.7.6.5 and 7.6.7.6.6, we implemented two QMP interfaces to issue > > > add/release dynamic capacity extents requests. > > > > > > With the change, we allow to release an extent only when its DPA range > > > is contained by a single accepted extent in the device. That is to say, > > > extent superset release is not supported yet. > > > > > > 1. Add dynamic capacity extents: > > > > > > For example, the command to add two continuous extents (each 128MiB long) > > > to region 0 (starting at DPA offset 0) looks like below: > > > > > > { "execute": "qmp_capabilities" } > > > > > > { "execute": "cxl-add-dynamic-capacity", > > > "arguments": { > > > "path": "/machine/peripheral/cxl-dcd0", > > > "host-id": 0, > > > "selection-policy": 2, > > > "region": 0, > > > "tag": "", > > > "extents": [ > > > { > > > "offset": 0, > > > "len": 134217728 > > > }, > > > { > > > "offset": 134217728, > > > "len": 134217728 > > > } > > > ] > > > } > > > } > > > > > > 2. Release dynamic capacity extents: > > > > > > For example, the command to release an extent of size 128MiB from region 0 > > > (DPA offset 128MiB) looks like below: > > > > > > { "execute": "cxl-release-dynamic-capacity", > > > "arguments": { > > > "path": "/machine/peripheral/cxl-dcd0", > > > "host-id": 0, > > > "flags": 1, > > > "region": 0, > > > "tag": "", > > > "extents": [ > > > { > > > "offset": 134217728, > > > "len": 134217728 > > > } > > > ] > > > } > > > } > > > > > > Signed-off-by: Fan Ni <fan...@samsung.com> > > > > Hi Fan, > > > > A few trivial questions inline. I don't feel particularly strongly > > about breaking up the flags fields, but I'd like to understand your > > reasoning for keeping them as single fields? > > > > Is it mainly to keep aligned with the specification or something else? > > > > Thanks, > > > > Jonathan > > Hi Jonathan, > FYI. > I just sent out the updated QAPI patch with selection policy defined as > enum and removal policy split out in this thread, > https://lore.kernel.org/linux-cxl/5856b7a4-4082-465f-9f61-b1ec6c35e...@fujitsu.com/T/#m9838d6afda49fb26eb90526eae5550256f5d0f56 Looks good in general, but I have more questions :( Now we have separate fields, some of them have natural defaults. Maybe we should provide those and reduce what needs to be passed in?
We will need to do that anyway for any future editions so perhaps makes sense to do so now? > > Planning to send out v8 on Thursday. Great. Jonathan