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.
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.
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.
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.)
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
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.
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.
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>
Stuart Hayes [Fri, 19 Jan 2024 08:15:26 +0000 (09:15 +0100)]
nbft: fix tcp/dhcp address fallback retry
libnvme introduced a specific error code (NVME_CONNECT_ADDRNOTAVAIL)
when the address is not available. Previously, the generic error
code (NVME_CONNENCT_WRITE) was return in this case.
Signed-off-by: Stuart Hayes <stuart_hayes@dell.com>
[dwagner: added commit message] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Martin George [Thu, 11 Jan 2024 10:06:46 +0000 (15:36 +0530)]
nvme: print inserted tls key for check-tls-key
nvme check-tls-key currently misses out successfully printing
the inserted tls key, so print the same. And while we are it,
fix a small typo while printing the error message related to
the failure of generating the identity key.
Martin George [Tue, 19 Dec 2023 16:29:07 +0000 (21:59 +0530)]
fabrics: move hostid/hostnqn warnings to verbose level
Currently nvme connect prints an annoying "use hostid which
does not match uuid in hostnqn" warning even for normal
scenarios when both the hostid and hostnqn files are present.
So move these warnings to verbose level instead.
hris Patterson [Mon, 11 Dec 2023 08:39:23 +0000 (09:39 +0100)]
nvme-print-json: include vs for identify namespace
While the spec may allow for arbitrary use of vendor-specific
data, some implementations are simply strings. JSON will
encode the string, allowing for safe use of control characters.
The only requirement is that the there be a null-byte in the
vendor-specific field terminating the string. Data beyond the
null-byte will be ignored.
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
[dwagner: use d_json instead obj_add_str] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Martin George [Sat, 16 Dec 2023 19:31:50 +0000 (01:01 +0530)]
fabrics: fix connect error if hostid file does not exist
Currently one sees a connect error during a nvme discover/connect
if the hostnqn file exists, but not the hostid file. Fix this
by ensuring the hostid is taken from the corresponding hostnqn for
such scenarios.
Martin George [Sat, 16 Dec 2023 19:15:56 +0000 (00:45 +0530)]
fabrics: fix invalid output format error during nvme connect
Nvme connect currently fails with an "Invalid output format"
error if no output-format is specified to the nvme connect
command. Fix this by initializing the format string.
jeff-lien-wdc [Wed, 13 Dec 2023 21:51:35 +0000 (15:51 -0600)]
wdc: Fix vs-smart-add-log Command for SN650 and SN655
The incorrect log page was being displayed because
the wrong uuid index was being used. This patch
determines the correct uuid index needed for
SN650 and SN655.
Martin George [Thu, 14 Dec 2023 07:32:54 +0000 (13:02 +0530)]
nvme: restric hmac options for gen-tls-key
During nvme gen-tls-key generation, the permitted hmac options is 1
for SHA-256 & 2 for SHA-384 respectively for the retained key. But
nvme-cli mistakenly permits an additional option 3 too which defaults
to SHA-256 itself. Rectify this.
jeff-lien-wdc [Wed, 6 Dec 2023 16:21:06 +0000 (10:21 -0600)]
wdc: Fix UUID index fallback mechanism
For certain devices that don't support UUID lists, there may be multiple
definitions of the C2 logpage. This code will check for UUID list
support and search the UUID list for the correct UUID, if supported. If
UUID lists are not supported, the code will try uuid index 0 and 1 and
use an identification algorithm to determine which is returning the
correct log page data.
Arthur Shau [Tue, 5 Dec 2023 03:45:40 +0000 (19:45 -0800)]
plugins/ocp: Fix printing order of various Latency Monitor Log buckets
Several buckets were being printed out in an incorrect order (so bucket
3 was being labelled as bucket 0, bucket 2 was labelled as bucket 1, 1
was labelled as 2, etc.).
The tables with these affected buckets were the : Active Latency
Timestamp table, Active Measured Latency table, Static Latency Timestamp
table, and Static Measure Latency table.
Also changed active latency configuration to just print out the hex
value, rather than creating another table.
Caleb Sander [Tue, 28 Nov 2023 20:17:45 +0000 (13:17 -0700)]
cleanup: remove unused cleanup_charp()
cleanup_charp() appears to have been copied from libnvme,
but it has no users. _cleanup_free_ is more general, anyways.
So remove cleanup_charp() along with cleanup.c.