|
Extend handleFabricSwitchPathSwitchGet() in fabric.hpp to read
xyz.openbmc_project.State.Decorator.PowerState from the resolved Switch
D-Bus path and surface the value as the Redfish PowerState property on
/redfish/v1/Fabrics/{FabricId}/Switches/{SwitchId}.
Tested: Build an image for nvl32-obmc machine with the following
patches cherry-picked:
1. Align with upstream u-boot dts tree:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89932
2. mctpd configuration:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/87390
3. Enable nvidia-gpu sensor:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89933
4. nvidia-gpu: add PowerState on ConnectX PCIeDevice:
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/90170
$ curl -sk https://{BMC_IP}/redfish/v1/Fabrics/fabric/Switches/\
Nvidia_ConnectX_24_PCIe
{
"@odata.id":
"/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_24_PCIe",
"@odata.type": "#Switch.v1_7_0.Switch",
"Id": "Nvidia_ConnectX_24_PCIe",
"Name": "Nvidia_ConnectX_24_PCIe",
"Ports": {
"@odata.id":
".../Switches/Nvidia_ConnectX_24_PCIe/Ports"
},
"PowerState": "On",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
$ busctl get-property xyz.openbmc_project.GpuSensor \
/xyz/openbmc_project/inventory/Nvidia_ConnectX_24_PCIe \
xyz.openbmc_project.State.Decorator.PowerState PowerState
s "xyz.openbmc_project.State.Decorator.PowerState.State.On"
```
Redfish Service Validator:
Summary - PASS: 9752, WARN: 373, FAIL: 0, NOT TESTED: 13355
Validating /redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_24_PCIe...
- Pass: 9, Warn: 0, Fail: 0, Skip: 32
Validating /redfish/v1/Fabrics/fabric/Switches/Terminus_18_PCIeSwitch_1_100...
- Pass: 8, Warn: 0, Fail: 0, Skip: 33
```
Change-Id: I4bc636664ae74280b72eab13219e5bf5b1e79a85
Signed-off-by: JY Voon <jvoon@nvidia.com>
|
|
This patch enable support for following properties for Port of a PCIe
Switch. [1]
- PortProtocol
- PortType
- CurrentSpeedGbps
- ActiveWidth
One of the devices that gets enabled with this patch is Nvidia ConnectX
devices, which are network cards featuring an integrated PCIe switch.
These devices combine both PCIe ports and network ports in a single
unit. Since such devices don't strictly qualify as Fabric Adapters, the
Switch URI is used instead of the FabricAdapter URI.
Port schema only allows certain URIs as Port URI. URI
/redfish/v1/Fabrics/{FabricId}/Switches/{SwitchId}/Ports/{PortId} seems
most appropriate choice for PCIe Switch Port. [1]
The Fabric resource is modeled similarly to the System resource, meaning
that only one Fabric resource will exist for each BMC. Route handler for
collections and each individual components are added in this patch for
each URI resource under /redfish/v1/Fabrics.
DBus Interface "xyz.openbmc_project.Inventory.Item.PCIeSwitch" is used
to identify the Switch resources. Association between Switch and Port is
`connecting` and `connected_to`.
Feature like Port Metrics properties (for PCIe Error Counters) can be
added in future at Port Metric URI.
dbus-sensors patches -
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84079
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/83202
Tested: Build an image for nvl32-obmc machine with the following patch
cherry picked.
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84079
https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490
The openbmc patch cherry-picks the following patches that are currently
under review.
```
1. device tree
https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/
2. mctpd patches
https://github.com/CodeConstruct/mctp/pull/85
3. u-boot changes
https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t
4. kernel changes as specified in the openbmc patch (for espi)
5. entity-manager changes
https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455
6. platform-init changes
https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456
7. spi changes
https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/
```
redfish service validator is passing.
```
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/
{
"@odata.id": "/redfish/v1/Fabrics",
"@odata.type": "#FabricCollection.FabricCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Fabrics/fabric"
}
],
"Members@odata.count": 1,
"Name": "Fabric Collection"
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/
{
"@odata.id": "/redfish/v1/Fabrics/fabric",
"@odata.type": "#Fabric.v1_2_0.Fabric",
"Id": "fabric",
"Name": "fabric Fabric",
"Switches": {
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches"
}
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches",
"@odata.type": "#SwitchCollection.SwitchCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_1"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_2"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_3"
}
],
"Members@odata.count": 4,
"Name": "fabric Switch Collection"
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0",
"@odata.type": "#Switch.v1_7_0.Switch",
"Id": "Nvidia_ConnectX_0",
"Name": "Nvidia_ConnectX_0",
"Ports": {
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports"
},
"Status": {
"Health": "OK",
"State": "Enabled"
}
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports",
"@odata.type": "#PortCollection.PortCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/DOWN_0"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/DOWN_1"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0"
}
],
"Members@odata.count": 3,
"Name": "Nvidia_ConnectX_0 Port Collection"
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0",
"@odata.type": "#Port.v1_4_0.Port",
"ActiveWidth": 8,
"CurrentSpeedGbps": 32.0,
"Id": "UP_0",
"Metrics": {
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/Metrics"
},
"Name": "Nvidia_ConnectX_0 UP_0 Port",
"PortProtocol": "PCIe",
"PortType": "UpstreamPort",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}%
```
[1]: https://redfish.dmtf.org/schemas/v1/Port_v1.xml
Change-Id: I52f4ca62b4953f6196c589e340602a0d7885d9c1
Signed-off-by: Harshit Aghera <haghera@nvidia.com>
|