[PATCH v6] ndctl: add option to list firmware information for a DIMM
by Dave Jiang
Adding firmware output of firmware information when ndctl list -D -F is used.
Components displayed are current firmware version, updated firmware version,
and if a coldboot is required (firmware updated).
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
Tested-by: Jeff Moyer <jmoyer(a)redhat.com>
---
v6:
- changed all instaces of API calls of updated_version to next_version for
better clarity. Data structure for Intel DSM not changed.
- changed coldboot_required to need_powercycle for better clarity.
v5:
- Changed next_version to updated version to be in sync with DSM spec.
- Changed emission of "unknown" string to -1 for error versions.
v4:
- Remove output when updated_version is 0. That indicates no updated firmware.
v3:
- Fixed issue where it skips displaying rest of the details if there's no
firmware details.
v2:
- Added copyright
- Added support for human readable option (hex) for versions
- Removed check against CMD_CALL as it's not useful
---
Dave Jiang (1):
ndctl: add option to list firmware information for a DIMM
Documentation/ndctl/ndctl-list.txt | 13 +++++
ndctl/Makefile.am | 1
ndctl/lib/firmware.c | 2 -
ndctl/lib/intel.c | 12 ++++-
ndctl/lib/libndctl.sym | 2 -
ndctl/lib/private.h | 2 -
ndctl/libndctl.h | 2 -
ndctl/list.c | 13 +++++
ndctl/util/json-firmware.c | 91 ++++++++++++++++++++++++++++++++++++
util/json.h | 2 +
10 files changed, 134 insertions(+), 6 deletions(-)
create mode 100644 ndctl/util/json-firmware.c
--
2 years, 11 months
[RFC PATCH v3 0/5] ndctl: monitor: monitor the smart events of
by QI Fuli
This is a patch set of ndctl monitor, a tiny daemon to monitor the smart
events of nvdimm dimms. When a smart event fires, monitor will output
the notification which including dimm health status to syslog or a
special file according to users' configuration. The output notification
follows json format and can be consumed by log collectors like Fluentd.
Currently, I implemeted the following four commands to control monitor daemon.
$ndctl create-monitor
$ndctl list-monitor
$ndctl show-monitor
$ndclt destroy-monitor
I will appreciate if you could give some comments.
Change log since v2:
- Changing the interface of daemon to the ndctl command line
- Changing the name of daemon form "nvdimmd" to "monitor"
- Removing the config file, unit_file, nvdimmd dir
- Removing nvdimmd_test program
- Adding ndctl/monitor.c
Change log since v1:
- Adding a config file(/etc/nvdimmd/nvdimmd.conf)
- Using struct log_ctx instead of syslog()
- Using log_syslog() to save the notify messages to syslog
- Using log_file() to save the notify messages to special file
- Adding LOG_NOTICE level to log_priority
- Using automake instead of Makefile
- Adding a new util file(nvdimmd/util.c) including helper functions
needed for nvdimm daemon
- Adding nvdimmd_test program
QI Fuli (5):
ndctl: monitor: add LOG_NOTICE level to log_priority
ndctl: monitor: add ndclt create-monitor command
ndctl: monitor: add ndclt list-monitor command
ndctl: monitor: add ndclt show-monitor command
ndctl: monitor: add ndclt destroy-monitor command
builtin.h | 4 +
configure.ac | 3 +
ndctl/Makefile.am | 3 +-
ndctl/monitor.c | 463 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
ndctl/ndctl.c | 4 +
util/log.c | 2 +
util/log.h | 3 +
7 files changed, 481 insertions(+), 1 deletion(-)
create mode 100644 ndctl/monitor.c
--
2.9.5
2 years, 11 months
[PATCH v5 0/3] minimal DAX support for XFS realtime device
by Dave Jiang
Darrick,
After reading the comments from you, Dave Chinner, and Dan, it looks like
the dyanmic S_DAX flag support won't be coming or not any time soon at the
least. Here are the the collection of patches so far to address yours and
Dave C's comments for minimal support. Please let me know what else I am
missing. Thanks!
v5:
- Removed sb parameter for bdev_dax_supported() since we only use it for
debug output per Christoph comment.
v4:
- Removed setting of error return in ext2 and ext4 per Ross's comments
- Rebased against 4.16-rc1 with updates
---
Darrick J. Wong (1):
fs: allow per-device dax status checking for filesystems
Dave Jiang (2):
dax: change bdev_dax_supported() to support boolean returns
xfs: reject removal of realtime flag when datadev doesn't support DAX
drivers/dax/super.c | 44 ++++++++++++++++++++++----------------------
fs/ext2/super.c | 3 +--
fs/ext4/super.c | 3 +--
fs/xfs/xfs_ioctl.c | 17 ++++++++++++++++-
fs/xfs/xfs_iops.c | 30 +++++++++++++++++++++++++-----
fs/xfs/xfs_super.c | 10 ++++++++--
include/linux/dax.h | 12 ++++--------
7 files changed, 77 insertions(+), 42 deletions(-)
--
2 years, 11 months
[PATCH v5] ndctl: add option to list firmware information for a DIMM
by Dave Jiang
Adding firmware output of firmware information when ndctl list -D -F is used.
Components displayed are current firmware version, updated firmware version,
and if a coldboot is required (firmware updated).
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
Tested-by: Jeff Moyer <jmoyer(a)redhat.com>
---
v5:
- Changed next_version to updated version to be in sync with DSM spec.
- Changed emission of "unknown" string to -1 for error versions.
v4:
- Remove output when updated_version is 0. That indicates no updated firmware.
v3:
- Fixed issue where it skips displaying rest of the details if there's no
firmware details.
v2:
- Added copyright
- Added support for human readable option (hex) for versions
- Removed check against CMD_CALL as it's not useful
Documentation/ndctl/ndctl-list.txt | 13 +++++
ndctl/Makefile.am | 1
ndctl/list.c | 13 +++++
ndctl/util/json-firmware.c | 91 ++++++++++++++++++++++++++++++++++++
util/json.h | 2 +
5 files changed, 120 insertions(+)
create mode 100644 ndctl/util/json-firmware.c
diff --git a/Documentation/ndctl/ndctl-list.txt b/Documentation/ndctl/ndctl-list.txt
index fc07a71..85b87d4 100644
--- a/Documentation/ndctl/ndctl-list.txt
+++ b/Documentation/ndctl/ndctl-list.txt
@@ -110,6 +110,19 @@ include::xable-region-options.txt[]
}
}
+-F::
+--firmware::
+ Include dimm firmware info in the listing. For example:
+[verse]
+{
+ "dev":"nmem0",
+ "firmware":{
+ "current_version":0,
+ "next_version":1,
+ "coldboot_required":true
+ }
+}
+
-X::
--device-dax::
Include device-dax ("daxregion") details when a namespace is in
diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am
index 2054c1a..e0db97b 100644
--- a/ndctl/Makefile.am
+++ b/ndctl/Makefile.am
@@ -13,6 +13,7 @@ ndctl_SOURCES = ndctl.c \
test.c \
../util/json.c \
util/json-smart.c \
+ util/json-firmware.c \
inject-error.c \
update.c \
inject-smart.c
diff --git a/ndctl/list.c b/ndctl/list.c
index 37a224a..8bb9920 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -35,6 +35,7 @@ static struct {
bool dax;
bool media_errors;
bool human;
+ bool firmware;
} list;
static unsigned long listopts_to_flags(void)
@@ -277,6 +278,7 @@ int cmd_list(int argc, const char **argv, void *ctx)
"filter by region-type"),
OPT_BOOLEAN('B', "buses", &list.buses, "include bus info"),
OPT_BOOLEAN('D', "dimms", &list.dimms, "include dimm info"),
+ OPT_BOOLEAN('F', "firmware", &list.firmware, "include firmware info"),
OPT_BOOLEAN('H', "health", &list.health, "include dimm health"),
OPT_BOOLEAN('R', "regions", &list.regions,
"include region info"),
@@ -420,6 +422,17 @@ int cmd_list(int argc, const char **argv, void *ctx)
}
}
+ if (list.firmware) {
+ struct json_object *jfirmware;
+
+ jfirmware = util_dimm_firmware_to_json(dimm,
+ listopts_to_flags());
+ if (jfirmware)
+ json_object_object_add(jdimm,
+ "firmware",
+ jfirmware);
+ }
+
/*
* Without a bus we are collecting dimms anonymously
* across the platform.
diff --git a/ndctl/util/json-firmware.c b/ndctl/util/json-firmware.c
new file mode 100644
index 0000000..96271e4
--- /dev/null
+++ b/ndctl/util/json-firmware.c
@@ -0,0 +1,91 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright(c) 2018 Intel Corporation. All rights reserved. */
+#include <limits.h>
+#include <util/json.h>
+#include <uuid/uuid.h>
+#include <json-c/json.h>
+#include <ndctl/libndctl.h>
+#include <ccan/array_size/array_size.h>
+#include <ndctl.h>
+
+struct json_object *util_dimm_firmware_to_json(struct ndctl_dimm *dimm,
+ unsigned long flags)
+{
+ struct json_object *jfirmware = json_object_new_object();
+ struct json_object *jobj;
+ struct ndctl_cmd *cmd;
+ int rc;
+ uint64_t run, updated;
+ bool reboot = false;
+
+ if (!jfirmware)
+ return NULL;
+
+ cmd = ndctl_dimm_cmd_new_fw_get_info(dimm);
+ if (!cmd)
+ goto err;
+
+ rc = ndctl_cmd_submit(cmd);
+ if (rc || ndctl_cmd_fw_xlat_firmware_status(cmd) != FW_SUCCESS) {
+ int run_err = -1;
+
+ jobj = util_json_object_hex(run_err, flags);
+ if (jobj)
+ json_object_object_add(jfirmware, "current_version",
+ jobj);
+ goto out;
+ }
+
+ run = ndctl_cmd_fw_info_get_run_version(cmd);
+ if (run == ULLONG_MAX) {
+ int run_err = -1;
+
+ jobj = util_json_object_hex(run_err, flags);
+ if (jobj)
+ json_object_object_add(jfirmware, "current_version",
+ jobj);
+ goto out;
+ }
+
+ jobj = util_json_object_hex(run, flags);
+ if (jobj)
+ json_object_object_add(jfirmware, "current_version", jobj);
+
+ updated = ndctl_cmd_fw_info_get_updated_version(cmd);
+ if (updated == ULLONG_MAX) {
+ int updated_err = -1;
+
+ jobj = util_json_object_hex(updated_err, flags);
+ if (jobj)
+ json_object_object_add(jfirmware, "updated_version",
+ jobj);
+ goto out;
+ }
+
+ if (updated != 0) {
+ reboot = true;
+ jobj = util_json_object_hex(updated, flags);
+ if (jobj)
+ json_object_object_add(jfirmware,
+ "updated_version", jobj);
+ }
+
+ if (reboot) {
+ jobj = json_object_new_boolean(reboot);
+ if (jobj)
+ json_object_object_add(jfirmware,
+ "coldboot_required", jobj);
+ }
+
+ ndctl_cmd_unref(cmd);
+ return jfirmware;
+
+err:
+ json_object_put(jfirmware);
+ jfirmware = NULL;
+out:
+ if (cmd)
+ ndctl_cmd_unref(cmd);
+ return jfirmware;
+}
+
diff --git a/util/json.h b/util/json.h
index 9663475..c5d1603 100644
--- a/util/json.h
+++ b/util/json.h
@@ -52,4 +52,6 @@ struct json_object *util_json_object_size(unsigned long long size,
struct json_object *util_json_object_hex(unsigned long long val,
unsigned long flags);
struct json_object *util_dimm_health_to_json(struct ndctl_dimm *dimm);
+struct json_object *util_dimm_firmware_to_json(struct ndctl_dimm *dimm,
+ unsigned long flags);
#endif /* __NDCTL_JSON_H__ */
2 years, 11 months
[PATCH v4] ndctl: add option to list firmware information for a DIMM
by Dave Jiang
Adding firmware output of firmware information when ndctl list -D -F is used.
Components displayed are current firmware version, updated firmware version,
and if a coldboot is required (firmware updated).
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
Tested-by: Jeff Moyer <jmoyer(a)redhat.com>
---
v4:
- Remove output when updated_version is 0. That indicates no updated firmware.
v3:
- Fixed issue where it skips displaying rest of the details if there's no
firmware details.
v2:
- Added copyright
- Added support for human readable option (hex) for versions
- Removed check against CMD_CALL as it's not useful
Documentation/ndctl/ndctl-list.txt | 13 +++++
ndctl/Makefile.am | 1
ndctl/list.c | 13 +++++
ndctl/util/json-firmware.c | 87 ++++++++++++++++++++++++++++++++++++
util/json.h | 2 +
5 files changed, 116 insertions(+)
create mode 100644 ndctl/util/json-firmware.c
diff --git a/Documentation/ndctl/ndctl-list.txt b/Documentation/ndctl/ndctl-list.txt
index fc07a71..85b87d4 100644
--- a/Documentation/ndctl/ndctl-list.txt
+++ b/Documentation/ndctl/ndctl-list.txt
@@ -110,6 +110,19 @@ include::xable-region-options.txt[]
}
}
+-F::
+--firmware::
+ Include dimm firmware info in the listing. For example:
+[verse]
+{
+ "dev":"nmem0",
+ "firmware":{
+ "current_version":0,
+ "next_version":1,
+ "coldboot_required":true
+ }
+}
+
-X::
--device-dax::
Include device-dax ("daxregion") details when a namespace is in
diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am
index 2054c1a..e0db97b 100644
--- a/ndctl/Makefile.am
+++ b/ndctl/Makefile.am
@@ -13,6 +13,7 @@ ndctl_SOURCES = ndctl.c \
test.c \
../util/json.c \
util/json-smart.c \
+ util/json-firmware.c \
inject-error.c \
update.c \
inject-smart.c
diff --git a/ndctl/list.c b/ndctl/list.c
index 37a224a..8bb9920 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -35,6 +35,7 @@ static struct {
bool dax;
bool media_errors;
bool human;
+ bool firmware;
} list;
static unsigned long listopts_to_flags(void)
@@ -277,6 +278,7 @@ int cmd_list(int argc, const char **argv, void *ctx)
"filter by region-type"),
OPT_BOOLEAN('B', "buses", &list.buses, "include bus info"),
OPT_BOOLEAN('D', "dimms", &list.dimms, "include dimm info"),
+ OPT_BOOLEAN('F', "firmware", &list.firmware, "include firmware info"),
OPT_BOOLEAN('H', "health", &list.health, "include dimm health"),
OPT_BOOLEAN('R', "regions", &list.regions,
"include region info"),
@@ -420,6 +422,17 @@ int cmd_list(int argc, const char **argv, void *ctx)
}
}
+ if (list.firmware) {
+ struct json_object *jfirmware;
+
+ jfirmware = util_dimm_firmware_to_json(dimm,
+ listopts_to_flags());
+ if (jfirmware)
+ json_object_object_add(jdimm,
+ "firmware",
+ jfirmware);
+ }
+
/*
* Without a bus we are collecting dimms anonymously
* across the platform.
diff --git a/ndctl/util/json-firmware.c b/ndctl/util/json-firmware.c
new file mode 100644
index 0000000..04297ec
--- /dev/null
+++ b/ndctl/util/json-firmware.c
@@ -0,0 +1,87 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright(c) 2018 Intel Corporation. All rights reserved. */
+#include <limits.h>
+#include <util/json.h>
+#include <uuid/uuid.h>
+#include <json-c/json.h>
+#include <ndctl/libndctl.h>
+#include <ccan/array_size/array_size.h>
+#include <ndctl.h>
+
+struct json_object *util_dimm_firmware_to_json(struct ndctl_dimm *dimm,
+ unsigned long flags)
+{
+ struct json_object *jfirmware = json_object_new_object();
+ struct json_object *jobj;
+ struct ndctl_cmd *cmd;
+ int rc;
+ uint64_t run, updated;
+ bool reboot = false;
+
+ if (!jfirmware)
+ return NULL;
+
+ cmd = ndctl_dimm_cmd_new_fw_get_info(dimm);
+ if (!cmd)
+ goto err;
+
+ rc = ndctl_cmd_submit(cmd);
+ if (rc || ndctl_cmd_fw_xlat_firmware_status(cmd) != FW_SUCCESS) {
+ jobj = json_object_new_string("unknown");
+ if (jobj)
+ json_object_object_add(jfirmware, "current_version",
+ jobj);
+ goto out;
+ }
+
+ run = ndctl_cmd_fw_info_get_run_version(cmd);
+ if (run == ULLONG_MAX) {
+ jobj = json_object_new_string("unknown");
+ if (jobj)
+ json_object_object_add(jfirmware, "current_version",
+ jobj);
+ goto out;
+ }
+
+ jobj = util_json_object_hex(run, flags);
+ if (jobj)
+ json_object_object_add(jfirmware, "current_version", jobj);
+
+ updated = ndctl_cmd_fw_info_get_updated_version(cmd);
+ if (updated == ULLONG_MAX) {
+ jobj = json_object_new_string("unknown");
+ if (jobj)
+ json_object_object_add(jfirmware, "next_version",
+ jobj);
+ goto out;
+ }
+
+ if (updated == 0)
+ goto out;
+ else {
+ reboot = true;
+ jobj = util_json_object_hex(updated, flags);
+ if (jobj)
+ json_object_object_add(jfirmware,
+ "next_version", jobj);
+ }
+
+ if (reboot) {
+ jobj = json_object_new_boolean(reboot);
+ if (jobj)
+ json_object_object_add(jfirmware,
+ "coldboot_required", jobj);
+ }
+
+ ndctl_cmd_unref(cmd);
+ return jfirmware;
+
+err:
+ json_object_put(jfirmware);
+ jfirmware = NULL;
+out:
+ if (cmd)
+ ndctl_cmd_unref(cmd);
+ return jfirmware;
+}
+
diff --git a/util/json.h b/util/json.h
index 9663475..c5d1603 100644
--- a/util/json.h
+++ b/util/json.h
@@ -52,4 +52,6 @@ struct json_object *util_json_object_size(unsigned long long size,
struct json_object *util_json_object_hex(unsigned long long val,
unsigned long flags);
struct json_object *util_dimm_health_to_json(struct ndctl_dimm *dimm);
+struct json_object *util_dimm_firmware_to_json(struct ndctl_dimm *dimm,
+ unsigned long flags);
#endif /* __NDCTL_JSON_H__ */
2 years, 11 months
Targeted B2B Companies Emails List
by sally.grant@dedicatedaccounts.com
Hi,
Would you be interested in Storage Application Users contact information in
excel sheet for unlimited marketing usage? We provide Top Decision Makers
information like Name, Email, Title, Phone and company details of companies
using Storage Applications.
EMC
VMware
Veeam
Dell Storage
Acronis
Brocade
Symantec
Nutanix
HP
We also provide IT Decision Makers, Sales and Marketing Decision Makers,
C-level Titles and other titles as per your requirement.
Please let me know your thoughts so that I can send you cost of the list.
Regards,
Sally Grant
Storage Application Consultant
| List acquisition | Technology Lists | Email/Data Appending | Search
Engine Optimization |
If you don't want to include yourself in our mailing list, please reply
back “Leave Out"" in a subject line
2 years, 11 months
[PATCH v2 1/2] ndctl: add support for acknolwedge shutdown count enable
by Dave Jiang
Adding generic support for Ack Shutdown Count enable and the
Enable Latch System Shutdown Status (Function Index 10) for
DSM v1.6 spec.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
0 files changed
diff --git a/ndctl/lib/intel.c b/ndctl/lib/intel.c
index 8daf5d2..c40df95 100644
--- a/ndctl/lib/intel.c
+++ b/ndctl/lib/intel.c
@@ -626,6 +626,22 @@ intel_cmd_fw_xlat_firmware_status(struct ndctl_cmd *cmd)
return FW_EUNKNOWN;
}
+static struct ndctl_cmd *
+intel_dimm_cmd_new_lss(struct ndctl_dimm *dimm)
+{
+ struct ndctl_cmd *cmd;
+
+ BUILD_ASSERT(sizeof(struct nd_intel_lss) == 5);
+
+ cmd = alloc_intel_cmd(dimm, ND_INTEL_ENABLE_LSS_STATUS, 1, 4);
+ if (!cmd)
+ return NULL;
+
+ cmd->intel->lss.enable = 1;
+ cmd->firmware_status = &cmd->intel->lss.status;
+ return cmd;
+}
+
struct ndctl_dimm_ops * const intel_dimm_ops = &(struct ndctl_dimm_ops) {
.cmd_desc = intel_cmd_desc,
.new_smart = intel_dimm_cmd_new_smart,
@@ -678,4 +694,5 @@ struct ndctl_dimm_ops * const intel_dimm_ops = &(struct ndctl_dimm_ops) {
.new_fw_finish_query = intel_dimm_cmd_new_fw_finish_query,
.fw_fquery_get_fw_rev = intel_cmd_fw_fquery_get_fw_rev,
.fw_xlat_firmware_status = intel_cmd_fw_xlat_firmware_status,
+ .new_ack_shutdown_count = intel_dimm_cmd_new_lss,
};
diff --git a/ndctl/lib/intel.h b/ndctl/lib/intel.h
index e9627b0..3b01bba 100644
--- a/ndctl/lib/intel.h
+++ b/ndctl/lib/intel.h
@@ -6,6 +6,7 @@
#define ND_INTEL_SMART 1
#define ND_INTEL_SMART_THRESHOLD 2
+#define ND_INTEL_ENABLE_LSS_STATUS 10
#define ND_INTEL_FW_GET_INFO 12
#define ND_INTEL_FW_START_UPDATE 13
#define ND_INTEL_FW_SEND_DATA 14
@@ -134,6 +135,11 @@ struct nd_intel_fw_finish_query {
__u64 updated_fw_rev;
} __attribute__((packed));
+struct nd_intel_lss {
+ __u8 enable;
+ __u32 status;
+} __attribute__((packed));
+
struct nd_pkg_intel {
struct nd_cmd_pkg gen;
union {
@@ -146,6 +152,7 @@ struct nd_pkg_intel {
struct nd_intel_fw_send_data send;
struct nd_intel_fw_finish_update finish;
struct nd_intel_fw_finish_query fquery;
+ struct nd_intel_lss lss;
};
};
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index e7f9675..25fd0c2 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -343,4 +343,5 @@ global:
ndctl_cmd_fw_start_get_context;
ndctl_cmd_fw_fquery_get_fw_rev;
ndctl_cmd_fw_xlat_firmware_status;
+ ndctl_dimm_cmd_new_ack_shutdown_count;
} LIBNDCTL_13;
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index b9e3c1d..f32d32a 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -324,6 +324,7 @@ struct ndctl_dimm_ops {
struct ndctl_cmd *(*new_fw_finish_query)(struct ndctl_cmd *);
unsigned long long (*fw_fquery_get_fw_rev)(struct ndctl_cmd *);
enum ND_FW_STATUS (*fw_xlat_firmware_status)(struct ndctl_cmd *);
+ struct ndctl_cmd *(*new_ack_shutdown_count)(struct ndctl_dimm *);
};
struct ndctl_dimm_ops * const intel_dimm_ops;
diff --git a/ndctl/lib/smart.c b/ndctl/lib/smart.c
index 4ab94bb..8bf5d35 100644
--- a/ndctl/lib/smart.c
+++ b/ndctl/lib/smart.c
@@ -155,3 +155,14 @@ NDCTL_EXPORT int ndctl_cmd_##op(struct ndctl_cmd *cmd, bool enable) \
smart_cmd_inject(smart_inject_fatal)
smart_cmd_inject(smart_inject_unsafe_shutdown)
+
+NDCTL_EXPORT struct ndctl_cmd *
+ndctl_dimm_cmd_new_ack_shutdown_count(struct ndctl_dimm *dimm)
+{
+ struct ndctl_dimm_ops *ops = dimm->ops;
+
+ if (ops && ops->new_ack_shutdown_count)
+ return ops->new_ack_shutdown_count(dimm);
+ else
+ return NULL;
+}
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 6091ff3..0102948 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -624,6 +624,7 @@ unsigned long long ndctl_cmd_fw_info_get_updated_version(struct ndctl_cmd *cmd);
unsigned int ndctl_cmd_fw_start_get_context(struct ndctl_cmd *cmd);
unsigned long long ndctl_cmd_fw_fquery_get_fw_rev(struct ndctl_cmd *cmd);
enum ND_FW_STATUS ndctl_cmd_fw_xlat_firmware_status(struct ndctl_cmd *cmd);
+struct ndctl_cmd *ndctl_dimm_cmd_new_ack_shutdown_count(struct ndctl_dimm *dimm);
#ifdef __cplusplus
} /* extern "C" */
2 years, 11 months
[ndctl PATCH] ndctl, smart: fix threshold temperature helper
by Dan Williams
In version v53 libndctl gained smart support and the 'get_temperature'
helper that retrieved media temperature. In v59 libndctl gained
threshold support, and the 'get_temperature_threshold' helper. The
implementation of 'set_temperature_threshold' was inadvertently omitted
from v59. Add a definition so that applications that use the declared
symbol can build.
Reported-by: Dariusz Dokupil <dariusz.dokupil(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
ndctl/lib/smart.c | 6 ++++++
test/libndctl.c | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/ndctl/lib/smart.c b/ndctl/lib/smart.c
index 4ab94bb780cf..b76a4de1db62 100644
--- a/ndctl/lib/smart.c
+++ b/ndctl/lib/smart.c
@@ -117,6 +117,12 @@ smart_cmd_set_op(smart_threshold_set_media_temperature)
smart_cmd_set_op(smart_threshold_set_ctrl_temperature)
smart_cmd_set_op(smart_threshold_set_spares)
+NDCTL_EXPORT int ndctl_cmd_smart_threshold_set_temperature(
+ struct ndctl_cmd *cmd, unsigned int val)
+{
+ return ndctl_cmd_smart_threshold_set_media_temperature(cmd, val);
+}
+
NDCTL_EXPORT struct ndctl_cmd *ndctl_dimm_cmd_new_smart_inject(
struct ndctl_dimm *dimm)
{
diff --git a/test/libndctl.c b/test/libndctl.c
index 7fecfe2e804b..a66bcb7dfe87 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -2297,7 +2297,8 @@ static int check_smart_threshold(struct ndctl_bus *bus, struct ndctl_dimm *dimm,
*/
rc = ndctl_cmd_smart_threshold_set_alarm_control(cmd_set,
ndctl_cmd_smart_threshold_get_supported_alarms(cmd_set));
- rc |= ndctl_cmd_smart_threshold_set_media_temperature(cmd_set,
+ /* 'set_temperature' and 'set_media_temperature' are aliases */
+ rc |= ndctl_cmd_smart_threshold_set_temperature(cmd_set,
ndctl_cmd_smart_get_media_temperature(cmd_smart));
rc |= ndctl_cmd_smart_threshold_set_ctrl_temperature(cmd_set,
ndctl_cmd_smart_get_ctrl_temperature(cmd_smart));
2 years, 11 months
[PATCH 1/2] ndctl: add support to enable latch system shutdown status
by Dave Jiang
Adding the Enable Latch System Shutdown Status (Function Index 10) for
DSM v1.6 spec.
Signed-off-by: Dave Jiang <dave.jiang(a)intel.com>
---
ndctl/lib/Makefile.am | 1 +
ndctl/lib/intel.c | 38 ++++++++++++++++++++++++++++++++++++++
ndctl/lib/intel.h | 7 +++++++
ndctl/lib/libndctl.sym | 2 ++
ndctl/lib/lss.c | 43 +++++++++++++++++++++++++++++++++++++++++++
ndctl/lib/private.h | 2 ++
6 files changed, 93 insertions(+)
create mode 100644 ndctl/lib/lss.c
diff --git a/ndctl/lib/Makefile.am b/ndctl/lib/Makefile.am
index e3a12e7..c1ea371 100644
--- a/ndctl/lib/Makefile.am
+++ b/ndctl/lib/Makefile.am
@@ -22,6 +22,7 @@ libndctl_la_SOURCES =\
msft.c \
ars.c \
firmware.c \
+ lss.c \
libndctl.c
libndctl_la_LIBADD =\
diff --git a/ndctl/lib/intel.c b/ndctl/lib/intel.c
index 6d26a6c..10a0881 100644
--- a/ndctl/lib/intel.c
+++ b/ndctl/lib/intel.c
@@ -547,6 +547,42 @@ static unsigned long intel_cmd_fw_fquery_get_fw_rev(struct ndctl_cmd *cmd)
return cmd->intel->fquery.updated_fw_rev;
}
+static struct ndctl_cmd *
+intel_dimm_cmd_new_lss_enable(struct ndctl_dimm *dimm)
+{
+ struct ndctl_cmd *cmd;
+
+ BUILD_ASSERT(sizeof(struct nd_intel_lss) == 5);
+
+ cmd = alloc_intel_cmd(dimm, ND_INTEL_ENABLE_LSS_STATUS, 1, 4);
+ if (!cmd)
+ return NULL;
+
+ cmd->firmware_status = &cmd->intel->lss.status;
+ return cmd;
+}
+
+static int intel_lss_set_valid(struct ndctl_cmd *cmd)
+{
+ struct nd_pkg_intel *pkg = cmd->intel;
+
+ if (cmd->type != ND_CMD_CALL || cmd->status != 1
+ || pkg->gen.nd_family != NVDIMM_FAMILY_INTEL
+ || pkg->gen.nd_command != ND_INTEL_ENABLE_LSS_STATUS)
+ return -EINVAL;
+ return 0;
+}
+
+static int
+intel_cmd_lss_set_enable(struct ndctl_cmd *cmd, unsigned char enable)
+{
+ if (intel_lss_set_valid(cmd) < 0)
+ return -EINVAL;
+ cmd->intel->lss.enable = enable;
+ return 0;
+}
+
+
struct ndctl_dimm_ops * const intel_dimm_ops = &(struct ndctl_dimm_ops) {
.cmd_desc = intel_cmd_desc,
.new_smart = intel_dimm_cmd_new_smart,
@@ -601,4 +637,6 @@ struct ndctl_dimm_ops * const intel_dimm_ops = &(struct ndctl_dimm_ops) {
.new_fw_finish_query = intel_dimm_cmd_new_fw_finish_query,
.fw_fquery_set_context = intel_cmd_fw_fquery_set_context,
.fw_fquery_get_fw_rev = intel_cmd_fw_fquery_get_fw_rev,
+ .new_lss_enable = intel_dimm_cmd_new_lss_enable,
+ .lss_set_enable = intel_cmd_lss_set_enable,
};
diff --git a/ndctl/lib/intel.h b/ndctl/lib/intel.h
index 080e37b..92bed53 100644
--- a/ndctl/lib/intel.h
+++ b/ndctl/lib/intel.h
@@ -6,6 +6,7 @@
#define ND_INTEL_SMART 1
#define ND_INTEL_SMART_THRESHOLD 2
+#define ND_INTEL_ENABLE_LSS_STATUS 10
#define ND_INTEL_FW_GET_INFO 12
#define ND_INTEL_FW_START_UPDATE 13
#define ND_INTEL_FW_SEND_DATA 14
@@ -118,6 +119,11 @@ struct nd_intel_fw_finish_query {
__u64 updated_fw_rev;
} __attribute__((packed));
+struct nd_intel_lss {
+ __u8 enable;
+ __u32 status;
+} __attribute__((packed));
+
struct nd_pkg_intel {
struct nd_cmd_pkg gen;
union {
@@ -129,6 +135,7 @@ struct nd_pkg_intel {
struct nd_intel_fw_send_data send;
struct nd_intel_fw_finish_update finish;
struct nd_intel_fw_finish_query fquery;
+ struct nd_intel_lss lss;
};
};
#endif /* __INTEL_H__ */
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index 2e248ab..65673ad 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -344,4 +344,6 @@ global:
ndctl_cmd_fw_finish_set_ctrl_flags;
ndctl_cmd_fw_finish_set_context;
ndctl_cmd_fw_fquery_set_context;
+ ndctl_dimm_cmd_new_lss_enable;
+ ndctl_cmd_lss_set_enable;
} LIBNDCTL_13;
diff --git a/ndctl/lib/lss.c b/ndctl/lib/lss.c
new file mode 100644
index 0000000..fbeeec5
--- /dev/null
+++ b/ndctl/lib/lss.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ * more details.
+ */
+#include <stdlib.h>
+#include <limits.h>
+#include <util/log.h>
+#include <ndctl/libndctl.h>
+#include "private.h"
+
+/*
+ * Define the wrappers around the ndctl_dimm_ops for LSS DSM
+ */
+NDCTL_EXPORT struct ndctl_cmd *
+ndctl_dimm_cmd_new_lss_enable(struct ndctl_dimm *dimm)
+{
+ struct ndctl_dimm_ops *ops = dimm->ops;
+
+ if (ops && ops->new_lss_enable)
+ return ops->new_lss_enable(dimm);
+ else
+ return NULL;
+}
+
+NDCTL_EXPORT int
+ndctl_cmd_lss_set_enable(struct ndctl_cmd *cmd, unsigned char enable)
+{
+ if (cmd->dimm) {
+ struct ndctl_dimm_ops *ops = cmd->dimm->ops;
+
+ if (ops && ops->lss_set_enable)
+ return ops->lss_set_enable(cmd, enable);
+ }
+ return -ENXIO;
+}
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index 20f9e6e..4035e11 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -325,6 +325,8 @@ struct ndctl_dimm_ops {
struct ndctl_cmd *(*new_fw_finish_query)(struct ndctl_dimm *);
int (*fw_fquery_set_context)(struct ndctl_cmd *, unsigned int context);
unsigned long (*fw_fquery_get_fw_rev)(struct ndctl_cmd *);
+ struct ndctl_cmd *(*new_lss_enable)(struct ndctl_dimm *);
+ int (*lss_set_enable)(struct ndctl_cmd *, unsigned char enable);
};
struct ndctl_dimm_ops * const intel_dimm_ops;
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 64a4e99..24dc7a3 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -607,6 +607,9 @@ int ndctl_cmd_fw_finish_set_ctrl_flags(struct ndctl_cmd *cmd, unsigned char flag
int ndctl_cmd_fw_finish_set_context(struct ndctl_cmd *cmd, unsigned int context);
int ndctl_cmd_fw_fquery_set_context(struct ndctl_cmd *cmd, unsigned int context);
+struct ndctl_cmd *ndctl_dimm_cmd_new_lss_enable(struct ndctl_dimm *dimm);
+int ndctl_cmd_lss_set_enable(struct ndctl_cmd *cmd, unsigned char enable);
+
#ifdef __cplusplus
} /* extern "C" */
#endif
2 years, 11 months
2.0.1.8__G.O.O.D.N.E.W.S__T.O__Y.O.U__A.S__T.H.E__L.U.C.K.Y__W.I.N.N.E.R! ! !
by T.O.Y.O.T.A_W.I.N.N.I.N.G_P_R_O_M_O_T_I_O_N_S__.W.O.R.L.D.W.I.D.E
D.E.A.R___W.I.N.N.E.R
Y.o.u.r___E.M.A.I.L___A.D.D.R.E.S.S___h.a.s___w.o.n___f.o.r___y.o.u___t.h.e___s.u.m___o.f___E.I.G.H.T___H.U.N.D.R.E.D___T.H.O.U.S.A.N.D____U.S____D.O.L.L.A.R.S___O.N.L.Y___i.n.c.l.u.d.i.n.g___a___T.o.y.o.t.a___R.A.V.4___i.n___t.h.e___J.a.p.a.n___T.o.y.o.t.a___L.o.t.t.e.r.y___P.r.o.m.o.t.i.o.n.s___f.o.r___t.h.e___N.e.w___Y.e.a.r___2.0.1.8.
W.I.N.N.E.R.S___S.E.L.E.CT.I.O.N___B.Y___E.M.A.I.L___O.N.L.Y___(.N.O___T.I.C.K.E.TS___W.E.R.E___S.O.L.D)___F.o.r___f.u.r.t.h.e.r___p.r.o.c.e.d.u.r.e___y.o.u___a.r.e___t.o___s.e.n.d___t.h.e___r.e.q.u.i.r.e.d___d.e.t.a.i.l.s;
[1]_Y.o.u.r___F.u.l.l___N.a.m.e:
[2]_C.o.n.t.a.c.t___A.d.d.r.e.s.s:
[3]_O.c.c.u.p.a.t.i.o.n:
[4]_A.g.e:
[5]_M.a.l.e_/_F.e.m.a.l.e:
[6] C.o.u.n.t.r.y_/_N.a.t.i.o.n.a.l.i.t.y:
[7]_C.o.u.n.t.r.y___Y.o.u___N.o.w___L.i.v.e:
[8]_M.o.b.I.l.e___N.o:
C.O.N.G.R.A.T.U.L.A.T.I.O.N.S___O.N.C.E___A.G.A.I.N.!.!.!
T.H.A.N.K___Y.0.U
M.r___J.a.m.e.s___L.e.e
F.o.r;_T.o.y.o.t.a___L.o.t.t.e.r.y___P.r.o.m.o.t.i.o.n.s.
2 years, 11 months