]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years agonvme-print: fix 'nvme list -o json' segfault
Martin George [Mon, 21 Feb 2022 10:17:24 +0000 (15:47 +0530)]
nvme-print: fix 'nvme list -o json' segfault

After the recent upgrade to libnvme, 'nvme list -o json' segfaults
due to incorrect json object type passed here. So fix this by passing
the appropriate json object type and invoking it outside the
nvme_for_each_host loop.

Signed-off-by: Martin George <marting@netapp.com>
3 years agoMerge pull request #1386 from AkhileshRN/SN_telemetry_type_desc
Daniel Wagner [Fri, 18 Feb 2022 13:51:55 +0000 (14:51 +0100)]
Merge pull request #1386 from AkhileshRN/SN_telemetry_type_desc

updated products list for telemetry (--type) argument in the wdc vs-internal-log command

3 years agowdc: updated products list for telemetry (--type) argument
Akhilesh RN [Fri, 18 Feb 2022 13:22:52 +0000 (18:52 +0530)]
wdc: updated products list for telemetry (--type) argument

Updated products list for telemetry (--type) argument in the wdc
vs-internal-log command.

3 years agoMerge pull request #1385 from nobodyatandnothing/patch-1
Daniel Wagner [Fri, 18 Feb 2022 13:50:07 +0000 (14:50 +0100)]
Merge pull request #1385 from nobodyatandnothing/patch-1

fix typo

3 years agodocs: fix typo in Data Set Management section
nobodyatandnothing [Fri, 18 Feb 2022 04:35:11 +0000 (23:35 -0500)]
docs: fix typo in Data Set Management section

3 years agoMerge pull request #1384 from paulentzel/master
Daniel Wagner [Fri, 18 Feb 2022 13:48:26 +0000 (14:48 +0100)]
Merge pull request #1384 from paulentzel/master

Fix ctrlist for attach-ns and detach-ns

3 years agoFix ctrlist for attach-ns and detach-ns
Paul Entzel [Thu, 17 Feb 2022 21:30:02 +0000 (14:30 -0700)]
Fix ctrlist for attach-ns and detach-ns

3 years agoMerge pull request #1379 from hanumanthuh/master
Daniel Wagner [Thu, 17 Feb 2022 09:31:18 +0000 (10:31 +0100)]
Merge pull request #1379 from hanumanthuh/master

Micron plugin version 1.0.8

3 years agoMerge pull request #1381 from igaw/revert-force-exclusive
Daniel Wagner [Thu, 17 Feb 2022 09:30:02 +0000 (10:30 +0100)]
Merge pull request #1381 from igaw/revert-force-exclusive

Revert force exclusive

3 years agoMerge pull request #1383 from martin-gpy/ontap_uuid_handling
Daniel Wagner [Thu, 17 Feb 2022 09:23:06 +0000 (10:23 +0100)]
Merge pull request #1383 from martin-gpy/ontap_uuid_handling

netapp-nvme: fix nvme ns desc uuid handling for ontapdevices

3 years agonetapp-nvme: fix nvme ns desc uuid handling for ontapdevices
Martin George [Wed, 16 Feb 2022 18:33:20 +0000 (00:03 +0530)]
netapp-nvme: fix nvme ns desc uuid handling for ontapdevices

The nvme ns desc uuid handling in the NetApp plugin for
ontapdevices is broken after the recent upgrade to libnvme. The
uuid hanlding logic here was flawed to begin with, so rework this
code to ensure the respective uuid descriptor itself is stored in
the ontapdevice_info structure and processed appropriately.

Signed-off-by: Martin George <marting@netapp.com>
3 years agoMerge pull request #1382 from jeffreyalien/pr-1375
Daniel Wagner [Wed, 16 Feb 2022 15:05:55 +0000 (16:05 +0100)]
Merge pull request #1382 from jeffreyalien/pr-1375

[nvme-cli] Additional changes for PR 1375

3 years agowdc: Fix use-after-free access of cbs_data
Jeff Lien [Mon, 14 Feb 2022 22:32:19 +0000 (16:32 -0600)]
wdc: Fix use-after-free access of cbs_data

