Skip to content

1210: Implement SubProcessors core for processor#1488

Open
baemyung wants to merge 3 commits into
ibm-openbmc:1210from
baemyung:1210-Implement-Cpu-CpuCore-via-ContainedBy-Association
Open

1210: Implement SubProcessors core for processor#1488
baemyung wants to merge 3 commits into
ibm-openbmc:1210from
baemyung:1210-Implement-Cpu-CpuCore-via-ContainedBy-Association

Conversation

@baemyung

Copy link
Copy Markdown
Contributor

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"
  }
}
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"
}

baemyung and others added 3 commits June 17, 2026 10:50
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>
@baemyung

Copy link
Copy Markdown
Contributor Author

The related upstream commits:

Note: depending on the target release of PLDM implementation, bmcweb may change its target release.

@baemyung

Copy link
Copy Markdown
Contributor Author

This will work only after PLDM - ibm-openbmc/pldm#769

@baemyung baemyung marked this pull request as ready for review June 22, 2026 13:16
@@ -362,7 +395,15 @@ inline void handleSubProcessorGet(

getProcessorPaths(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the patch route still be here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants