commit | 76f455e440fb73888698a1f129f9c8824abde016 | [log] [tgz] |
---|---|---|
author | Potin Lai <potin.lai@quantatw.com> | Thu Sep 22 00:11:26 2022 +0800 |
committer | Potin Lai <potin.lai@quantatw.com> | Thu Oct 06 11:03:00 2022 +0800 |
tree | 065f56229dee8dccb05c3d414b031d34f642ecba | |
parent | aef8fa0dd6506907cc863445c27d21c6700d52a4 [diff] |
nvmes: add Availability interface Add Availability interface. When PwrGoodPin is low, Set Available property to false to indicate this sensor is currently unavilable due to power loss. Tested on Bletchley: - PwrGoodPin is low root@bletchley:~# busctl introspect xyz.openbmc_project.nvme.manager \ > /xyz/openbmc_project/sensors/temperature/nvme6 \ > xyz.openbmc_project.Sensor.Value NAME TYPE SIGNATURE RESULT/VALUE FLAGS .MaxValue property d 127 emits-change writable .MinValue property d -127 emits-change writable .Unit property s "xyz.openbmc_project.Sensor.Value.Uni... emits-change writable .Value property d -127 emits-change writable root@bletchley:~# busctl introspect xyz.openbmc_project.nvme.manager \ > /xyz/openbmc_project/sensors/temperature/nvme6 \ > xyz.openbmc_project.State.Decorator.Availability NAME TYPE SIGNATURE RESULT/VALUE FLAGS .Available property b false emits-change writable - PwrGoodPin is high root@bletchley:~# busctl introspect xyz.openbmc_project.nvme.manager \ > /xyz/openbmc_project/sensors/temperature/nvme6 \ > xyz.openbmc_project.Sensor.Value NAME TYPE SIGNATURE RESULT/VALUE FLAGS .MaxValue property d 127 emits-change writable .MinValue property d -127 emits-change writable .Unit property s "xyz.openbmc_project.Sensor.Value.Uni... emits-change writable .Value property d 33 emits-change writable root@bletchley:~# busctl introspect xyz.openbmc_project.nvme.manager \ > /xyz/openbmc_project/sensors/temperature/nvme6 \ > xyz.openbmc_project.State.Decorator.Availability NAME TYPE SIGNATURE RESULT/VALUE FLAGS .Available property b true emits-change writable Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I0b621ae619dde85607c635912c7230bbe9de22ac
phosphor-nvme is the nvme manager service maintains for NVMe drive information update and related notification processing service. The service update information to xyz/openbmc_project/Nvme/Status.interface.yaml
, xyz/openbmc_project/Sensor/Value.interface.yaml
and other interfaces in xyz.openbmc_project.Inventory.Manager
.
The service xyz.openbmc_project.nvme.manager
provides object on D-Bus:
where object implements interface xyz.openbmc_project.Sensor.Value
.
NVMe drive export as sensor and sensor value is temperature of drive. It can get the sensor value of the drive through ipmitool command sdr elist
if the corresponding settings in the sensor map are configured correctly. For example:
To get sensor value:
### With ipmi command on BMC ipmitool sdr elist
The service also updates other NVMe drive information to D-bus xyz.openbmc_project.Inventory.Manager
. The service xyz.openbmc_project.Inventory.Manager
provides object on D-Bus:
where object implements interfaces:
Interface xyz.openbmc_project.Nvme.Status
with the following properties:
Property | Type | Description |
---|---|---|
SmartWarnings | string | Indicates smart warnings for the state |
StatusFlags | string | Indicates the status of the drives |
DriveLifeUsed | string | A vendor specific estimate of the percentage |
TemperatureFault | bool | If warning type about temperature happened |
BackupdrivesFault | bool | If warning type about backup drives happened |
CapacityFault | bool | If warning type about capacity happened |
DegradesFault | bool | If warning type about degrades happened |
MediaFault | bool | If warning type about media happened |
Interface xyz.openbmc_project.Inventory.Item
with the following properties:
Property | Type | Description |
---|---|---|
Present | bool | Whether or not the item is present |
Interface xyz.openbmc_project.Inventory.Decorator.Asset
with the following properties:
Property | Type | Description |
---|---|---|
SerialNumber | string | The item serial number |
Manufacturer | string | The item manufacturer |
Each property in the inventory manager can be obtained via the busctl get-property command. For example:
To get property Present:
### With busctl on BMC busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/nvme0 xyz.openbmc_project.Inventory.Item Present
There is a JSON configuration file nvme_config.json
for drive index, bus ID, and the LED object path and bus name for each drive. For example,
{ "config": [ { "NVMeDriveIndex": 0, "NVMeDriveBusID": 16, "NVMeDriveFaultLEDGroupPath": "/xyz/openbmc_project/led/groups/led_u2_0_fault", "NVMeDriveLocateLEDGroupPath": "/xyz/openbmc_project/led/groups/led_u2_0_locate", "NVMeDriveLocateLEDControllerBusName":"xyz.openbmc_project.LED.Controller.led_u2_0_locate", "NVMeDriveLocateLEDControllerPath":"/xyz/openbmc_project/led/physical/led_u2_0_locate", "NVMeDrivePresentPin": 148, "NVMeDrivePwrGoodPin": 161 }, { "NVMeDriveIndex": 1, "NVMeDriveBusID": 17, "NVMeDriveFaultLEDGroupPath": "/xyz/openbmc_project/led/groups/led_u2_1_fault", "NVMeDriveLocateLEDGroupPath": "/xyz/openbmc_project/led/groups/led_u2_1_locate", "NVMeDriveLocateLEDControllerBusName":"xyz.openbmc_project.LED.Controller.led_u2_1_locate", "NVMeDriveLocateLEDControllerPath":"/xyz/openbmc_project/led/physical/led_u2_1_locate", "NVMeDrivePresentPin": 149, "NVMeDrivePwrGoodPin": 162 } ], "threshold":[ { "criticalHigh":70, "criticalLow":0, "maxValue":70, "minValue":0 } ] }
xyz.openbmc_project.nvme.manager
description above.This service will run automatically and look up NVMe drives every second.