mbox series

[ndctl,0/2] add support for Set Alert Configuration mailbox command

Message ID 20230711071019.7151-1-jehoon.park@samsung.com
Headers show
Series add support for Set Alert Configuration mailbox command | expand

Message

Jehoon Park July 11, 2023, 7:10 a.m. UTC
CXL 3.0 Spec 8.2.9.8.3.3 defines Set Alert Configuration mailbox command.
This patchset adds support for the command to configure warning alert.

Example:
# ./cxl set-alert-config mem0 -L 30 --life-used-alert=on
{
  "memdev":"mem0",
  "ram_size":"1024.00 MiB (1073.74 MB)",
  "alert_config":{
    "life_used_prog_warn_threshold_valid":true,
    "dev_over_temperature_prog_warn_threshold_valid":false,
    "dev_under_temperature_prog_warn_threshold_valid":false,
    "corrected_volatile_mem_err_prog_warn_threshold_valid":false,
    "corrected_pmem_err_prog_warn_threshold_valid":false,
    "life_used_prog_warn_threshold_writable":true,
    "dev_over_temperature_prog_warn_threshold_writable":true,
    "dev_under_temperature_prog_warn_threshold_writable":true,
    "corrected_volatile_mem_err_prog_warn_threshold_writable":true,
    "corrected_pmem_err_prog_warn_threshold_writable":true,
    "life_used_crit_alert_threshold":75,
    "life_used_prog_warn_threshold":30,
    "dev_over_temperature_crit_alert_threshold":0,
    "dev_under_temperature_crit_alert_threshold":0,
    "dev_over_temperature_prog_warn_threshold":0,
    "dev_under_temperature_prog_warn_threshold":0,
    "corrected_volatile_mem_err_prog_warn_threshold":0,
    "corrected_pmem_err_prog_warn_threshold":0
  },
  "serial":"0",
  "host":"0000:0d:00.0"
}
cxl memdev: cmd_set_alert_config: set alert configuration 1 mem

The implementation is based on the 'ndctl-inject-smart'. Variable and function
names are aligned with the implementation of 'Get Alert Configuration'.

Jehoon Park (2):
  libcxl: add support for Set Alert Configuration mailbox command
  cxl: add 'set-alert-config' command to cxl tool

 Documentation/cxl/cxl-set-alert-config.txt |  96 +++++++++
 Documentation/cxl/lib/libcxl.txt           |   1 +
 Documentation/cxl/meson.build              |   1 +
 cxl/builtin.h                              |   1 +
 cxl/cxl.c                                  |   1 +
 cxl/lib/libcxl.c                           |  21 ++
 cxl/lib/libcxl.sym                         |  12 ++
 cxl/lib/private.h                          |  12 ++
 cxl/libcxl.h                               |  16 ++
 cxl/memdev.c                               | 219 ++++++++++++++++++++-
 10 files changed, 379 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/cxl/cxl-set-alert-config.txt


base-commit: 7f75ce36ce3a0d41ed74d4e2dfcfd41a6fd7fe40