1210: Implement SubProcessors core for processor#1488
Conversation
All pieces related to processor including CpuCore are currently in `processor.hpp`. This separates CpuCore codes into a different file. Signed-off-by: Myung Bae <myungbae@us.ibm.com>
The SubProcessors is a collection under the processor collection schema. The association objects, (containing, contained_by), are used to link the processor. The association between processor and core have been documented in phosphor-dbus-interfaces [1] [1] openbmc/phosphor-dbus-interfaces@8c79b1d Tested: - GET cpu and cpu subprocessors ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/Processors/cpu0 { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0", "@odata.type": "#Processor.v1_18_0.Processor", "Id": "cpu0", ... "SubProcessors": { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors" }, ... } ``` ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/Processors/cpu0/SubProcessors { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors", "@odata.type": "#ProcessorCollection.ProcessorCollection", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core1" }, ... ], "Members@odata.count": 4, "Name": "SubProcessor Collection" } ``` - Verified that below return a link header - GET /redfish/v1/Systems/system/Processors/cpu0/SubProcessors - HEAD /redfish/v1/Systems/system/Processors/cpu0/SubProcessors - Redfish Validator Passed Change-Id: If155b97b0c782d82541c00ecf5ee70cb0180f71f Signed-off-by: George Liu <liuxiwei@ieisystem.com> Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
The SubProcessors core is a collection under the processor schema. The association objects, (containing, contained_by), are used to link the processor core. The association between processor and core have been documented in phosphor-dbus-interfaces [1] [1] openbmc/phosphor-dbus-interfaces@8c79b1d Tested: Redfish Validator Passed ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0 { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0", "@odata.type": "#Processor.v1_18_0.Processor", "Enabled": true, "Id": "core0", "Name": "core0", "Status": { "Health": "OK", "State": "Enabled" } } ``` Verified that below return a link header ``` - GET /redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0 - HEAD /redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0 ``` Change-Id: I8cee9909ce20fc0bfdd56fb4fc992163546be180 Signed-off-by: George Liu <liuxiwei@inspur.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
The related upstream commits:
Note: depending on the target release of PLDM implementation, bmcweb may change its target release. |
|
This will work only after PLDM - ibm-openbmc/pldm#769 |
| @@ -362,7 +395,15 @@ inline void handleSubProcessorGet( | |||
|
|
|||
| getProcessorPaths( | |||
There was a problem hiding this comment.
I was wondering if GetAssociatedSubTreePathsById() could have been used here instead. But I think because getProcessorPaths() uses isProcObjectMatched() for name matching I think it cannot. Too bad.
| "/redfish/v1/Systems/{}/Processors/{}/SubProcessors", | ||
| BMCWEB_REDFISH_SYSTEM_URI_NAME, processorId), | ||
| procCoreInterfaces, cpuPath); | ||
| asyncResp->res.jsonValue["Members"] = nlohmann::json::array(); |
There was a problem hiding this comment.
I see why getCollectionMembers() cannot be used anymore. I'm wondering if the handleCollectionMembers() function could be used to populate the Members from the list obtained from the association? (Just a way to reduce code duplication.)
(Although that function is using appendUrlPieces() which I thought is one of the things we weren't supposed to really use anymore?)
| .methods(boost::beast::http::verb::get)( | ||
| std::bind_front(handleSubProcessorCoreGet, std::ref(app))); | ||
|
|
||
| BMCWEB_ROUTE( |
There was a problem hiding this comment.
Did the patch get lost in the restructure? I'm not seeing the route added in the updates.
| .privileges(redfish::privileges::getProcessorCollection) | ||
| .methods(boost::beast::http::verb::get)( | ||
| std::bind_front(handleSubProcessorCollectionGet, std::ref(app))); | ||
| } |
There was a problem hiding this comment.
Shouldn't the patch route still be here?
The SubProcessors core is a collection under the processor
schema. The association objects, (containing, contained_by), are used
to link the processor core.
The association between processor and core have been documented in
phosphor-dbus-interfaces [1]
[1] openbmc/phosphor-dbus-interfaces@8c79b1d
Tested: Redfish Validator Passed