From: Dan Williams <dan.j.williams@intel.com>
To: Vishal Verma <vishal.l.verma@intel.com>
Cc: linux-nvdimm@lists.01.org
Subject: Re: [ndctl PATCH v2 3/4] ndctl: add a new command - inject-smart
Date: Thu, 8 Feb 2018 22:31:20 -0800 [thread overview]
Message-ID: <CAPcyv4jKE4iosbHq1NgemQTbdMev5zMsDagGa+kEA4APb8A_2w@mail.gmail.com> (raw)
In-Reply-To: <20180209053500.6871-3-vishal.l.verma@intel.com>
On Thu, Feb 8, 2018 at 9:34 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> Add an inject-smart command to ndctl to allow injection of smart fields,
> and setting of smart thresholds. If a field is injected that breaches
> the threshold, or sets a fatal flag, or if a new threshold is set that
> causes the same effect, generate an acpi health even notification.
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
> Documentation/ndctl/ndctl-inject-smart.txt | 102 +++++++
> builtin.h | 1 +
> ndctl/Makefile.am | 3 +-
> ndctl/inject-smart.c | 436 +++++++++++++++++++++++++++++
> ndctl/ndctl.c | 1 +
> 5 files changed, 542 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/ndctl/ndctl-inject-smart.txt
> create mode 100644 ndctl/inject-smart.c
>
> v2: Change inject-smart semantics to avoid sub-commands like --inject
> and --set. Instead allow injection and threshold setting all in one
> command by making each a distinct option. (Dan)
>
> diff --git a/Documentation/ndctl/ndctl-inject-smart.txt b/Documentation/ndctl/ndctl-inject-smart.txt
> new file mode 100644
> index 0000000..212bca0
> --- /dev/null
> +++ b/Documentation/ndctl/ndctl-inject-smart.txt
> @@ -0,0 +1,102 @@
> +ndctl-inject-smart(1)
> +=====================
> +
> +NAME
> +----
> +ndctl-inject-smart - perform smart threshold/injection operations on a DIMM
> +
> +SYNOPSIS
> +--------
> +[verse]
> +'ndctl inject-smart' <dimm> [<options>]
> +
> +DESCRIPTION
> +-----------
> +A generic DIMM device object, named /dev/nmemX, is registered for each
> +memory device indicated in the ACPI NFIT table, or other platform NVDIMM
> +resource discovery mechanism.
> +
> +ndctl-inject-smart can be used to set smart thresholds, and inject smart
> +attributes.
> +
> +EXAMPLES
> +--------
> +
> +Set smart controller temperature and spares threshold for DIMM-0 to 32C, spares
> +threshold to 8, and enable the spares alarm.
> +[verse]
> +ndctl inject-smart --ctrl-temperature-threshold=32 --spares-threshold=8 --spares-alarm nmem0
> +
> +Inject a media temperature value of 52 and fatal health status flag for DIMM-0
> +[verse]
> +ndctl inject-smart --media-temperature=52 --health=fatal nmem0
> +
> +
> +OPTIONS
> +-------
> +-b::
> +--bus=::
> + Enforce that the operation only be carried on devices that are
> + attached to the given bus. Where 'bus' can be a provider name or a bus
> + id number.
> +
> +-m::
> +--media-temperature=::
> + Inject <value> for the media temperature smart attribute.
> +
> +-M::
> +--media-temperature-threshold=::
> + Set <value> for the smart media temperature threshold.
> +
> +--media-temperature-alarm=::
> + Enable or disable the smart media temperature alarm. Options are
> + 'on' or 'off'.
> +
> +-c::
> +--ctrl-temperature=::
> + Inject <value> for the controller temperature smart attribute.
> +
> +-C::
> +--ctrl-temperature-threshold=::
> + Set <value> for the smart controller temperature threshold.
> +
> +--ctrl-temperature-alarm=::
> + Enable or disable the smart controller temperature alarm. Options are
> + 'on' or 'off'.
> +
> +-s::
> +--spares=::
> + Inject <value> for the spares smart attribute.
> +
> +-S::
> +--spares-threshold=::
> + Set <value> for the smart spares threshold.
> +
> +--spares-alarm=::
> + Enable or disable the smart spares alarm. Options are 'on' or 'off'.
> +
> +-H::
> +--health=::
> + Smart attribute for health status. Provide either 'fatal' or 'nominal'
> + to set the state of the attribute.
> +
> +-U::
> +--unsafe-shutdown=::
> + Set the flag to spoof an unsafe shutdown on the next power down.
> +
> +-v::
> +--verbose::
> + Emit debug messages for the error injection process
Nice, and I like your short option choices too.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2018-02-09 6:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 5:34 [ndctl PATCH v2 1/4] ndctl, inject-error: error out for a non-existent namespace Vishal Verma
2018-02-09 5:34 ` [ndctl PATCH v2 2/4] ndctl: add ndctl_encode_smart_temperature() Vishal Verma
2018-02-09 5:34 ` [ndctl PATCH v2 3/4] ndctl: add a new command - inject-smart Vishal Verma
2018-02-09 6:31 ` Dan Williams [this message]
2018-02-09 5:35 ` [ndctl PATCH v2 4/4] ndctl, bash-completion: Add bash completion for inject-smart Vishal Verma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPcyv4jKE4iosbHq1NgemQTbdMev5zMsDagGa+kEA4APb8A_2w@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=linux-nvdimm@lists.01.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).