Jeremy Kerr [Mon, 26 Sep 2022 13:10:22 +0000 (21:10 +0800)]
mi: Move post-1.1 symbols to 1_2 section of libnvme-mi.map
There have been a few functions added after the v1.1 release that ended
up in the 1_1 section of the symbol map. This change moves them to a new
1_2 section instead.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Martin Belanger [Mon, 26 Sep 2022 11:13:55 +0000 (07:13 -0400)]
fabrics: Add nvmf_get_discovery_wargs()
This function is similar to nvmf_get_discovery_log(), but takes
an extensible "args" parameter. The args parameter contains more
options than are available with nvmf_get_discovery_log(). For
example, it provides a way to set the LSP (Log page Specific field)
which is needed for advanced TP8010 features.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Jeremy Kerr [Sat, 24 Sep 2022 09:01:08 +0000 (17:01 +0800)]
mi: Introduce a helper for response status, unify values with ioctls
Currently, every admin command function has a similar pattern for
catching an error from one of:
- the MI transport; or
- the admin cdw0 field, sometimes populated to a result pointer
This change adds a helper for that pattern.
Then, instead of using cdw0 for the return value, we should be using
cdw3 instead, as cdw0 is command-specific, and may not always indicate
an error. We can then return the proper status type & status, in the
same way that the ioctl commands do.
This goes part way to fixing
https://github.com/linux-nvme/libnvme/issues/456, but we still have an
issue where the MI return values may alias the cdw3 return values.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Jeremy Kerr [Sat, 24 Sep 2022 02:49:16 +0000 (10:49 +0800)]
github workflows: Add an armhf cross build
This RFC change adds a github workflow for a cross-compile of libnvme on
armhf. We use a similar setup to the build-distro job, but install a
suitable cross compiler and provide a cross config to meson.
We currently setup with -Dpython=false, as the setup-python@v4 seems to
assume a native python build. We may be able to remove this later.
The suitability of this will depend on the resources available for
actions; doing some test runs on a private repo shows an execution time
of about 1 min 15 sec - a little less than the build-static job.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
error: invalid conversion from 'int' to 'nvme_mi_config_smbus_freq'
error: designator order for field 'nvme_ns_mgmt_args::nsid' does not match declaration order in 'nvme_ns_mgmt_args'
Jeremy Kerr [Fri, 9 Sep 2022 10:10:10 +0000 (18:10 +0800)]
examples/mi-mctp: fix warning for possibly uninitialised variable
gcc-12 with -Wuninitialized-var reports a warning for mi-mctp:
examples/mi-mctp.c: In function ‘do_action_endpoint’:
examples/mi-mctp.c:665:16: warning: ‘rc’ may be used uninitialized [-Wmaybe-uninitialized]
665 | return rc;
| ^~
examples/mi-mctp.c:637:13: note: ‘rc’ was declared here
637 | int rc;
| ^~
We shouldn't be able to hit this path, but explicitly set rc to an error
if we miss an enum case.
Fixes: https://github.com/linux-nvme/libnvme/issues/467 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Daniel Wagner [Tue, 30 Aug 2022 14:03:56 +0000 (16:03 +0200)]
doc: Install pre-compiled man pages to the correct path
The install_subdir('man', ...) command installs the man pages under
$mandir/man/ instead of $mandir. Use and external script to get the
list of man pages to avoid having to list all the man pages
explicitly.
Martin George [Fri, 26 Aug 2022 13:17:57 +0000 (18:47 +0530)]
nvme-tree: avoid segfault if auth keys are unavailable
Seeing multiple segfaults in nvme_configure_ctrl() when the
respective controller attributes (including auth keys) are
unavailable. For e.g. attempting a nvme connect with bidirectional
auth hits the following segfault:
Hannes Reinecke [Thu, 25 Aug 2022 08:27:02 +0000 (10:27 +0200)]
Parse dhchap_host_key on controller level
The json config schema declares an 'dhchap_key' element representing
the dhchap host key on the controller level, but the implementation
was missing. Add the missing parsing elements and ensure to pick the
correct one (either host or controller setting) when creating the
nvme connect string.
Jeremy Kerr [Fri, 12 Aug 2022 04:44:50 +0000 (12:44 +0800)]
mi: Allow Admin-message sized More Processing Required responses
Devices may implement their MPR response as an actual Admin response
message, rather than the simple MI-only message described in 4.1.2.3 of
NVMe-MI v1.2b.
Allow this, but with some fairly stringent header checks. Add a test for
this behaviour too.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Jeremy Kerr [Thu, 21 Jul 2022 08:21:30 +0000 (16:21 +0800)]
example/mi-conf: Add an example for MI transport configuration
With the Read MI Data Structure and MI Configuration Set functions
available, we can query a device for its maximum MTU, and update the
current MTU to suit.
This also requires telling the local MCTP stack about the new MTU too,
by sending a d-bus message to `mctpd`.
This change adds a little example for this functionality, where we
perform the MI query and configuration, and implements the d-bus
communication for the local stack control.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Daniel Wagner [Wed, 3 Aug 2022 11:56:48 +0000 (13:56 +0200)]
util: Add LINE_MAX define
The bionic libc implementation doesn't implement the complete
POSIX API. Apperantly we just need this define to be able
to compile for Android OS. Thus, keep it as simple as possible
and just define it here.
Hannes Reinecke [Fri, 29 Jul 2022 06:14:14 +0000 (08:14 +0200)]
json: fixup dhchap_ctrl_key definitions
The config schema declared a 'dhchap_key' and a 'dhchap_ctrl_key'
value for the port structure, but the json parser implemented a
'dhchap_key' entry for the port (holding the controller key), and
a 'dhchap_key' entry for the host (holding the host key).
Fixup the config schema to declared the correct entries and the
json parser to check for 'dhchap_ctrl_key' instead of 'dhchap_key'.
Daniel Wagner [Fri, 22 Jul 2022 13:30:31 +0000 (15:30 +0200)]
build: Drop -nostdinc for LibreSSL header checks
-nostdinc is only necessary when the LibreSSL is not the default SSL
library on the system and OpenSSL header files are present in the
default include paths.
Though if LibreSSL found in standard paths 'pkg-config --cflags' will
include the standard include paths and hence the header files are not
found.
So -nostdinc is only useful for mixed installations which is very
unlikely a very common setup. So let's just drop the -nostdinc and if
the need is to support such setups, we can still try to figure out
how to support this.
Daniel Wagner [Fri, 22 Jul 2022 12:29:48 +0000 (14:29 +0200)]
ioctl: Honor rae in nvme_get_nsid_log
The nvme_get_nsid_log() helper has a rae (Retain Asynchronous Events)
parameter, but we currently ignore this when constructing the Get Log
Page command arguments.
This is a behavior change and not an API change. But the good thing is
only for newly build binaries because all helpers are static inline
fuctions.
Reported-by: Reported-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Fri, 22 Jul 2022 11:43:10 +0000 (13:43 +0200)]
build: Add support to build against LibreSSL
LibreSSL ships with the same API but has a different version number
scheme. That is LibreSSL 3.x is not providing the OpenSSL 3.x
APIs. Hence we need to test if the OpenSSL 3 APIs are available if
LibreSSL is present.
Reported-by: Ismael Luceno <ismael@linux.com> Signed-off-by: Daniel Wagner <dwagner@suse.de>
Steven Seungcheol Lee [Mon, 4 Jul 2022 05:31:46 +0000 (14:31 +0900)]
rpmbuild: Enable 'make rpm' to build rpm pkgs #408
- meson is needed higher version then what rpm repo offering (use pip install)
- Enable building static library (default: shared)
- Add gitignore since make rpm generates tar.gz (when it is failed)
- libuuid-devel dose not needed as rpm pkgs
it could be installed as some files
if it's not installed, will be downloaded from subprojects of meson
- gcc does not needed as rpm pkgs
meson detect compiler with meson.get_compiler('c')
error: Failed build dependencies:
gcc is needed by libnvme-1.0-0.x86_64
libuuid-devel is needed by libnvme-1.0-0.x86_64
Makefile:43: recipe for target 'rpm' failed
make: *** [rpm] Error 1
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
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.
Daniel Wagner [Mon, 18 Jul 2022 14:06:29 +0000 (16:06 +0200)]
build: Support release candidate version strings
The library_version is constructed from the project_version() which
might be a release candidate version. Let's strip away the release
candidate for the library versioning.
Jeremy Kerr [Mon, 18 Jul 2022 05:10:57 +0000 (13:10 +0800)]
mi: Add endpoint get/set timeout API
This change introduces an API for querying and modifying the endpoint
timeout. Transports may provide a function for valiating a new timeout
value before setting.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Martin Belanger [Mon, 11 Jul 2022 12:28:27 +0000 (08:28 -0400)]
python: add __version__ to libnvme python package
It is customary for Python packages to provide a __version__ attribute.
It's not enough just to copy the files to the build directory, we need
also to run the configure step.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
[dwagner: Added information why meson.build has to be changed] Singed-off-by: Daniel Wagner <dwagner@suse.de>