Johannes Thumshirn wrote on 2016-09-02: > On Fri, Sep 02, 2016 at 08:32:38AM -0500, Brian Boylston 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 >> 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); > > Try and error probing for the correct vendor? There surely must be a > better way to do.
Yes, sorry, I had intended to raise this in the cover, but forgot. util_dimm_health_to_json() results in a check to see if ND_CMD_SMART is supported by the device. It isn't supported by our type N DIMMs, so I don't think ndctl gets as far as actually attempting the ioctl. I didn't see an existing ndctl_dimm_is_cmd_supported() equivalent for the DSM families (NVDIMM_FAMILY_*), so I started with the smallest change to the existing framework. Any suggestions here? What about adding an ndctl_dimm_is_family_supported()? Is there a way to determine support other than by probing (e.g. trying function 0 for each family)? > > But anyway nice job Brian (way better than my attempts to "live patch" > the ioctls in the kernel) Thanks. The similarities in the interface make it tempting, but massaging the differences probably becomes awkward. Brian _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
