Daniel Wagner [Wed, 14 Jun 2023 12:03:53 +0000 (14:03 +0200)]
fabrics: Do not print device on connect per default
During the print code refactoring, the show connect message was enabled
per default. To avoid any regressions in application restore the old
behavior and print only the result when the '-o' option is used.
Fixes: 0576d84bf4aa ("fabrics: Move printing functions to the print files") Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Wed, 14 Jun 2023 11:57:35 +0000 (13:57 +0200)]
fabrics: Revert 'fabrics: prevent 'nvme connect' to well-known discovery
NQN'
Unfortunately, blktests nvme/003 depends on this feature. To avoid
any regression in the testsuite revert the change. After this has
been address in blktests we can add it back.
Fixes: 9077d042c04a ("fabrics: prevent 'nvme connect' to well-known discovery NQN") Signed-off-by: Daniel Wagner <dwagner@suse.de>
Sagi Grimberg [Mon, 12 Jun 2023 15:34:06 +0000 (18:34 +0300)]
nvme-print: fix wrong list-subsys output when ns are attached to different ctrls
If we list subsystem controllers not for a specific ns (user did not pass
a namespace device node), we cannot look at the first ns in the subsystem
to list because it may not be attached to all subsystem controllers.
We incorrectly assumes that subsystem namespaces (or at least the first of
them) are attached to all subsystem controllers.
Fix that by showing the multipath subsystem-list flavor only when the user
passed a specific namespace, and fallback to a simple controller list otherwise.
Fixes: cdeaab8fca6e ("nvme-print: Show ANA state only for one namespace") Fixes: 7435ed9ae6a6 ("nvme-print: Show paths from the first namespace only") Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Tue, 6 Jun 2023 15:21:55 +0000 (17:21 +0200)]
nvme: Use correct data buffer size
The submit_io command is using the buffer size provided by the
user. But this size argument might be updated and the correct length
for the buffer is buffer_size. Thus use this value and not the
initial length.
Tokunori Ikegami [Sun, 4 Jun 2023 12:45:40 +0000 (21:45 +0900)]
plugins/zns: Fix zns.c linux kernel check patch errors and warnings
Note: Still the remaining warning messages are not fixed as same with nvme.c.
WARNING: quoted string split across lines
+ const char *desc = "Send a ZNS specific Identify Controller command to "
+ "the given device and report information about the specified "
WARNING: quoted string split across lines
+ "the given device and report information about the specified "
+ "controller in various formats.";
WARNING: quoted string split across lines
+ const char *desc = "Send a ZNS specific Identify Namespace command to "
+ "the given device and report information about the specified "
WARNING: quoted string split across lines
+ "the given device and report information about the specified "
+ "namespace in varios formats.";
WARNING: quoted string split across lines
+ const char *desc = "The zone append command is used to write to a zone "
+ "using the slba of the zone, and the write will be appended from the "
WARNING: quoted string split across lines
+ "using the slba of the zone, and the write will be appended from the "
+ "write pointer of the zone";
Tokunori Ikegami [Sun, 4 Jun 2023 07:55:46 +0000 (16:55 +0900)]
plugins/shannon: Fix shannon-nvme.c linux kernel check patch errors and warnings
Note: Still the remaining warning messages are not fixed as same with nvme.c.
WARNING: quoted string split across lines
+ const char *desc = "Read operating parameters of the "
+ "specified controller. Operating parameters are grouped "
...
WARNING: quoted string split across lines
+ "are vendor-specific and not changeable. Use set-feature to "
+ "change saveable Features.\n\n"
WARNING: quoted string split across lines
+ const char *desc = "Modify the saveable or changeable "
+ "current operating parameters of the controller. Operating "
...
WARNING: quoted string split across lines
+ "Use get-feature to determine which Features are supported by "
+ "the controller and are saveable/changeable.\n\n"
Tokunori Ikegami [Sun, 4 Jun 2023 07:26:47 +0000 (16:26 +0900)]
plugins/seagate: Fix seagate-nvme.c linux kernel check patch warnings
Note: Still the remaining warning messages are not fixed as same with nvme.c.
WARNING: quoted string split across lines
+ const char *log_specific = "1 - controller shall capture Data representing the internal "
+ "state of the controller at the time the command is processed. "
WARNING: quoted string split across lines
+ "state of the controller at the time the command is processed. "
+ "0 - controller shall not update the Telemetry Host Initiated Data.";
Tokunori Ikegami [Sat, 3 Jun 2023 17:38:36 +0000 (02:38 +0900)]
plugins/micron: Fix micron-nvme.c linux kernel check patch errors and warnings
Note: Still the remaining warning messages are not fixed as same with nvme.c.
WARNING: quoted string split across lines
+ "This performs a selective firmware download, which allows the user to "
+ "select which firmware binary to update for 9200 devices. This requires "
WARNING: quoted string split across lines
+ "select which firmware binary to update for 9200 devices. This requires "
+ "a power cycle once the update completes. The options available are:\n\n"
Tokunori Ikegami [Sat, 3 Jun 2023 12:59:21 +0000 (21:59 +0900)]
plugins/memblaze: Fix memblaze-nvme.c linux kernel check patch errors and warnings
Note: Still the remaining warning messages are not fixed as same with nvme.c.
WARNING: quoted string split across lines
+ "This performs a selective firmware download, which allows the user to "
+ "select which firmware binary to update for 9200 devices. This requires a power cycle once the "
WARNING: quoted string split across lines
+ "select which firmware binary to update for 9200 devices. This requires a power cycle once the "
+ "update completes. The options available are:\n\n"
Daniel Wagner [Mon, 5 Jun 2023 15:13:29 +0000 (17:13 +0200)]
nvme: Use correct metadata buffer size
The submit_io command is using the metadata buffer size provided by the
user. But this size argument might be updated and the correct length
for the mbuffer is mbuffer_size. Thus use this value and not the
initial length.
Fixes: 18de3a6d61a7 ("Convert to libnvme") Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Fri, 19 May 2023 16:33:29 +0000 (18:33 +0200)]
print: Introduce print ops structure
Introduce callbacks for printing the nvme data structures. With this we
are able to split the two printing types (stdout and json) and just use
the ops the user selects ('-o json' for example).
Martin George [Mon, 29 May 2023 07:40:33 +0000 (13:10 +0530)]
fabrics: prevent 'nvme connect' to well-known discovery NQN
Using 'nvme connect' to connect to the well-known discovery NQN
could result in a few problems with the current implementation:
1) It does not explicitly disconnect from the discovery subsystem
after usage, thereby leading to a spurious discovery controller
on the host.
2) Multiple 'nvme connect' invocations to the well-known discovery
NQN would result in duplicate discovery controllers on the host.
All this is already handled in 'nvme discover'. So it would be
better to avoid using 'nvme connect' to connect to the well-known
discovery NQN in the first place, and use 'nvme discover' instead
for the same.
Daniel Wagner [Thu, 25 May 2023 17:37:09 +0000 (19:37 +0200)]
nvme-print-json: Update function sigs for !json-c builds
The json_output_* function got updated, but the !json-c case was not
updated accordingly. Update them now.
Fixes: e853da696ea4 ("nvme-print-json: Add json output result function") Fixes: 6e3e1cc8d5b2 ("nvme: Add nvme_show_perror to use instead of perror for json output") Fixes: 2b0bc4d824d0 ("nvme-printf: Add show error function for nvme list command json output") Signed-off-by: Daniel Wagner <dwagner@suse.de>
Maurizio Lombardi [Tue, 23 May 2023 13:08:40 +0000 (15:08 +0200)]
Revert "nvme: Masks SSTAT in sanize-log output"
The NVME_SANITIZE_SSTAT_STATUS_MASK is used to mask the
3 least significant bits (representing the status of the most recent
sanitize operation) of the SSTAT field.
The SSTAT field is 16 bits wide and contains other information too, such
as the Global Data Erased bit and the number of completed passes.
Revert this commit so nvme-cli will print the entire SSTAT field
Caleb Sander [Fri, 12 May 2023 19:41:06 +0000 (13:41 -0600)]
nvmf-autoconnect: restart service to avoid dropping AEN
If another discovery log page change AEN is received while the
autoconnect service is already running for a previous AEN,
the autoconnect service is not being relaunched.
For example, if some of the entries in the log page are not reachable,
attempting to connect to them may take a long time before timing out,
so AENs received while waiting for the connections have no effect.
The AEN is effectively dropped: we ignore the new discovery log entries
and worse, the controller won't send more AENs because it's waiting
for the log page to be fetched in response to the previous AEN.
Use systemctl restart instead of systemctl start
to ensure nvme connect-all is run in response to each AEN.
If a previous instance of the service is already running,
it will be interrupted and the new log page will be fetched.