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.

But anyway nice job Brian (way better than my attempts to "live patch"
the ioctls in the kernel)

Byte,
        Johannes

-- 
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to