Daniel Wagner [Tue, 16 Aug 2022 06:12:24 +0000 (08:12 +0200)]
json: Support uint64 types serialization for older json-c versions
Notable json-c 0.13 is lacking support for serializing uint64_t
types. At this point of writing the 0.13 version is widely
deployed. Let's add our own version of the serialization function as
fallback.
Observing unwanted side-effects with nvme discovery. For e.g., running
a simple 'nvme discover' command ends up invoking connect-all as well,
creating namespaces on the host.
One can also see spurious discovery controllers in the 'nvme
list-subsys' output, despite having not created any persistent
discovery controllers at all.
Reported-by: Martin George <Martin.George@netapp.com> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Jeremy Kerr [Thu, 14 Jul 2022 07:01:22 +0000 (15:01 +0800)]
nvme: Simplify ns list identify
Rather than multiplexing over four functions (which all then call
nvme_identify) just use nvme_identify directly, and set the identify
parameters according to the 'csi' and 'all' parameters.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
[dwagner: changed how the struct args is initialized] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Jeremy Kerr [Tue, 12 Jul 2022 06:45:29 +0000 (14:45 +0800)]
plugins/solidigm: fix return value on format parse failure
If validate_output_format() fails, there are a couple of paths in the
solidgm code that will return a (closed) file descriptor, rather than an
error status. This looks to be a couple of copy-and-paste errors.
This change fixes the return value for these failure path, ensuring that
we'll actually have an error return.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Daniel Wagner [Mon, 1 Aug 2022 11:52:31 +0000 (13:52 +0200)]
fabrics: Remove dhchap-ctrl-secret from discover/connect-all
The dhchap-ctrl-secret is per controller but discover and connect-all
operate on several controllers.
As this get's very fast complicated how to express this on the command
line, just drop the it. It was not implemented anyway and not listed
in the documentation.
Daniel Wagner [Fri, 22 Jul 2022 12:12:00 +0000 (14:12 +0200)]
nvme: Set default rae value for nvme_get_nsid_log users
libnvme 1.0 hard codes the rae value for all nvme_get_nsid_log to
false. The upcoming 1.1 release will pass the rae value through
to the kernel. This is causing a behavior change. To be on the safe
side set all rae=true to false.
At least for nvme_get_log_error and nvme_get_log_smart this seems also
what the spec recommends.
Reported-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Tue, 19 Jul 2022 09:53:12 +0000 (11:53 +0200)]
fabrics: Avoid nvme_scan_ctrl when disconnecting
In certain corner cases, the kernel will not populate a nvme subsystem
but only create a nvme controller. nvme_scan_ctrl will fail in such
scenarios to find the controller object. Let's do the lookup based on
the ctrl name only.
Daniel Wagner [Mon, 18 Jul 2022 14:08:38 +0000 (16:08 +0200)]
build: Update release version rules
Include the release candidate version string into the project
version. This allows to upload every release candidate to PyPI instead
just the final release.
Martin George [Tue, 12 Jul 2022 08:31:08 +0000 (14:01 +0530)]
nvme: fix nvme get-feature with -H option
Currently, nvme get-feature with the -H option fails to print detailed
info for specific feature ids such as number of IO queues (fid=0x07),
async event config (fid=0x0b), KATO value (fid=0x0f), etc. This is
because nvme_feature_show_fields() is invoked only if the corresponding
'buf' pointer is valid, which is not necessary for the above feature
ids. So fix this by removing this restriction while invoking
nvme_feature_show_fields(). At the same time, ensure this 'buf' pointer
is appropriately validated before use in this function.
Fixes: bcab212 ("nvme: coverity fixes") Signed-off-by: Martin George <marting@netapp.com>
Jeremy Kerr [Tue, 12 Jul 2022 07:27:55 +0000 (15:27 +0800)]
plugins/wdc: prevent double close in wdc_do_cap_telemetry_log
Currently, wdc_do_cap_telemetry_log will close the NVMe fd before
returning, but so it all of its call sites. Since we'd be better off
making the fd open/close symmetrical, drop the close from
wdc_do_cap_telemetry_log.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Daniel Wagner [Fri, 8 Jul 2022 10:18:03 +0000 (12:18 +0200)]
nvme: Use correct json serializing for long doubles
Fixup all places which use json_object_add_value_float() to serialize
long double types with json_object_add_value_double(). The float
version cuts off the upper 64 bits of the 128 bit long double type.
submit_io is an internal functions and all callers pass the correct
opcode in. Thus no need to reparse and select the right wrapper
function (nvme_read, nvme_write, ...). Instead just pass the opcode to
the generic nvme_io function.
Note, the compare was fixed in 9b6d3fca4289 ("submit_io(): fix "nvme
compare" to pass correct command") but missed the opportunity to
cleanup this part.
Sagi Grimberg [Mon, 27 Jun 2022 08:06:50 +0000 (11:06 +0300)]
udev: re-read the discovery log page when a discovery controller reconnected
When using persistent discovery controllers, if the discovery
controller loses connectivity and manage to reconnect after a while,
we need to retrieve again the discovery log page in order to learn
about possible changes that may have occurred during this time as
discovery log change events were lost.
Daniel Wagner [Fri, 24 Jun 2022 07:05:18 +0000 (09:05 +0200)]
ci: Add auto review bot
Arthur has asked to be added as reviewer to the OCP plugin changes.
Let's setup an auto review bot. We might also want to hook up this for
the other plugins in the future.
innogritkenny [Tue, 21 Jun 2022 01:57:29 +0000 (09:57 +0800)]
plugins: Add innogrit plugin
Add support for the innogrit plugin. It supports following commands:
smart-log-add
get-eventlog
get-cdump
Code provided by innogritkenny
[dwagner: Whitespace fixes and small code refactorings.
Added a commit message] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Evgeny Grin [Fri, 17 Jun 2022 12:00:39 +0000 (15:00 +0300)]
bash-nvme-completion.sh: a better fix for "readonly" with bash 5.x
The error with one-line "readonly" with assignment on bash 5.x was fixed
by 25fd8c707b106ca0763402566ad657ef710bf09e. This commit restores "readonly"
functionality and adds some uniformity.