]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
15 months agonvme-print-stdout: use NVME_MAJOR and NVME_MINOR definitions
Tokunori Ikegami [Sat, 30 Mar 2024 22:42:11 +0000 (07:42 +0900)]
nvme-print-stdout: use NVME_MAJOR and NVME_MINOR definitions

Replace hard coded shift and mask values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
15 months agonvme-print-stdout: use FDP configuration attributes definitions
Tokunori Ikegami [Sat, 30 Mar 2024 22:21:28 +0000 (07:21 +0900)]
nvme-print-stdout: use FDP configuration attributes definitions

Replace the hard coded shift and mask values in the print function.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
15 months agobuild(deps): bump sand4rt/ftp-deployer from 1.7 to 1.8
dependabot[bot] [Mon, 1 Apr 2024 18:57:38 +0000 (18:57 +0000)]
build(deps): bump sand4rt/ftp-deployer from 1.7 to 1.8

Bumps [sand4rt/ftp-deployer](https://github.com/sand4rt/ftp-deployer) from 1.7 to 1.8.
- [Release notes](https://github.com/sand4rt/ftp-deployer/releases)
- [Commits](https://github.com/sand4rt/ftp-deployer/compare/v1.7...v1.8)

---
updated-dependencies:
- dependency-name: sand4rt/ftp-deployer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
15 months agonvme: add new function 'tls_key'
Hannes Reinecke [Wed, 28 Feb 2024 09:02:41 +0000 (10:02 +0100)]
nvme: add new function 'tls_key'

Add a new function 'tls_key' to import and export keys from the
keyring.

Signed-off-by: Hannes Reinecke <hare@suse.de>
15 months agobuild: bump libnvme wrap
Hannes Reinecke [Tue, 19 Mar 2024 14:24:29 +0000 (15:24 +0100)]
build: bump libnvme wrap

To include missing symbol nvme_scan_tls_keys.

Signed-off-by: Hannes Reinecke <hare@suse.de>
15 months agonvme: use library functions for importing and exporting TLS keys
Hannes Reinecke [Tue, 27 Feb 2024 08:12:34 +0000 (09:12 +0100)]
nvme: use library functions for importing and exporting TLS keys

As we now have library functions for importing and exporting TLS
keys we should be using them.

Signed-off-by: Hannes Reinecke <hare@suse.de>
16 months agonvme: extend error message for ns scan failures
Daniel Wagner [Wed, 27 Mar 2024 11:37:04 +0000 (12:37 +0100)]
nvme: extend error message for ns scan failures

When the scan operation fails, let's also report the error code in order
to help understand why the operation failed.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonvme-print-json: Bugfix status json key of sanitize-log
Minsik Jeon [Thu, 28 Mar 2024 04:50:28 +0000 (13:50 +0900)]
nvme-print-json: Bugfix status json key of sanitize-log

There is a history of combining duplicated json keys before.
Fixes: 1d7c092f9dac ("nvme-print-json: Combine duplicated json key and val string variables")
Fixes: 59a0f125cb08 ("nvme-print-json: Delete static const char string global variables")
But there is a local variable with the same name, so the key and value
are the same.

Reviewed-by: Sangkuk Lee <sangkuk0.lee@samsung.com>
Reported-by: Kiryong Kim <kiryong1.kim@samsung.com>
Signed-off-by: Minsik Jeon <hmi.jeon@samsung.com>
Co-authored-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
16 months agosed: update SED password when initalizing
Greg Joyce [Wed, 27 Mar 2024 17:40:53 +0000 (12:40 -0500)]
sed: update SED password when initalizing

The SED key and kernel keyring were not being updated by the
initialization operation. Add password update after the other
initialization tasks are completed.

Signed-off-by: Greg Joyce <gjoyce@linux.ibm.com>
16 months agoplugins/memblaze: add performance stats
jinhua.huang [Wed, 27 Mar 2024 12:29:59 +0000 (20:29 +0800)]
plugins/memblaze: add performance stats

Add performance stats feature

Signed-off-by: jinhua.huang <jinhua.huang@memblaze.com>
16 months agoplugins/memblaze: fix code mis-type error
jinhua.huang [Wed, 27 Mar 2024 03:06:07 +0000 (11:06 +0800)]
plugins/memblaze: fix code mis-type error

Change "flash_error_media_count" to "inflight_write_io_cmd".

Signed-off-by: jinhua.huang <jinhua.huang@memblaze.com>
16 months agoplugins/memblaze: code refactor on applying __packed on more structs
jinhua.huang [Wed, 27 Mar 2024 02:24:31 +0000 (10:24 +0800)]
plugins/memblaze: code refactor on applying __packed on more structs

applying __packed on more structs

Signed-off-by: jinhua.huang <jinhua.huang@memblaze.com>
16 months agoplugins/memblaze: code refactor on using cleanup_nvme_dev
jinhua.huang [Wed, 27 Mar 2024 02:08:55 +0000 (10:08 +0800)]
plugins/memblaze: code refactor on using cleanup_nvme_dev

using cleanup_nvme_dev to open/close device

Signed-off-by: jinhua.huang <jinhua.huang@memblaze.com>
16 months agonvme: Fix to cleanup free raw_secret memory allocated
Tokunori Ikegami [Mon, 25 Mar 2024 15:55:04 +0000 (00:55 +0900)]
nvme: Fix to cleanup free raw_secret memory allocated

The memory is allocated by the gen-tls-key and check-tls-key commands.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agoplugins/memblaze: code-format on leading indent and align
jinhua.huang [Mon, 25 Mar 2024 06:37:34 +0000 (14:37 +0800)]
plugins/memblaze: code-format on leading indent and align

1. Set leading indent to tab
2. Set proper alignment as code len limitation

Signed-off-by: jinhua.huang <jinhua.huang@memblaze.com>
16 months agoplugins/wdc: Fix narrow index variable type in for loop to __u32
Tokunori Ikegami [Sun, 11 Feb 2024 15:06:04 +0000 (00:06 +0900)]
plugins/wdc: Fix narrow index variable type in for loop to __u32

Fix the comparison of narrow type with wide type in loop condition.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agoplugins/wdc: Whitespace changes
Tokunori Ikegami [Sun, 11 Feb 2024 15:01:56 +0000 (00:01 +0900)]
plugins/wdc: Whitespace changes

Delete the loop variable since not changed the value.
Also delete the some variables initial values not necessary.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme: Delete unused nvme root scanned
Tokunori Ikegami [Fri, 22 Mar 2024 12:52:59 +0000 (21:52 +0900)]
nvme: Delete unused nvme root scanned

The mmap registers has been changed to not use the nvme root.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agoocp: support OCP 2.5 Set Telemetry Profile feature
Brandon Paupore [Thu, 14 Dec 2023 19:23:03 +0000 (13:23 -0600)]
ocp: support OCP 2.5 Set Telemetry Profile feature

Adds a new OCP plugin function to set the device telemetry profile,
configuring what debug data shall be collected by the device.

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
16 months agonvme: Don't seg fault if given device is not char/block device
Nilay Shroff [Sun, 17 Mar 2024 11:36:22 +0000 (17:06 +0530)]
nvme: Don't seg fault if given device is not char/block device

If the given device name is not char/block device then in
open_dev_direct() set errno to ENODEV and err to -1 before
returning to the dev_fd(). This would then ensure that in
case of error, dev_fd() returns the corerct negative error
code back to its callers. So now the callers of dev_fd()
would handle the error appropriately instead of try
accessing the nvme_dev which would be NULL.

Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonbft: Include SSNS index in error messages
Tomas Bzatek [Thu, 15 Feb 2024 14:37:51 +0000 (09:37 -0500)]
nbft: Include SSNS index in error messages

In case of complex NBFT tables, multiple messages printed out
start to get confusing. Better to print SSNS indexes for easier
identification in further debugging.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agonbft: Pause logging for expected connection failures
Tomas Bzatek [Tue, 13 Feb 2024 14:54:15 +0000 (09:54 -0500)]
nbft: Pause logging for expected connection failures

For unavailable SSNSs, pause logging to make connection
attempts truly silent.

Kernel errors are still being logged, e.g.
  nvme nvme8: failed to connect socket: -110

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agonbft: Silence connection failures for unavailable SSNS
Tomas Bzatek [Tue, 13 Feb 2024 14:26:14 +0000 (09:26 -0500)]
nbft: Silence connection failures for unavailable SSNS

In case a SSNS is marked as 'unavailable' by the firmware,
let's give it another try but silence any errors.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agonbft: Fix 'verbose' argument type
Tomas Bzatek [Thu, 7 Mar 2024 16:03:38 +0000 (17:03 +0100)]
nbft: Fix 'verbose' argument type

nvme-cli logging offers multiple levels now.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agoplugins/nbft: Implement verbose logging
Tomas Bzatek [Fri, 8 Mar 2024 16:39:45 +0000 (17:39 +0100)]
plugins/nbft: Implement verbose logging

Useful for debugging the libnvme NBFT parser.
Specify '-vv' for debugging messages.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agoplugins/nbft: Print the new SSNS flags
Tomas Bzatek [Mon, 12 Feb 2024 16:11:17 +0000 (17:11 +0100)]
plugins/nbft: Print the new SSNS flags

New 'unavailable' and 'discovered' flags.
JSON only for the moment.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agonbft: Fix uninitialized variable
Tomas Bzatek [Tue, 19 Mar 2024 13:31:13 +0000 (14:31 +0100)]
nbft: Fix uninitialized variable

../nbft.c:106:28: warning: variable 'entry' is uninitialized when used here [-Wuninitialized]
  106 |         list_for_each(&nbft_list, entry, node)
      |                                   ^~~~~
../ccan/ccan/list/list.h:524:40: note: expanded from macro 'list_for_each'
  524 |         list_for_each_off(h, i, list_off_var_(i, member))
      |                                               ^
../ccan/ccan/list/list.h:824:21: note: expanded from macro 'list_off_var_'
  824 |         (container_off_var(var, member) +               \
      |                            ^~~
../ccan/ccan/container_of/container_of.h:142:19: note: expanded from macro 'container_off_var'
  142 |         ((const char *)&(var)->member - (const char *)(var))
      |                          ^~~
../ccan/ccan/list/list.h:738:34: note: expanded from macro 'list_for_each_off'
  738 |         list_for_each_off_dir_((h),(i),(off),next)
      |                                         ^~~
../ccan/ccan/list/list.h:693:9: note: expanded from macro 'list_for_each_off_dir_'
  693 |                                    (off));                              \
      |                                     ^~~
../nbft.c:90:31: note: initialize the variable 'entry' to silence this warning
   90 |         struct nbft_file_entry *entry;
      |                                      ^
      |                                       = NULL

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agoplugins/nbft: Fix uninitialized variables
Tomas Bzatek [Tue, 19 Mar 2024 13:29:37 +0000 (14:29 +0100)]
plugins/nbft: Fix uninitialized variables

../plugins/nbft/nbft-plugin.c:328:27: warning: variable 'entry' is uninitialized when used here [-Wuninitialized]
  328 |         list_for_each(nbft_list, entry, node) {
      |                                  ^~~~~
../ccan/ccan/list/list.h:524:40: note: expanded from macro 'list_for_each'
  524 |         list_for_each_off(h, i, list_off_var_(i, member))
      |                                               ^
../ccan/ccan/list/list.h:824:21: note: expanded from macro 'list_off_var_'
  824 |         (container_off_var(var, member) +               \
      |                            ^~~
../ccan/ccan/container_of/container_of.h:142:19: note: expanded from macro 'container_off_var'
  142 |         ((const char *)&(var)->member - (const char *)(var))
      |                          ^~~
../ccan/ccan/list/list.h:738:34: note: expanded from macro 'list_for_each_off'
  738 |         list_for_each_off_dir_((h),(i),(off),next)
      |                                         ^~~
../ccan/ccan/list/list.h:693:9: note: expanded from macro 'list_for_each_off_dir_'
  693 |                                    (off));                              \
      |                                     ^~~
../plugins/nbft/nbft-plugin.c:322:31: note: initialize the variable 'entry' to silence this warning
  322 |         struct nbft_file_entry *entry;
      |                                      ^
      |                                       = NULL

../plugins/nbft/nbft-plugin.c:515:27: warning: variable 'entry' is uninitialized when used here [-Wuninitialized]
  515 |         list_for_each(nbft_list, entry, node) {
      |                                  ^~~~~
../ccan/ccan/list/list.h:524:40: note: expanded from macro 'list_for_each'
  524 |         list_for_each_off(h, i, list_off_var_(i, member))
      |                                               ^
../ccan/ccan/list/list.h:824:21: note: expanded from macro 'list_off_var_'
  824 |         (container_off_var(var, member) +               \
      |                            ^~~
../ccan/ccan/container_of/container_of.h:142:19: note: expanded from macro 'container_off_var'
  142 |         ((const char *)&(var)->member - (const char *)(var))
      |                          ^~~
../ccan/ccan/list/list.h:738:34: note: expanded from macro 'list_for_each_off'
  738 |         list_for_each_off_dir_((h),(i),(off),next)
      |                                         ^~~
../ccan/ccan/list/list.h:693:9: note: expanded from macro 'list_for_each_off_dir_'
  693 |                                    (off));                              \
      |                                     ^~~
../plugins/nbft/nbft-plugin.c:513:31: note: initialize the variable 'entry' to silence this warning
  513 |         struct nbft_file_entry *entry;
      |                                      ^
      |                                       = NULL

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agoplugins/sed: Fix uninitialized variable
Tomas Bzatek [Tue, 19 Mar 2024 13:40:33 +0000 (14:40 +0100)]
plugins/sed: Fix uninitialized variable

../plugins/sed/sedopal_cmd.c: In function ‘sedopal_cmd_discover’:
../plugins/sed/sedopal_cmd.c:506:17: warning: ‘locking_flags’ may be used uninitialized [-Wmaybe-uninitialized]
  506 |                 sedopal_print_locking_features(locking_flags);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../plugins/sed/sedopal_cmd.c:459:17: note: ‘locking_flags’ was declared here
  459 |         uint8_t locking_flags;
      |                 ^~~~~~~~~~~~~

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agonvme-print-stdout: Fix uninitialized variable
Tomas Bzatek [Tue, 19 Mar 2024 13:28:03 +0000 (14:28 +0100)]
nvme-print-stdout: Fix uninitialized variable

../nvme-print-stdout.c:3796:22: warning: variable 'node' is uninitialized when used here [-Wuninitialized]
 3796 |         list_for_each(list, node, node) {
      |                             ^~~~
../ccan/ccan/list/list.h:524:40: note: expanded from macro 'list_for_each'
  524 |         list_for_each_off(h, i, list_off_var_(i, member))
      |                                               ^
../ccan/ccan/list/list.h:824:21: note: expanded from macro 'list_off_var_'
  824 |         (container_off_var(var, member) +               \
      |                            ^~~
../ccan/ccan/container_of/container_of.h:142:19: note: expanded from macro 'container_off_var'
  142 |         ((const char *)&(var)->member - (const char *)(var))
      |                          ^~~
../ccan/ccan/list/list.h:738:34: note: expanded from macro 'list_for_each_off'
  738 |         list_for_each_off_dir_((h),(i),(off),next)
      |                                         ^~~
../ccan/ccan/list/list.h:693:9: note: expanded from macro 'list_for_each_off_dir_'
  693 |                                    (off));                              \
      |                                     ^~~
../nvme-print-stdout.c:3794:31: note: initialize the variable 'node' to silence this warning
 3794 |         nvme_effects_log_node_t *node;
      |                                      ^
      |                                       = NULL

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agonvme-print-json: Fix uninitialized variable
Tomas Bzatek [Tue, 19 Mar 2024 13:25:17 +0000 (14:25 +0100)]
nvme-print-json: Fix uninitialized variable

../nvme-print-json.c:1340:22: warning: variable 'node' is uninitialized when used here [-Wuninitialized]
 1340 |         list_for_each(list, node, node) {
      |                             ^~~~
../ccan/ccan/list/list.h:524:40: note: expanded from macro 'list_for_each'
  524 |         list_for_each_off(h, i, list_off_var_(i, member))
      |                                               ^
../ccan/ccan/list/list.h:824:21: note: expanded from macro 'list_off_var_'
  824 |         (container_off_var(var, member) +               \
      |                            ^~~
../ccan/ccan/container_of/container_of.h:142:19: note: expanded from macro 'container_off_var'
  142 |         ((const char *)&(var)->member - (const char *)(var))
      |                          ^~~
../ccan/ccan/list/list.h:738:34: note: expanded from macro 'list_for_each_off'
  738 |         list_for_each_off_dir_((h),(i),(off),next)
      |                                         ^~~
../ccan/ccan/list/list.h:693:9: note: expanded from macro 'list_for_each_off_dir_'
  693 |                                    (off));                              \
      |                                     ^~~
../nvme-print-json.c:1338:31: note: initialize the variable 'node' to silence this warning
 1338 |         nvme_effects_log_node_t *node;
      |                                      ^
      |                                       = NULL

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agobuild: Switch default meson buildtype to 'debugoptimized'
Tomas Bzatek [Tue, 19 Mar 2024 14:06:45 +0000 (15:06 +0100)]
build: Switch default meson buildtype to 'debugoptimized'

The meson 'debug' buildtype defaults to '-O0 -g' which misses
some important compiler warnings (as of gcc-13). While there's
no universal solution, the 'debugoptimized' buildtype supplies
'-O2 -g' that appears to be a reasonable compromise for having
important compiler warnings by default.

Either way, the specified warning_level=1 always supplies
'-Wall' that is unfortunately not enough with '-O0'.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
16 months agonvme: do not scan topology when mmaping registers
Daniel Wagner [Tue, 19 Mar 2024 12:45:30 +0000 (13:45 +0100)]
nvme: do not scan topology when mmaping registers

For accessing the registers we don't need to scan the topology. With the
device name we already know where to lookup the resource0 file in sysfs.

We also don't need to do the fallback lookup via the namespaces because
Linux kernel v4.0 has introduced the link in /sys/class/nvme/nvme%d. And
nvme-cli 2.x depends on Linux kernel >= 4.15, so it's safe to drop the
fallback.

This avoids all the topology scanning which is excessive and also might
issue an 'id command' via the nuse sysfs entry. So let's not do it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonvme-print-stdout: Use NVME_BOOT_PARTITION_INFO field definitions
Tokunori Ikegami [Sun, 17 Mar 2024 11:58:01 +0000 (20:58 +0900)]
nvme-print-stdout: Use NVME_BOOT_PARTITION_INFO field definitions

Change it instead of hardcoded field mask and shift values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_GET for MI commands supported and effects CSP
Tokunori Ikegami [Sun, 17 Mar 2024 11:24:36 +0000 (20:24 +0900)]
nvme-print-stdout: Use NVME_GET for MI commands supported and effects CSP

Use it with NVME_MI_CMD_SUPPORTED_EFFECTS register definitions existed.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_GET for FID supported and effects FSP
Tokunori Ikegami [Sun, 17 Mar 2024 11:11:12 +0000 (20:11 +0900)]
nvme-print-stdout: Use NVME_GET for FID supported and effects FSP

Use it with NVME_FID_SUPPORTED_EFFECTS register definitions existed.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_SET_FEAT_EVENT register definitions
Tokunori Ikegami [Sun, 17 Mar 2024 10:22:30 +0000 (19:22 +0900)]
nvme-print-stdout: Use NVME_SET_FEAT_EVENT register definitions

Change it instead of hardcoded register mask and shift values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print: Add PEL EHAI port identifier type printf function
Tokunori Ikegami [Fri, 15 Mar 2024 14:55:28 +0000 (23:55 +0900)]
nvme-print: Add PEL EHAI port identifier type printf function

Change to use NVME_PEL_EHAI_PIT definitions.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agobuild: bump libnvme wrap
Daniel Wagner [Tue, 19 Mar 2024 09:18:18 +0000 (10:18 +0100)]
build: bump libnvme wrap

Include latest libnvme changes.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agoocp: fix for power-state argument checking
Brandon Paupore [Thu, 14 Dec 2023 20:15:31 +0000 (14:15 -0600)]
ocp: fix for power-state argument checking

Noticed this as part of supporting set-telemetry-profile, it seems that
the power-state option is not being detected properly. With this fix the
function is able to enter set_dssd_power_state when given the option or
its alias.

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
16 months agonvme: do not issue warning when nvme_core module is not loaded
Daniel Wagner [Tue, 19 Mar 2024 08:53:09 +0000 (09:53 +0100)]
nvme: do not issue warning when nvme_core module is not loaded

nvme 1.x did not issue an warning when the nvme_core module was not
loaded. Make 2.x behave in the same way.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agowdc: Review changes and build fixes
jeff-lien-wdc [Wed, 13 Mar 2024 01:23:09 +0000 (20:23 -0500)]
wdc: Review changes and build fixes

Changes based on review comments.
Fixed build errors building timestamp string.
Fixed lines over the 100 char limit.

Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
16 months agowdc: Fix timestamp displayed by vs-firmware-activate-history command
jeff-lien-wdc [Tue, 5 Mar 2024 21:22:00 +0000 (15:22 -0600)]
wdc:  Fix timestamp displayed by vs-firmware-activate-history command

The actual timestamp value is in bytes 0:5 of the 8 byte field.
The code was using all 8 bytes so a change was made to mask off
the top 2 bytes.  The timestamp calculations were also simplified
to be more maintainable.

Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
16 months agologging: Split to output ioctl latency by log info level
Tokunori Ikegami [Wed, 13 Mar 2024 16:09:40 +0000 (01:09 +0900)]
logging: Split to output ioctl latency by log info level

This is for only output latency but not output other debugging info.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Change hexadecimal value 0x prefix to use %#x
Tokunori Ikegami [Wed, 13 Mar 2024 15:45:20 +0000 (00:45 +0900)]
nvme-print-stdout: Change hexadecimal value 0x prefix to use %#x

Also channge 64bit value to use  %#"PRIx64" instead of 0x%"PRIx64".

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Fix LBA status DSLBA output as hexadecimal
Tokunori Ikegami [Wed, 13 Mar 2024 15:08:32 +0000 (00:08 +0900)]
nvme-print-stdout: Fix LBA status DSLBA output as hexadecimal

The output printed with the 0x prefix but as not hexadecimal.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Split line length exceeded 100 columns
Tokunori Ikegami [Tue, 12 Mar 2024 16:20:30 +0000 (01:20 +0900)]
nvme-print-stdout: Split line length exceeded 100 columns

This resolves checkpatch line length exceeding warning.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_PMRMSC register definitions to print
Tokunori Ikegami [Mon, 11 Mar 2024 15:09:50 +0000 (00:09 +0900)]
nvme-print-stdout: Use NVME_PMRMSC register definitions to print

Change it instead of hardcoded register mask and shift values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_PMRSWTP register definitions to print
Tokunori Ikegami [Mon, 11 Mar 2024 14:40:14 +0000 (23:40 +0900)]
nvme-print-stdout: Use NVME_PMRSWTP register definitions to print

Change it instead of hardcoded register mask and shift values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_PMREBS register definitions to print
Tokunori Ikegami [Mon, 11 Mar 2024 14:36:06 +0000 (23:36 +0900)]
nvme-print-stdout: Use NVME_PMREBS register definitions to print

Change it instead of hardcoded register mask and shift values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_PMRSTS register definitions to print
Tokunori Ikegami [Mon, 11 Mar 2024 14:28:57 +0000 (23:28 +0900)]
nvme-print-stdout: Use NVME_PMRSTS register definitions to print

Change it instead of hardcoded register mask and shift values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_PMRCTL_EN register definition to print
Tokunori Ikegami [Mon, 11 Mar 2024 14:15:25 +0000 (23:15 +0900)]
nvme-print-stdout: Use NVME_PMRCTL_EN register definition to print

Change it instead of hardcoded register mask value.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use NVME_PMRCAP register definition to print
Tokunori Ikegami [Mon, 11 Mar 2024 14:04:11 +0000 (23:04 +0900)]
nvme-print-stdout: Use NVME_PMRCAP register definition to print

Change it instead of hardcoded register mask and shift values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agodoc: Fix admin and io passthru cdw parameters description
Tokunori Ikegami [Sun, 10 Mar 2024 11:38:55 +0000 (20:38 +0900)]
doc: Fix admin and io passthru cdw parameters description

Fixes: 2f31c7905558 ("doc: Documentations maintenance changes")
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agodoc: Add get-feature cdw11 and set-feature cdw12 parameters
Tokunori Ikegami [Sun, 10 Mar 2024 10:33:03 +0000 (19:33 +0900)]
doc: Add get-feature cdw11 and set-feature cdw12 parameters

Those implemented but missed to described by the documentations.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agomicron-nvme: Unuse stat() to check if strMainDirName exists
Tokunori Ikegami [Sun, 10 Mar 2024 09:12:17 +0000 (18:12 +0900)]
micron-nvme: Unuse stat() to check if strMainDirName exists

It is checked by mkdir errno EEXIST instead.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agodoc: Fix get-property and set-property offset and value descriptions
Tokunori Ikegami [Sun, 10 Mar 2024 03:27:28 +0000 (12:27 +0900)]
doc: Fix get-property and set-property offset and value descriptions

Those parameters need the <offset> and <val> parameters values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agodoc: Fix documentation file mode 100755 to 100644
Tokunori Ikegami [Sat, 17 Feb 2024 18:31:14 +0000 (03:31 +0900)]
doc: Fix documentation file mode 100755 to 100644

Only the get-property and set-property commands fixed errors.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Fix channel configuration descriptors pointer
Tokunori Ikegami [Sun, 10 Mar 2024 04:44:45 +0000 (13:44 +0900)]
nvme-print-stdout: Fix channel configuration descriptors pointer

Set the address after NVM set EGSETS - 1 identifier parameter.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Check sscanf return value
Tokunori Ikegami [Sun, 10 Mar 2024 04:53:49 +0000 (13:53 +0900)]
nvme-print-stdout: Check sscanf return value

To fix linux kernel check patch error.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Fix linux kernel check patch errors
Tokunori Ikegami [Sat, 17 Feb 2024 04:35:49 +0000 (13:35 +0900)]
nvme-print-stdout: Fix linux kernel check patch errors

Note: The long line string and strncpy() warnings are not fixed.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme: Delete unusual fallthrough for cases have no body
Tokunori Ikegami [Mon, 5 Feb 2024 13:05:37 +0000 (22:05 +0900)]
nvme: Delete unusual fallthrough for cases have no body

All the cases listed adjacently and use only for cases have any body.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme: Delete duplicated semicolon
Tokunori Ikegami [Mon, 22 Jan 2024 16:53:13 +0000 (01:53 +0900)]
nvme: Delete duplicated semicolon

Fix for the checkpatch.pl error.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print, common: Fix for whitespace change
Tokunori Ikegami [Sun, 10 Mar 2024 05:06:09 +0000 (14:06 +0900)]
nvme-print, common: Fix for whitespace change

Fix to change space characters for indentation to tab characters.
Delete a space between cast parentheses and variable.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agologging: output ioctl debugging info
Daniel Wagner [Wed, 6 Mar 2024 08:54:39 +0000 (09:54 +0100)]
logging: output ioctl debugging info

Instead pushing insane logging infra code into the library, let's keep
this stuff in the frontend. This is done by providing our own version
of the low level ioctl function as the library is exposing this as weak
symbol. This allows us to print the passthru structures and also the
timing information.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonvme: track verbose level
Daniel Wagner [Wed, 6 Mar 2024 08:36:23 +0000 (09:36 +0100)]
nvme: track verbose level

The command line option parser is able to count how many times 'verbose'
is provided by the user. This increases the verbosity level. Use this
for mapping it to the correct log_level.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agologging: track log level globally
Daniel Wagner [Wed, 6 Mar 2024 08:15:13 +0000 (09:15 +0100)]
logging: track log level globally

Preparation patch to enable verbose/debug logging in parts where we
don't have the nvme_root_t object introduce a global logging level
variable.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agologging: move logging code to a new file
Daniel Wagner [Tue, 5 Mar 2024 16:44:02 +0000 (17:44 +0100)]
logging: move logging code to a new file

In preparation to extend the logging use case move the existing code to
a new location.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonvme: update include for libnvme
Daniel Wagner [Tue, 5 Mar 2024 16:37:04 +0000 (17:37 +0100)]
nvme: update include for libnvme

This header file is not a local header file, it's the main header from
libnvme. Thus use the correct include statement.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonvme: remove unused declaration
Daniel Wagner [Tue, 5 Mar 2024 16:11:17 +0000 (17:11 +0100)]
nvme: remove unused declaration

There is no user for current_index, thus remove it

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agobuild: bump libnvme wrap
Daniel Wagner [Wed, 6 Mar 2024 09:57:27 +0000 (10:57 +0100)]
build: bump libnvme wrap

Fetch the new low level passthru functions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonvme-netapp: add nspath tlv handling
Martin George [Tue, 5 Mar 2024 12:39:57 +0000 (18:09 +0530)]
nvme-netapp: add nspath tlv handling

Add nspath tlv handling logic to the NetApp plugin.

Signed-off-by: Martin George <marting@netapp.com>
16 months agorpm: Add missing rule and service files
Minsik Jeon [Tue, 5 Mar 2024 10:25:31 +0000 (19:25 +0900)]
rpm: Add missing rule and service files

Rule and service were added previously.
But rule and service files were not added the spec file.
So add missing rule and service files.

make rpm result:
Installed (but unpackaged) file(s) found:
/usr/local/lib/systemd/system/nvmf-connect-nbft.service
/usr/local/lib/udev/rules.d/65-persistent-net-nbft.rules

Signed-off-by: Minsik Jeon <hmi.jeon@samsung.com>
Co-authored-by: Ra See <tkwpvk789@gmail.com>
16 months agonvme-print-json, nvme-print-stdout: Use CHAR_BIT definition
Tokunori Ikegami [Mon, 4 Mar 2024 15:06:50 +0000 (00:06 +0900)]
nvme-print-json, nvme-print-stdout: Use CHAR_BIT definition

Instead of the hardcoded value use the macro definition.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Delete duplicated if condition checking line
Tokunori Ikegami [Mon, 4 Mar 2024 15:01:28 +0000 (00:01 +0900)]
nvme-print-stdout: Delete duplicated if condition checking line

nvme_pel_event_to_string() checked twice in stdout_add_bitmap().

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agoocp: Fix timestamp displayed by fw-activate-history command
jeff-lien-wdc [Mon, 4 Mar 2024 20:31:26 +0000 (14:31 -0600)]
ocp: Fix timestamp displayed by fw-activate-history command

The current code is displaying all 8 bytes of the timestamp
field for the timestamp.  The timestamp value is only in
the first 6 bytes. The 7th byte contains the origin and
synch fields and the 8th byte is reserved.

Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
16 months agowdc: Add support for the get-drive-status command to SN861
jeff-lien-wdc [Fri, 1 Mar 2024 22:01:40 +0000 (16:01 -0600)]
wdc: Add support for the get-drive-status command to SN861

This change will use UUID lists to access the WD C2 log
page and retrieve the correct info needed to display the
drive status.

Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
16 months agonvme-print: Fix nvme_host_metadata_type_to_string() indentation errors
Tokunori Ikegami [Mon, 26 Feb 2024 15:57:18 +0000 (00:57 +0900)]
nvme-print: Fix nvme_host_metadata_type_to_string() indentation errors

Change white space indentations to use tab spaces.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print: Add PEL RCI port identifier type printf function
Tokunori Ikegami [Mon, 26 Feb 2024 15:52:02 +0000 (00:52 +0900)]
nvme-print: Add PEL RCI port identifier type printf function

Change to use NVME_PEL_RCI_RCPIT definitions.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print-stdout: Use persistent event log RCI definitions
Tokunori Ikegami [Sun, 25 Feb 2024 15:28:31 +0000 (00:28 +0900)]
nvme-print-stdout: Use persistent event log RCI definitions

Change the hardcoded the register bit shift to use the definitions.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agobuild: bump libnvme wrap
Daniel Wagner [Tue, 5 Mar 2024 08:52:41 +0000 (09:52 +0100)]
build: bump libnvme wrap

Include PEL changes.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
16 months agonvme: Add show-regs and get-property commands NSSD print outputs
Tokunori Ikegami [Sun, 3 Mar 2024 01:54:15 +0000 (10:54 +0900)]
nvme: Add show-regs and get-property commands NSSD print outputs

Output the NVM Subsystem Shutdown property.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
16 months agonvme-print: print more details in ns-descs verbose output
Martin George [Sat, 24 Feb 2024 17:29:01 +0000 (22:59 +0530)]
nvme-print: print more details in ns-descs verbose output

Print additional details such as loc, nidt, nidl & type in the
ns-descs verbose output for parity with the corresponding
json output.

Signed-off-by: Martin George <marting@netapp.com>
16 months agoRevert "nvme-print-json: remove obj_print helper"
Tokunori Ikegami [Wed, 28 Feb 2024 16:30:02 +0000 (01:30 +0900)]
Revert "nvme-print-json: remove obj_print helper"

This reverts commit b854cbda04a19b7dcfcbeb569146cf9ab79fd5f3.

The helper function is used the json_r is set by json_show_init()
then the function does not print but it is done by json_show_finish()
instead. The get-feature command using nvme_show_init() and
nvme_show_finish() those call json_show_init() and json_show_init()
json print functions so the command json output does not work correctly
currently.

Also the init and finish functions will be used by the PR #2188 get-reg
command also. (The issue found by the implementation working.)

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
17 months agosed: Confirm entered password before initialization.
Greg Joyce [Mon, 19 Feb 2024 22:43:18 +0000 (16:43 -0600)]
sed: Confirm entered password before initialization.

Ask for password twice in case there is a typo in entering it.

Signed-off-by: Greg Joyce <gjoyce@linux.ibm.com>
17 months agodoc: Regenerate all docs for v2.8
Daniel Wagner [Wed, 14 Feb 2024 09:44:00 +0000 (10:44 +0100)]
doc: Regenerate all docs for v2.8

Signed-off-by: Daniel Wagner <dwagner@suse.de>
17 months agobuild: Update version to v2.8
Daniel Wagner [Wed, 14 Feb 2024 09:43:40 +0000 (10:43 +0100)]
build: Update version to v2.8

Signed-off-by: Daniel Wagner <dwagner@suse.de>
17 months agobuild: bump libnvme version
Daniel Wagner [Wed, 14 Feb 2024 09:42:33 +0000 (10:42 +0100)]
build: bump libnvme version

Update to latest version, v1.8.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
17 months agonvme-print-json: append array object in json_support_log
Daniel Wagner [Wed, 14 Feb 2024 09:27:54 +0000 (10:27 +0100)]
nvme-print-json: append array object in json_support_log

The valid object is of type array not obj, thus use obj_add_array to add
it to the root.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
17 months agosed: Add plugin for basic SED Opal operations
Greg Joyce [Fri, 19 Jan 2024 20:43:41 +0000 (14:43 -0600)]
sed: Add plugin for basic SED Opal operations

A new plugin 'sed' is developed to provide basic SED Opal CLI
operations. These include:
        discover        Discover drive locking features
        intialize       Initialize a drive for SED Opal
        password        Change the authorization key
        revert          Revert drive to SED Opal disabled
        lock            Lock a SED Opal drive
        unlock          Unlock a SED Opal drive

Signed-off-by: Greg Joyce <gjoyce@linux.ibm.com>
17 months agodon't include newlines in already wrapped text
Keith Busch [Wed, 7 Feb 2024 00:17:42 +0000 (16:17 -0800)]
don't include newlines in already wrapped text

The descriptions are already line wrapped as appropriate. Don't insert
random newline characters in inappropriate places. It just makes the
output look rediculous.

Signed-off-by: Keith Busch <kbusch@kernel.org>
17 months agonvme: do not include meta data for PRACT=1 and MD=8 (version 2)
Bean Li [Mon, 5 Feb 2024 11:17:54 +0000 (19:17 +0800)]
nvme: do not include meta data for PRACT=1 and MD=8 (version 2)

No meta data is transferred for PRACT=1 and MD=8:
  5.2.2.1 Protection Information and Write Commands
  5.2.2.2 Protection Informatio and Read Commands

commit 8dcac74470ec (nvme: do not include meta data for PRACT=1 and MD=8)
the condition in if sentence is wrong, mixed up pract with prinfo.

Signed-off-by: Bean Li <libin@dapustor.com>
17 months agobuild(deps): bump codecov/codecov-action from 3 to 4
dependabot[bot] [Mon, 5 Feb 2024 18:53:18 +0000 (18:53 +0000)]
build(deps): bump codecov/codecov-action from 3 to 4

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
17 months agocreate-ns: align the namespaces to 1Mib boundaries when using SI suffixes
Maurizio Lombardi [Thu, 5 Oct 2023 15:17:23 +0000 (17:17 +0200)]
create-ns: align the namespaces to 1Mib boundaries when using SI suffixes

Some controllers refuse to create namespaces with a size not aligned to
a 1 MiB boundary, this happens when using the -S and -C options.

$ nvme create-ns /dev/nvme0 -S 80M -C 80M -f 0
NVMe status: Invalid Field in Command: A reserved coded value or
an unsupported value in a defined field(0x2)

Fix this problem by modifying create_ns() parse_lba_num_si() to align
the values to 1 MiB boundaries. If granularity is supported, we will
use the specified values, if they are smaller than 1 MiB.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
17 months agodoc: Fix config-schema.json's URL
Felix Yan [Thu, 1 Feb 2024 14:08:48 +0000 (16:08 +0200)]
doc: Fix config-schema.json's URL

The old URL returns 404.

Signed-off-by: Felix Yan <felixonmars@archlinux.org>
17 months agoplugins/solidigm: Compressing vs-internal-log log files into zip file.
Leonardo da Cunha [Fri, 29 Dec 2023 16:10:41 +0000 (08:10 -0800)]
plugins/solidigm: Compressing vs-internal-log log files into zip file.

Creates zip file containing files useful to debug.

Signed-off-by: Leonardo da Cunha <leonardo.da.cunha@solidigm.com>
17 months agonbft: do not issue an error if ACPI tables are missing
Daniel Wagner [Fri, 2 Feb 2024 07:48:21 +0000 (08:48 +0100)]
nbft: do not issue an error if ACPI tables are missing

Not all architectures have ACPI tables, e.g. riscv64. Thus the nbft code
should fail gracefully if it's not present.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
17 months agonbft: fixup include for libnvme
Daniel Wagner [Fri, 2 Feb 2024 07:47:14 +0000 (08:47 +0100)]
nbft: fixup include for libnvme

libnvme.h is from an external source, so use the correct include
grammar.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
17 months agodoc: Fix short option name for cfg-file
Felix Yan [Thu, 1 Feb 2024 12:47:38 +0000 (14:47 +0200)]
doc: Fix short option name for cfg-file

It was renamed to "-J" but some docs were left out.

Fixes: 0571307d3af0 ("nvme-connect: Add 'dhchap-secret' and 'dhchap-ctrl-secret' arguments")
Signed-off-by: Felix Yan <felixonmars@archlinux.org>
[dwagner: updated some more outdated references
Signed-off-by: Daniel Wagner <dwagner@suse.de>
17 months agocompletions: added Solidigm plugin to autocomplete scripts
Anant Mashiana [Thu, 4 Jan 2024 01:19:45 +0000 (17:19 -0800)]
completions: added Solidigm plugin to autocomplete scripts

Updated both bash and zsh autocomplete scripts
Fixed copy-paste error under ocp section of zsh script

Signed-off-by: Anant Mashiana <anant.mashiana@solidigm.com>