ibm-openbmc / dev

Product Development Project Mgmt and Tracking
16 stars 2 forks source link

Redfish: processor cores #1747

Open gtmills opened 4 years ago

gtmills commented 4 years ago

Have CPU cores on d-bus https://github.com/openbmc/phosphor-dbus-interfaces/blob/05375b14e5a68ac249da6a8cd68e3d522a7ed022/xyz/openbmc_project/Inventory/Item/CpuCore.interface.yaml

curl -k  https://${bmc}/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/
{
  "data": [
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core13",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core14",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core15",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core16",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core17",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core18",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core19",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core2",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core20",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core21",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core22",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core23",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core3",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core4",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core6",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core7",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core8",
    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core9"
  ],

curl -k  https://${bmc}/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0
{
  "data": {
    "Associations": [
      [
        "sensors",
        "inventory",
        "/xyz/openbmc_project/sensors/temperature/p0_core0_temp"
      ]
    ],
    "Functional": true,
    "Present": true,
    "PrettyName": ""
  },

Should model these in Redfish: From https://redfish.dmtf.org/schemas/v1/Processor.v1_7_0.json

"SubProcessors": {
                    "$ref": "http://redfish.dmtf.org/schemas/v1/ProcessorCollection.json#/definitions/ProcessorCollection",
                    "description": "The link to the collection of subprocessors associated with this system, such as cores or threads, that are part of a processor.",
                    "longDescription": "This property shall contain a link to a Resource Collection of type ProcessorCollection.",
                    "readonly": true,
                    "versionAdded": "v1_3_0"
                },

So cores would be implemented at /Systems/{ComputerSystemId}/Processors/{ProcessorId}/SubProcessors/{ProcessorId2} E.g. /redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core11

dkodihal commented 4 years ago

Should also think about making associations between cores and cpus? As opposed to determining this from D-Bus pathnames? Something to discuss @gtmills.

bradbishop commented 3 years ago

There is a proposed dbus interface here https://gerrit.openbmc-project.xyz/29695

gtmills commented 3 years ago

@bradbishop This story is for processor cores which I think should be determined by the CpuCore D-Bus Interface. https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Inventory/Item/CpuCore.interface.yaml

Not sure that review of additional CPU properties is relevant.?

@dkodihal Using an association sounds like the "more correct" solution. Although I would be fine with either solution, using the pathnames or an association.

The story owner should probably check with the community before implementing the pathnames solution or risk throwing away the code.

lxwinspur commented 3 years ago

Should also think about making associations between cores and cpus?

could you show an example? Thanks :)

dkodihal commented 3 years ago

Should also think about making associations between cores and cpus? As opposed to determining this from D-Bus pathnames? Something to discuss @gtmills.

@gtmills @lxwinspur I had a discussion about this a while back on the OpenBMC IRC (with Patrick, Ed and others). Though this is not documented yet, but the consensus seemed to be to use pathnames for containment (cores under a CPU) and to use associations for logical relations (main memory accessible to a CPU). So pathnames seems to be okay to do here.

gtmills commented 3 years ago

That seems reasonable to me to use the D-Bus path here.

lxwinspur commented 3 years ago

review by: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38570

mzipse commented 2 years ago

refresh

gtmills commented 1 year ago

@lxwinspur Can we get this in?

lxwinspur commented 1 year ago

Sure

gtmills commented 7 months ago

@lxwinspur Can you update this https://gerrit.openbmc.org/c/openbmc/bmcweb/+/38570 ?

lxwinspur commented 6 months ago

@lxwinspur Can you update this https://gerrit.openbmc.org/c/openbmc/bmcweb/+/38570 ?

Updated