Fix incorrect access after memory is already freed up. Also couple
of minor fixes to use correct cpu endianness while accessing data
read from drive.

Create a new function wdc_get_fw_cust_id that will simplfy the code
and handle the free of the allocated data

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
Co-Authored-by: Indraneel-M
[dwagner: updated commit message and merged everything into one patch]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Update help text for --force
Daniel Wagner [Tue, 15 Feb 2022 15:05:32 +0000 (16:05 +0100)]
nvme: Update help text for --force

The short flag version --force has been removed in
90592d5188fe ("nvme: Consolidate --force option and udpate
documetation") but the help text didn't get updated.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Open device exclusive for write command
Daniel Wagner [Tue, 15 Feb 2022 15:00:53 +0000 (16:00 +0100)]
nvme: Open device exclusive for write command

Commit 2100609ddefb ("nvme: open namespace exclusive by default")
tried to make the write command a bit safer by asking to open the
device exclusive. Because the commit got reverted let's add the main
change back which is to use O_EXCL for write commands on default.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Only open device once
Daniel Wagner [Tue, 15 Feb 2022 14:26:37 +0000 (15:26 +0100)]
nvme: Only open device once

open_exclusive() takes care with opening the device. Do not open a
second time the device.

open_exclusive() has an overwrite flag. Document it a bit better by
renaming it what it actually means. The idea here is that the device
is openened with O_EXCL and when forced is used, open without this
flag.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Rename force variable to force_unit_access
Daniel Wagner [Tue, 15 Feb 2022 14:20:03 +0000 (15:20 +0100)]
nvme: Rename force variable to force_unit_access

Distinguish clearly between 'force' and 'force_unit_access' help text
by renaming the variable accordingly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoRevert "nvme: open namespace exclusive by default"
Daniel Wagner [Tue, 15 Feb 2022 14:16:25 +0000 (15:16 +0100)]
Revert "nvme: open namespace exclusive by default"

This reverts commit 2100609ddefbe5f2c93a6ba8fcf82e9adc3abcb9.

3 years agoupdate libnvme commit-id
Hanumanthu H [Tue, 15 Feb 2022 11:59:59 +0000 (17:29 +0530)]
update libnvme commit-id

3 years agoMerge pull request #1378 from samiWaheed/master
Daniel Wagner [Tue, 15 Feb 2022 09:05:42 +0000 (10:05 +0100)]
Merge pull request #1378 from samiWaheed/master

Update nvme-print.c:  Only print FW slots that contain  a valid FW image revision number

3 years agoMerge pull request #1377 from martin-gpy/ontapdevices_json_segfault
Hannes Reinecke [Tue, 15 Feb 2022 06:52:57 +0000 (07:52 +0100)]
Merge pull request #1377 from martin-gpy/ontapdevices_json_segfault

netapp-nvme: fix ontapdevices segfault in json output

3 years agoMicron plugin version 1.0.8
Hanumanthu H [Tue, 15 Feb 2022 03:44:53 +0000 (09:14 +0530)]
Micron plugin version 1.0.8

3 years agoUpdate nvme-print.c
Sami Waheed [Mon, 14 Feb 2022 22:51:57 +0000 (14:51 -0800)]
Update nvme-print.c

3 years agonetapp-nvme: fix ontapdevices segfault in json output
Martin George [Mon, 14 Feb 2022 18:54:07 +0000 (00:24 +0530)]
netapp-nvme: fix ontapdevices segfault in json output

After the upgrade to libnvme, the NetApp plugin for ontapdevices
now segfaults due to the wrong json object type as shown below:

nvme: json_object.c:1194: json_object_array_add:
Assertion `json_object_get_type(jso) == json_type_array' failed.
Aborted (core dumped)

Fix this by passing the appropriate json array type for
ontapdevices. Include a couple of minor changes here as well -
add a newline to the end of the json output, and then free the
json root device.

Signed-off-by: Martin George <marting@netapp.com>
3 years agobuild: Update libnvme wrap v2.0-rc3
Daniel Wagner [Fri, 11 Feb 2022 13:02:53 +0000 (14:02 +0100)]
build: Update libnvme wrap

Update to v1.0-rc3 of libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1373 from sc108-lee/fix/io_cmd
Daniel Wagner [Fri, 11 Feb 2022 11:44:38 +0000 (12:44 +0100)]
Merge pull request #1373 from sc108-lee/fix/io_cmd

nvme: fix dsm, dspec wrong usage

3 years agonvme: No need to get nsid twice
Steven Seungcheol Lee [Fri, 11 Feb 2022 07:44:38 +0000 (16:44 +0900)]
nvme: No need to get nsid twice

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: io dry-run command meant to be show command based on help
Steven Seungcheol Lee [Fri, 11 Feb 2022 07:23:17 +0000 (16:23 +0900)]
nvme: io dry-run command meant to be show command based on help

even if show-command arg is not given, it should show command

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: fix dsm, dspec wrong usage
Steven Seungcheol Lee [Fri, 11 Feb 2022 07:02:18 +0000 (16:02 +0900)]
nvme: fix dsm, dspec wrong usage

dsm is 8bits on Command Dword13 [07:00]
dspec should issued on nvme_io_args.dspec

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agosubproject: libnvme.wrap update
Steven Seungcheol Lee [Fri, 11 Feb 2022 11:10:06 +0000 (20:10 +0900)]
subproject: libnvme.wrap update

nvme_io_args.dspec changed as 16bits

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #1371 from jeffreyalien/sn650-fix
Daniel Wagner [Fri, 11 Feb 2022 08:24:43 +0000 (09:24 +0100)]
Merge pull request #1371 from jeffreyalien/sn650-fix

[nvme-cli] Fix sn650 capabilities setting

3 years ago[nvme-cli] Fix sn650 capabilities setting
Jeff Lien [Thu, 10 Feb 2022 21:00:14 +0000 (15:00 -0600)]
[nvme-cli] Fix sn650 capabilities setting
  Change sn450 name to sn560
  Update wdc plugin version to 1.16.3

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1370 from igaw/fix-json-output-list-subsys
Daniel Wagner [Thu, 10 Feb 2022 18:03:35 +0000 (19:03 +0100)]
Merge pull request #1370 from igaw/fix-json-output-list-subsys

nvme-print: Fix json output for list-subsys

3 years agonvme-print: Fix json output for list-subsys
Daniel Wagner [Thu, 10 Feb 2022 17:49:47 +0000 (18:49 +0100)]
nvme-print: Fix json output for list-subsys

The root needs to be an array an not an object.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1369 from igaw/fix-verbose-flag
Daniel Wagner [Thu, 10 Feb 2022 18:00:10 +0000 (19:00 +0100)]
Merge pull request #1369 from igaw/fix-verbose-flag

argconfig: Increase the flag value

3 years agonvme: Allow --verbose flag to increase log level
Daniel Wagner [Thu, 10 Feb 2022 17:50:51 +0000 (18:50 +0100)]
nvme: Allow --verbose flag to increase log level

Mark the option as an increase option to increase the log level if
needed.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoargconfig: Increase the flag value
Daniel Wagner [Thu, 10 Feb 2022 16:57:01 +0000 (17:57 +0100)]
argconfig: Increase the flag value

If the flag is provided several time increase the flag value. This is
a pretty ugly fix for how getopt_long_only() handles '--verbose' vs
'-v'. getopt_long_only() returns 0 when --verbose is used and 'v' for
-v hence we will not usually not take the short option path for
--verbose.

Break out in the short option parsing when non flag options are used.

Another uglyliness here is that it sets up long options differently
depending on short or long version is used. For the short version we
have to use value_addr.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1368 from sc108-lee/remove/unused
Daniel Wagner [Thu, 10 Feb 2022 10:14:32 +0000 (11:14 +0100)]
Merge pull request #1368 from sc108-lee/remove/unused

common.h: remove unused macros

3 years agocommon.h: remove unused macros
Steven Seungcheol Lee [Thu, 10 Feb 2022 09:32:08 +0000 (18:32 +0900)]
common.h: remove unused macros

round_up is not used
__stringify is defined in define_cmd and used
__fallthrough__ not used, occur error from lower version of GCC

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #1363 from igaw/cleanup-libuuid-dep
Daniel Wagner [Thu, 10 Feb 2022 08:48:22 +0000 (09:48 +0100)]
Merge pull request #1363 from igaw/cleanup-libuuid-dep

nvme-print: Remove dead !LIBUUID code

3 years agoMerge pull request #1361 from igaw/doc-build
Daniel Wagner [Thu, 10 Feb 2022 08:46:05 +0000 (09:46 +0100)]
Merge pull request #1361 from igaw/doc-build

docs: Introduce documentation build option

3 years agoMerge pull request #1357 from igaw/fix-force-flag-parsing
Daniel Wagner [Thu, 10 Feb 2022 08:44:22 +0000 (09:44 +0100)]
Merge pull request #1357 from igaw/fix-force-flag-parsing

nvme: Fix --force flag inversion

3 years agoMerge pull request #1367 from jeffreyalien/sn650-fix
Daniel Wagner [Wed, 9 Feb 2022 15:20:54 +0000 (16:20 +0100)]
Merge pull request #1367 from jeffreyalien/sn650-fix

[nvme-cli] Fix vs-smart-add-log command for SN650 devices

3 years ago[nvme-cli] Fix vs-smart-add-log command for SN650 devices
Jeff Lien [Mon, 7 Feb 2022 22:50:41 +0000 (16:50 -0600)]
[nvme-cli] Fix vs-smart-add-log command for SN650 devices

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1366 from AkhileshRN/SN_telemetry
Daniel Wagner [Wed, 9 Feb 2022 13:47:13 +0000 (14:47 +0100)]
Merge pull request #1366 from AkhileshRN/SN_telemetry

Added telemetry log fetch support for WDC vs-internal-log command

3 years agoAdded telemetry log fetch support for SN810, SN530 and SN740 series NVMe SSDs through...
AkhileshRN [Wed, 9 Feb 2022 12:33:37 +0000 (18:03 +0530)]
Added telemetry log fetch support for SN810, SN530 and SN740 series NVMe SSDs through wdc vs-internal-log command

3 years agonvme-print: Remove dead !LIBUUID code
Daniel Wagner [Tue, 8 Feb 2022 17:33:45 +0000 (18:33 +0100)]
nvme-print: Remove dead !LIBUUID code

We have added a hard dependency to libuuid. Remove the ifdefs and the
dead code.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agodocs: Introduce documentation build option
Daniel Wagner [Tue, 8 Feb 2022 15:37:41 +0000 (16:37 +0100)]
docs: Introduce documentation build option

Build the documentation only if explicitly asked to build it. If not
fallback to install the precompiled versions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1358 from igaw/fix-matching-nvmf-connect
Daniel Wagner [Tue, 8 Feb 2022 14:49:58 +0000 (15:49 +0100)]
Merge pull request #1358 from igaw/fix-matching-nvmf-connect

nvmf: Remove --matching from systemd service file

3 years agonvmf: Remove --matching from systemd service file
Daniel Wagner [Tue, 8 Feb 2022 14:27:33 +0000 (15:27 +0100)]
nvmf: Remove --matching from systemd service file

'--matching' is not a great concept. The whole point of a discovery
log is to return different port addresses from the one we're using.

Thus the '--matching' logic was dropped when switching over the
libnvme but we forgot to remove it from the systemd service file.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Fix --force flag inversion
Daniel Wagner [Tue, 8 Feb 2022 11:13:34 +0000 (12:13 +0100)]
nvme: Fix --force flag inversion

argparse sets the default_value member when the argument has been
provided by the user. But in parse_and_open we set O_EXCL when --force
is not used.

It also introduced a regression in the 'id-ns' where the --force flag
is used to determine which function is used to identify the
namespace (nvme_identify_allocated_ns() vs nvme_identify_ns()).

Fixes: 2100609 ("nvme: open namespace exclusive by default")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1349 from jeffreyalien/telemetry-da4
Daniel Wagner [Tue, 8 Feb 2022 10:20:02 +0000 (11:20 +0100)]
Merge pull request #1349 from jeffreyalien/telemetry-da4

[nvme-cli] Add support for data area 4 to get-telemetry-log

3 years agonvme: Add support for data area 4 to get-telemetry-log
Jeff Lien [Mon, 31 Jan 2022 22:25:38 +0000 (16:25 -0600)]
nvme: Add support for data area 4 to get-telemetry-log

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agobuild: Update libnvme wrap
Daniel Wagner [Tue, 8 Feb 2022 10:12:03 +0000 (11:12 +0100)]
build: Update libnvme wrap

Update to the latest version of libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1342 from Arunpandian15/Supported_Cap_Config_List_Log_Page
Daniel Wagner [Tue, 8 Feb 2022 10:08:19 +0000 (11:08 +0100)]
Merge pull request #1342 from Arunpandian15/Supported_Cap_Config_List_Log_Page

nvme: Add Supported Capacity Configuration List log page(LID: 0x11)

3 years agoMerge pull request #1355 from igaw/fix-libjson-define
Daniel Wagner [Tue, 8 Feb 2022 09:34:05 +0000 (10:34 +0100)]
Merge pull request #1355 from igaw/fix-libjson-define

nvme: Rename LIBJSONC_14 to CONFIG_JSONC_14

3 years agonvme: Rename LIBJSONC_14 to CONFIG_JSONC_14
Daniel Wagner [Tue, 8 Feb 2022 09:27:17 +0000 (10:27 +0100)]
nvme: Rename LIBJSONC_14 to CONFIG_JSONC_14

We missed to rename LIBJSONC_14 to CONFIG_JSONC_14 in the nvme.h
header file in 4c3a8c058eb3 ("build: Prefix configuration options").

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Add Supported Capacity Configuration List log page(LID: 0x11)
Arunpandian J [Mon, 7 Feb 2022 05:40:22 +0000 (11:10 +0530)]
nvme: Add Supported Capacity Configuration List log page(LID: 0x11)

Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Signed-off-by: Arunpandian J <apj.arun@samsung.com>
3 years agoMerge pull request #1353 from igaw/fail-on-warnings
Daniel Wagner [Mon, 7 Feb 2022 14:29:39 +0000 (15:29 +0100)]
Merge pull request #1353 from igaw/fail-on-warnings

build: Make CI build fail on warnings.

3 years agonvme: Provide format string for fprintf in get_ns_id
Daniel Wagner [Mon, 7 Feb 2022 14:26:39 +0000 (15:26 +0100)]
nvme: Provide format string for fprintf in get_ns_id

fprintf() expects a format string. Update the error string handling to
usual pattern.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Make CI build fail on warnings.
Daniel Wagner [Mon, 7 Feb 2022 14:13:40 +0000 (15:13 +0100)]
build: Make CI build fail on warnings.

Currently, warnings are hidden in the logs and the build is marked as
succeeded. Mark all warnings as error so that we see them show up in
the review process.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1352 from Arunpandian15/Enhanced_ctlr_MD
Daniel Wagner [Fri, 4 Feb 2022 13:18:19 +0000 (14:18 +0100)]
Merge pull request #1352 from Arunpandian15/Enhanced_ctlr_MD

nvme: Add Enhanced Controller Meta Data(FID: 0x7D)

3 years agonvme: Add Enhanced Controller Meta Data(FID: 0x7D)
Arunpandian J [Fri, 4 Feb 2022 09:55:50 +0000 (15:25 +0530)]
nvme: Add Enhanced Controller Meta Data(FID: 0x7D)

Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Signed-off-by: Arunpandian J <apj.arun@samsung.com>
3 years agonvme-print: Add NVME_FEAT_FID_ENH_CTRL_METADATA to nvme_feature_to_string
Daniel Wagner [Fri, 4 Feb 2022 13:14:27 +0000 (14:14 +0100)]
nvme-print: Add NVME_FEAT_FID_ENH_CTRL_METADATA to nvme_feature_to_string

Add missing NVME_FEAT_FID_ENH_CTRL_METADATA to stringify function
nvme_feature_to_string().

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1312 from sc108-lee/for-upstream/tp4095
Daniel Wagner [Fri, 4 Feb 2022 13:11:19 +0000 (14:11 +0100)]
Merge pull request #1312 from sc108-lee/for-upstream/tp4095

For upstream/tp4095

3 years agonvme-print: remove unused nvme_show_id_ctrl function
Steven Seungcheol Lee [Fri, 4 Feb 2022 08:48:11 +0000 (17:48 +0900)]
nvme-print: remove unused nvme_show_id_ctrl function

rename __nvme_show_id_ctrl -> nvme_show_id_ctrl

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: Add nvm-id-ns-lba-format(CNS 0Ah) command from TP4095
Steven Seungcheol Lee [Fri, 7 Jan 2022 09:37:06 +0000 (18:37 +0900)]
nvme: Add nvm-id-ns-lba-format(CNS 0Ah) command from TP4095

I/O Command Set specific Identify Namespace data structure
for the specified LBA Format index for the NVM Command Set
specified in the CSI field.

None capabilities from nvme_id_ns structure are returned as 0 with this command
Set maximum nlbaf when identify ns for all ns is failed to print elbafs

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: Add NVM Command Set specific identify namespace command
Steven Seungcheol Lee [Thu, 6 Jan 2022 12:53:08 +0000 (21:53 +0900)]
nvme: Add NVM Command Set specific identify namespace command

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: Add id-ns-lba-format(CNS 09h) command from TP4095
Steven Seungcheol Lee [Thu, 6 Jan 2022 07:54:07 +0000 (16:54 +0900)]
nvme: Add id-ns-lba-format(CNS 09h) command from TP4095

Identify Namespace data structure for the specified
User Data Format index containing the namespace capabilities
for the NVM Command Set.

None capabilities from nvme_id_ns structure are returned as 0 with this command

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: Add nulbaf(Number of Unique Capability LBA Formats) field on nvmd_id_ns
Steven Seungcheol Lee [Wed, 5 Jan 2022 08:03:09 +0000 (17:03 +0900)]
nvme: Add nulbaf(Number of Unique Capability LBA Formats) field on nvmd_id_ns

Based on spec NVMe - TP 4095 Namespace Capability Reporting 2021.06.28 - Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agosubprojects: libnvme update
Steven Seungcheol Lee [Mon, 17 Jan 2022 07:21:55 +0000 (16:21 +0900)]
subprojects: libnvme update

Include tp4095 changes

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #1351 from sc108-lee/fix/dracut_dir
Daniel Wagner [Fri, 4 Feb 2022 07:22:05 +0000 (08:22 +0100)]
Merge pull request #1351 from sc108-lee/fix/dracut_dir

meson: fix default dracut directory based on dracut manual

3 years agomeson: fix default dracut directory based on dracut manual
Steven Seungcheol Lee [Fri, 4 Feb 2022 07:13:04 +0000 (16:13 +0900)]
meson: fix default dracut directory based on dracut manual

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #1344 from sc108-lee/fix/rpmbuild
Daniel Wagner [Fri, 4 Feb 2022 06:50:00 +0000 (07:50 +0100)]
Merge pull request #1344 from sc108-lee/fix/rpmbuild

Fix/rpmbuild

3 years agoMerge pull request #1350 from amaier17/andrew/fix-readme
Daniel Wagner [Fri, 4 Feb 2022 06:40:21 +0000 (07:40 +0100)]
Merge pull request #1350 from amaier17/andrew/fix-readme

README: Update the ubuntu install instructions and fix a formatting issue

3 years agorpmbuild: Add json required version that detected from meson
Steven Seungcheol Lee [Fri, 28 Jan 2022 07:53:52 +0000 (16:53 +0900)]
rpmbuild: Add json required version that detected from meson

With higher version of json-c, yum install shows required version of it
Error: Package: nvme-2.0-1.el7.x86_64 (/nvme-2.0-1.el7.x86_64)
           Requires: json-c >= 0.14
           Installed: json-c-0.11-4.el7_0.x86_64 (@anaconda)
               json-c = 0.11-4.el7_0

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agorpmbuild: enable rpmbuild via make rpm
Steven Seungcheol Lee [Thu, 27 Jan 2022 11:40:36 +0000 (20:40 +0900)]
rpmbuild: enable rpmbuild via make rpm

Makefile:
  add make rpm via meson
  rename libnvme -> nvme on Makefile

meson.build, meson_options.txt:
  using former path that nvme provided
  using libdir to be installed right place (32bit -> lib, 64bit -> lib64)

rpmbuild:
  remove unnecessary rpm stages
  since rpm spec file created from meson build
  no need to pacaking it to rpmbuild directory
  build in meson directory
  using rpmbuild directory for install & packaging rpm

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoREADME: Fix 80 character formatting issue
Andrew Maier [Thu, 3 Feb 2022 18:59:19 +0000 (11:59 -0700)]
README: Fix 80 character formatting issue

3 years agoREADME: Update the ubuntu install instructions
Andrew Maier [Thu, 3 Feb 2022 18:55:56 +0000 (11:55 -0700)]
README: Update the ubuntu install instructions

nvme-cli is now a supported package in the Ubuntu universe (from Xenial
and above). Therefore, we can remove the reference to the sbates ppa.
This patch also updates the wording around the supported packages and
architectures.

3 years agoMerge pull request #1346 from igaw/update-logging v2.0-rc2
Daniel Wagner [Tue, 1 Feb 2022 10:57:06 +0000 (11:57 +0100)]
Merge pull request #1346 from igaw/update-logging

nvme: Adapt to logging changes in libnvme

3 years agonvme: Adapt to logging changes in libnvme
Daniel Wagner [Mon, 31 Jan 2022 13:34:33 +0000 (14:34 +0100)]
nvme: Adapt to logging changes in libnvme

libnvme allows to define which file descriptor should be used for
logging. This is only for the fabric related interface relevant hence
this is attached to the nvme_root_r object.

Use common code for this into a helper which maps the verbose command
line levels to the correct log levels.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Update libnvme wrap
Daniel Wagner [Tue, 1 Feb 2022 10:47:55 +0000 (11:47 +0100)]
build: Update libnvme wrap

Update to the latest version of libnvme.

3 years agoMerge pull request #1345 from igaw/nvme_strerror
Hannes Reinecke [Sat, 29 Jan 2022 08:31:34 +0000 (09:31 +0100)]
Merge pull request #1345 from igaw/nvme_strerror

Handle libnvme error codes and return proper error code when termiating nvme-cli

3 years agotree: Stringify libnvme error codes
Daniel Wagner [Fri, 28 Jan 2022 13:52:25 +0000 (14:52 +0100)]
tree: Stringify libnvme error codes

libnvme can return library specific error codes. Introduce a wrapper
which makes sure we print a proper error text.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agotree: Do not map status to errno codes
Daniel Wagner [Fri, 28 Jan 2022 17:58:45 +0000 (18:58 +0100)]
tree: Do not map status to errno codes

The caller of the commands is not interersted in any mapping
of status codes to error codes. It only wants to know success(0) or
failure (!=0). Remove all nvme_status_to_errno() calls.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Return 0 on success and 1 on error
Daniel Wagner [Fri, 28 Jan 2022 13:35:50 +0000 (14:35 +0100)]
nvme: Return 0 on success and 1 on error

main() should return 0 on success and 1 on error. Generally there are
not fixed rules. Though SUSv3 specifies EXIT_SUCCESS(0) and
EXIT_FAILURE(1).

The main reason why we should avoid anything but 0/1 is the shell
interpretes those return codes. Values above 128 can cause confusion
in shell scripts. When a command is terminated by a signal, the
shell indicates this fact by setting the value of the variable $?
to 128 plus the signal number.

See also
  https://stackoverflow.com/questions/1101957/are-there-any-standard-exit-status-codes-in-linux
  https://tldp.org/LDP/abs/html/exitcodes.html

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Do no try to print out of memory message
Daniel Wagner [Fri, 28 Jan 2022 17:40:16 +0000 (18:40 +0100)]
nvme: Do no try to print out of memory message

Avoid allocating new memory for printing an error message when we run
out memory.

While at also remove all errno assigments as we do use them later.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1343 from igaw/fix-list-ns
Daniel Wagner [Fri, 28 Jan 2022 12:40:46 +0000 (13:40 +0100)]
Merge pull request #1343 from igaw/fix-list-ns

nvme: Call nvme_identify_*list with correct nsid offset

3 years agonvme: Call nvme_identify_*list with correct nsid offset
Daniel Wagner [Thu, 27 Jan 2022 10:06:39 +0000 (11:06 +0100)]
nvme: Call nvme_identify_*list with correct nsid offset

Commit 81bb8289f642 ("nvme: update list-ns nsid option") changed the
start index for the namespace argument. But the merge back from the
monolithic branch was incomplete and missed to update the index offset
when calling nvme_identify_allocated_ns_list and
nvme_identify_active_ns_list.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1338 from ikegami-t/telemetry-log
Daniel Wagner [Thu, 27 Jan 2022 08:38:37 +0000 (09:38 +0100)]
Merge pull request #1338 from ikegami-t/telemetry-log

nvme: MAINT: Refactor telemetry-log command for build warning #1323

3 years agonvme: Use canonical types
Tokunori Ikegami [Thu, 27 Jan 2022 08:31:30 +0000 (09:31 +0100)]
nvme: Use canonical types

Use the more common type names.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: carved this change from other independ change]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: Refactor telemetry-log command for build warning #1323
Tokunori Ikegami [Fri, 21 Jan 2022 15:58:38 +0000 (00:58 +0900)]
nvme: Refactor telemetry-log command for build warning #1323

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agoMerge pull request #1341 from jeffreyalien/new-dev-support2
Daniel Wagner [Tue, 25 Jan 2022 16:58:09 +0000 (17:58 +0100)]
Merge pull request #1341 from jeffreyalien/new-dev-support2

[nvme-cli] Add support for Additional SN450 Device

3 years agoMerge pull request #1340 from hreinecke/tls-key
Hannes Reinecke [Mon, 24 Jan 2022 10:34:42 +0000 (11:34 +0100)]
Merge pull request #1340 from hreinecke/tls-key

nvme: fixup 'check-tls-key'

3 years agoMerge pull request #1339 from igaw/drop-nvme_msg
Daniel Wagner [Mon, 24 Jan 2022 10:33:56 +0000 (11:33 +0100)]
Merge pull request #1339 from igaw/drop-nvme_msg

fabrics: Stop using nvme_msg from libnvme

3 years agonvme: fixup 'check-tls-key'
Hannes Reinecke [Mon, 24 Jan 2022 10:33:23 +0000 (11:33 +0100)]
nvme: fixup 'check-tls-key'

The offsets into the key are wrong, causing the check to fail on
valid keys.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: Stop using nvme_msg from libnvme
Daniel Wagner [Fri, 21 Jan 2022 17:01:33 +0000 (18:01 +0100)]
fabrics: Stop using nvme_msg from libnvme

nvme_msg() is logging function from libnvme. The cli should not use
the logging infrastructure from the library instead it should use it's
own infrastructure. At this point nvme-cli doesn't have one, so just
use the default stderr for all error messages.

This is a preperation step to unexport the nvme_msg() from libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1337 from hreinecke/disable-sqflow v2.0-rc1
Hannes Reinecke [Fri, 21 Jan 2022 12:58:16 +0000 (13:58 +0100)]
Merge pull request #1337 from hreinecke/disable-sqflow

build: Update libnvme wrap

3 years agobuild: Update libnvme wrap
Hannes Reinecke [Fri, 21 Jan 2022 10:09:52 +0000 (11:09 +0100)]
build: Update libnvme wrap

Get updated nvmf_add_ctrl() argument list (libnvme PR#195)
and fixup callers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1336 from hreinecke/ctrl-init
Hannes Reinecke [Fri, 21 Jan 2022 12:08:34 +0000 (13:08 +0100)]
Merge pull request #1336 from hreinecke/ctrl-init

build: Update libnvme wrap