commit | 097562e751d5cd9bf221fa8212cf40a7ea468c3f | [log] [tgz] |
---|---|---|
author | Joseph.Fu <Joseph.Fu@quantatw.com> | Tue Apr 16 14:40:49 2024 +0800 |
committer | Joseph.Fu <Joseph.Fu@quantatw.com> | Tue Apr 16 19:28:40 2024 +0800 |
tree | 0f92e37196005ae729861cc4848bfd37f5b33656 | |
parent | ab6d79bb1c8f9431e215f2de73ff6ce4e0378f72 [diff] |
nvme_manager: support status flag check NVMe handler responds with incorrect raw data sometime, which records abnormal value and triggers critical event. Support checking "drive not ready" bit to avoid temperature reading when NVMe is unavailable. This bit is defined in Figure 176 on page 155 of the NVMe specification. ``` Ref: https://nvmexpress.org/wp-content/uploads/NVM-Express-Management-Interface-Specification-1.2c-2022.10.06-Ratified-1.pdf ``` Tested: ``` ~# journalctl -u xyz.openbmc_project.nvme.manager.service Jan 01 23:20:35 gbs systemd[1]: Starting NVMe management... Jan 01 23:20:35 gbs systemd[1]: Started NVMe management. Jan 01 23:20:36 gbs nvme_main[14995]: SSD plug. Jan 01 23:20:36 gbs nvme_main[14995]: SSD plug. Jan 01 23:20:36 gbs nvme_main[14995]: SSD plug. Jan 01 23:20:36 gbs nvme_main[14995]: SSD plug. Jan 01 23:44:58 gbs nvme_main[14995]: Drive not ready! Jan 01 23:44:58 gbs nvme_main[14995]: Drive status is good but can not get data. ``` Change-Id: I805a3b3748070d5b220f3d71aa93812f852a964d Signed-off-by: Joseph.Fu <Joseph.Fu@quantatw.com>
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.