Dan Williams wrote on 2016-09-03: > On Fri, Sep 2, 2016 at 6:32 AM, Brian Boylston <[email protected]> wrote: >> This patch introduces util_hpe_dimm_health_to_json(), which calls the HPE >> DSM functions defined in [1] and populates a JSON object with health data. >> This delivers health reporting parity for HPE type N NVDIMMs, but we are >> planning a future patch to export JSON for some of the additional health >> data defined in [1]. >> >> [1] >> https://github.com/HewlettPackard/hpe-nvm/raw/master/Documentation/NFIT_ >> DSM_DDR4_NVDIMM- N_v84s.pdf >> >> Cc: Dan Williams <[email protected]> >> Reviewed-by: Jerry Hoemann <[email protected]> >> Signed-off-by: Brian Boylston <[email protected]> >> --- >> ndctl/Makefile.am | 1 + >> ndctl/builtin-list.c | 2 + >> ndctl/util/json-hpe.c | 283 ++++++++++++++++++++++++++++++++++++++++ >> ndctl/util/json.h | 6 + >> ndctl/util/ndctl-hpe1.h | 335 >> ++++++++++++++++++++++++++++++++++++++++++++++++ >> 5 files changed, 627 insertions(+) >> create mode 100644 ndctl/util/json-hpe.c >> create mode 100644 ndctl/util/ndctl-hpe1.h > > Great! Let's get this merged... > >> diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am >> index 04f3a63..ee1e856 100644 >> --- a/ndctl/Makefile.am >> +++ b/ndctl/Makefile.am >> @@ -48,6 +48,7 @@ ndctl_SOURCES = ndctl.c \ >> >> if ENABLE_SMART ndctl_SOURCES += util/json-smart.c +ndctl_SOURCES += >> util/json-hpe.c endif >> >> if ENABLE_DESTRUCTIVE >> diff --git a/ndctl/builtin-list.c b/ndctl/builtin-list.c >> index 0875ca9..fb1a361 100644 >> --- a/ndctl/builtin-list.c >> +++ b/ndctl/builtin-list.c >> @@ -316,6 +316,8 @@ int cmd_list(int argc, const char **argv) >> struct json_object *jhealth; >> >> jhealth = util_dimm_health_to_json(dimm); >> + if (!jhealth) >> + jhealth = >> util_hpe_dimm_health_to_json(dimm); >> if (jhealth) > > I'd rather see ndctl_dimm_cmd_new_smart() learn how to generate the > smart health cmd that is proper for the given family of the dimm, and > handle any command format translation internal to the library rather > than adding a separate util_dimm_health_to_json().
Thanks for the guidance, Dan. I'll work on this and come back. Brian _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
