]> www.infradead.org Git - users/sagi/libnvme.git/log
users/sagi/libnvme.git
3 years agobuild: Fix *.wrap exclude pattern in .gitignore
Daniel Wagner [Fri, 7 Jan 2022 15:53:50 +0000 (16:53 +0100)]
build: Fix *.wrap exclude pattern in .gitignore

The current rules trigger git to to complain with

 $ git add subprojects/openssl.wrap
 The following paths are ignored by one of your .gitignore files:
 subprojects

We need to keep the parent directory in the tracking domain and just
filter out all sub directories and files except the wrap files.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #163 from igaw/build-check-python-devel
Daniel Wagner [Fri, 7 Jan 2022 14:06:37 +0000 (15:06 +0100)]
Merge pull request #163 from igaw/build-check-python-devel

build: Detect if Python.h header is present

3 years agobuild: Detect if Python.h header is present
Daniel Wagner [Fri, 7 Jan 2022 11:41:33 +0000 (12:41 +0100)]
build: Detect if Python.h header is present

Make sure the devel package is also installed not just the the Python
interpreter.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Remove in-tree config files from gitignore
Daniel Wagner [Fri, 7 Jan 2022 13:29:50 +0000 (14:29 +0100)]
build: Remove in-tree config files from gitignore

meson doesn't do any in tree builds. Remove the old Makefile generated
config files from gitignore.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #151 from igaw/logical-block-size
Daniel Wagner [Fri, 7 Jan 2022 13:06:23 +0000 (14:06 +0100)]
Merge pull request #151 from igaw/logical-block-size

linux: Add nvme_get_logical_block_size()

3 years agoMerge pull request #158 from igaw/nvme_gen_dhchap_key
Daniel Wagner [Fri, 7 Jan 2022 13:06:03 +0000 (14:06 +0100)]
Merge pull request #158 from igaw/nvme_gen_dhchap_key

linux: Add support to generate DH-HMAC-CHAP keys

3 years agolinux: Add support to generate DH-HMAC-CHAP keys
Daniel Wagner [Thu, 23 Dec 2021 13:59:01 +0000 (14:59 +0100)]
linux: Add support to generate DH-HMAC-CHAP keys

Initially the DH-HMAC-CHAP key generation code was part of the
nvme-cli repository and depended on OpenSSL 1. Move the key generation
code into the library. While at it also add support for OpenSSL 3.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agolinux: Add nvme_get_logical_block_size()
Daniel Wagner [Mon, 20 Dec 2021 15:28:03 +0000 (16:28 +0100)]
linux: Add nvme_get_logical_block_size()

Add helper to retrieve logical block size using nvme_identify_ns().

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #162 from igaw/build-cleanup-makefile-drop
Daniel Wagner [Fri, 7 Jan 2022 10:26:17 +0000 (11:26 +0100)]
Merge pull request #162 from igaw/build-cleanup-makefile-drop

build: Remove unused configurator

3 years agobuild: Remove unused configurator
Daniel Wagner [Fri, 7 Jan 2022 10:20:16 +0000 (11:20 +0100)]
build: Remove unused configurator

The configurator tool was used for the Makefile based build. Not
needed for meson builds. Remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #155 from martin-belanger/replace-make-by-meson
Daniel Wagner [Fri, 7 Jan 2022 09:55:08 +0000 (10:55 +0100)]
Merge pull request #155 from martin-belanger/replace-make-by-meson

Replace make by meson

3 years agoMerge pull request #159 from igaw/build-cleanups
Daniel Wagner [Wed, 29 Dec 2021 07:55:10 +0000 (08:55 +0100)]
Merge pull request #159 from igaw/build-cleanups

Build cleanups

3 years agobuild: Set C dialect and warning level
Daniel Wagner [Mon, 27 Dec 2021 15:09:04 +0000 (16:09 +0100)]
build: Set C dialect and warning level

Currently, the Makefile is not setting the C dialect but the code was
carved out from the nvme-cli code base which relies on gnu99.
Let's define the C dialect to avoid any confusion and make the build
more consistent.

Without defining the default warning level the build system will use
the default level, which is implementation depended.  For example muon
sets it to 3 which includes '-Wpendantic'.  This results in a lot of
ISO-C non compliant warnings.

Let's define the warning level so that all build systems are using the
same values.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Use _dep postfix for all dependency objects
Daniel Wagner [Thu, 23 Dec 2021 13:51:35 +0000 (14:51 +0100)]
build: Use _dep postfix for all dependency objects

Use consistently _dep postfix for all dependency objects.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Avoid including wrong config.h as subpackage
Daniel Wagner [Thu, 23 Dec 2021 15:38:04 +0000 (16:38 +0100)]
build: Avoid including wrong config.h as subpackage

In case the consuming project also uses a config.h we need to hide our
config.h file. By using the path to our config.h we avoid this
confusion. Obviously, 'src' is a bit too generic, thus move the
generated config.h under libnvme.

Introduce also a private include path because ccan has '#include
"config.h"' in its sources. So we need to present a config.h in the
lookup path but it needs to be the one from this project and not the
one from the consuming project.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agolib: Resort libnvme.map
Daniel Wagner [Thu, 23 Dec 2021 14:03:49 +0000 (15:03 +0100)]
lib: Resort libnvme.map

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #156 from igaw/build-static-inline
Daniel Wagner [Thu, 23 Dec 2021 09:58:56 +0000 (10:58 +0100)]
Merge pull request #156 from igaw/build-static-inline

util: Define inline function as static inline

3 years agoutil: Define inline function as static inline
Daniel Wagner [Wed, 22 Dec 2021 07:34:03 +0000 (08:34 +0100)]
util: Define inline function as static inline

The gcc in Centos 6.10 complains with

  src/nvme/util.h:120: multiple definition of `nvme_feature_decode_arbitration'

'inline' alone does not guarantee that the function gets inlined. The
compiler is still free to decide, thus in this case it doesn't inline
and that's why we having multiple implementation with the same
name (in different compile units). 'static inline' forces the inline
which was the indent of this code.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoReplacing make by meson.
Martin Belanger [Tue, 21 Dec 2021 20:36:38 +0000 (15:36 -0500)]
Replacing make by meson.

This involves replacing all Makefiles by meson.build files.
Also the top-level configure script now simply invokes meson.
The top-level Makefile is just a wrapper for meson. It supports
the following operations:

make
make test
make install
make clean    # Remove build artifacts but keep configuration
make purge    # Remove build artifacts and configuration

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
3 years agoMerge pull request #153 from igaw/build-fix-fabrics
Daniel Wagner [Wed, 22 Dec 2021 07:22:14 +0000 (08:22 +0100)]
Merge pull request #153 from igaw/build-fix-fabrics

fabrics: Declare loop index at the beginning of the block

3 years agofabrics: Declare loop index at the beginning of the block
Daniel Wagner [Tue, 21 Dec 2021 14:56:14 +0000 (15:56 +0100)]
fabrics: Declare loop index at the beginning of the block

The gcc in Centos 6.10 complains with

nvme/fabrics.c:909: error: ‘for’ loop initial declarations are only allowed in C99 mode
nvme/fabrics.c:909: note: use option -std=c99 or -std=gnu99 to compileyour code

Let's declare the index at the beginning of the basic block.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #152 from hreinecke/tsas
Hannes Reinecke [Tue, 21 Dec 2021 07:58:06 +0000 (08:58 +0100)]
Merge pull request #152 from hreinecke/tsas

Decode TLS1.3 transport security

3 years agoDecode TLS1.3 transport security
Hannes Reinecke [Tue, 21 Dec 2021 07:55:15 +0000 (08:55 +0100)]
Decode TLS1.3 transport security

Add the definition for TLS1.3 in the transport security attribute
settings (tsas) field.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #146 from igaw/add-ctrl-metadata-and-ns-metadata
Daniel Wagner [Fri, 17 Dec 2021 16:42:25 +0000 (17:42 +0100)]
Merge pull request #146 from igaw/add-ctrl-metadata-and-ns-metadata

types: Add Controller Metadata and Namespace Metadata

3 years agoMerge pull request #147 from sc108-lee/add/gitignore
Daniel Wagner [Thu, 16 Dec 2021 08:20:22 +0000 (09:20 +0100)]
Merge pull request #147 from sc108-lee/add/gitignore

build: Add subpackages contents to .gitignore

3 years agobuild: Add subpackages contents to .gitignore
Steven Seungcheol Lee [Thu, 16 Dec 2021 05:58:09 +0000 (14:58 +0900)]
build: Add subpackages contents to .gitignore

we just need to maintain .wrap files for dependencies

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agotypes: Add Controller Metadata and Namespace Metadata
Daniel Wagner [Mon, 13 Dec 2021 17:37:21 +0000 (02:37 +0900)]
types: Add Controller Metadata and Namespace Metadata

Port and extent the libnvme part from the commit "Add NVMe MI
Features: Controller Metadata (0x7E) and Namespace Metadata (0x7F)."
from the nvme-cli monolithic branch.

While at it add the missing definitions and add some documentation.

This is based on Tokunori Ikegami first port attempt.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #144 from igaw/add_get_log_page_fields_2.0
Daniel Wagner [Wed, 15 Dec 2021 13:35:40 +0000 (14:35 +0100)]
Merge pull request #144 from igaw/add_get_log_page_fields_2.0

ioctl: Add Offset Type to get_log_page()

3 years agoioctl: Add Offset Type to get_log_page()
Daniel Wagner [Fri, 10 Dec 2021 16:33:49 +0000 (17:33 +0100)]
ioctl: Add Offset Type to get_log_page()

Port of the "add get log page 2.0 spec fields" patch.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agotypes: Add documentation to enum nvme_csi
Daniel Wagner [Mon, 13 Dec 2021 13:23:07 +0000 (14:23 +0100)]
types: Add documentation to enum nvme_csi

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge branch 'pel_header_fix'
Daniel Wagner [Fri, 10 Dec 2021 14:47:47 +0000 (15:47 +0100)]
Merge branch 'pel_header_fix'

3 years agolibnvme: Add new events support in PEL
Wen Xiong [Wed, 1 Dec 2021 22:15:50 +0000 (17:15 -0500)]
libnvme: Add new events support in PEL

Add two new events support in header file.

Signed-off-by: Wen Xiong <wenxiong@linux.ibm.com>
3 years agoMerge pull request #143 from sc108-lee/tp4076
Daniel Wagner [Fri, 10 Dec 2021 12:46:02 +0000 (13:46 +0100)]
Merge pull request #143 from sc108-lee/tp4076

zns: Add support for zone random write area (zrwa)

3 years agozns: Add support for zone random write area (zrwa)
Steven Seungcheol Lee [Wed, 8 Dec 2021 03:49:14 +0000 (12:49 +0900)]
zns: Add support for zone random write area (zrwa)

NVMe - TP 4076 Zoned Random Write Area 2021.08.23 - Ratified

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Co-authored-by: Klaus Jensen <k.jensen@samsung.com>
3 years agoMerge pull request #141 from igaw/ccan-debug-build
Daniel Wagner [Thu, 9 Dec 2021 12:30:07 +0000 (13:30 +0100)]
Merge pull request #141 from igaw/ccan-debug-build

build: Enable ccan debug code for debug build

3 years agoMerge pull request #142 from sc108-lee/add_map
Daniel Wagner [Thu, 9 Dec 2021 12:29:40 +0000 (13:29 +0100)]
Merge pull request #142 from sc108-lee/add_map

Add missing function(nvme_get_log_zns_changed_zones) to map file

3 years agoAdd missing function(nvme_get_log_zns_changed_zones) to map file
Steven Seungcheol Lee [Thu, 9 Dec 2021 11:17:09 +0000 (20:17 +0900)]
Add missing function(nvme_get_log_zns_changed_zones) to map file

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #138 from tbzatek/fabrics-fixes-3
Daniel Wagner [Thu, 9 Dec 2021 10:54:58 +0000 (11:54 +0100)]
Merge pull request #138 from tbzatek/fabrics-fixes-3

Misc. fabrics fixes

3 years agoMerge pull request #137 from tbzatek/fabrics-fixes-2
Daniel Wagner [Thu, 9 Dec 2021 10:51:57 +0000 (11:51 +0100)]
Merge pull request #137 from tbzatek/fabrics-fixes-2

types: Fabrics doc strings updates

3 years agobuild: Enable ccan debug code for debug build
Daniel Wagner [Thu, 9 Dec 2021 10:37:20 +0000 (11:37 +0100)]
build: Enable ccan debug code for debug build

The ccan library has support debugging, let's enable this when
building the debug version of the library.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #129 from martin-belanger/document-sanitize-address
Daniel Wagner [Thu, 9 Dec 2021 10:09:21 +0000 (11:09 +0100)]
Merge pull request #129 from martin-belanger/document-sanitize-address

Document meson build options

3 years agoMerge pull request #130 from sc108-lee/remove/unused_doc
Daniel Wagner [Thu, 9 Dec 2021 10:06:56 +0000 (11:06 +0100)]
Merge pull request #130 from sc108-lee/remove/unused_doc

doc: There is no nvme_host_mem_buf_desc in source files

3 years agoMerge pull request #131 from sc108-lee/fix/json-c
Daniel Wagner [Thu, 9 Dec 2021 10:05:01 +0000 (11:05 +0100)]
Merge pull request #131 from sc108-lee/fix/json-c

Add libjson version check on configure to fix build error

3 years agotree: Handle NULL hostid in nvme_lookup_host()
Tomas Bzatek [Wed, 1 Dec 2021 17:15:59 +0000 (18:15 +0100)]
tree: Handle NULL hostid in nvme_lookup_host()

When hostid is specified for lookup and some of the tree
host records carry a NULL, avoid a segfault here on strcmp().

3 years agofabrics: Don't include trailing newline in nvmf_hostnqn_generate()
Tomas Bzatek [Wed, 1 Dec 2021 16:38:12 +0000 (17:38 +0100)]
fabrics: Don't include trailing newline in nvmf_hostnqn_generate()

The generated string is directly used in nvme_lookup_host() and
might cause mismatches due to the inclusion of a trailing newline.

3 years agotypes: Fabrics doc strings updates
Tomas Bzatek [Wed, 1 Dec 2021 15:41:53 +0000 (16:41 +0100)]
types: Fabrics doc strings updates

Includes a typo correction, prefix changes, transition away from anonymous
enums and added some more enum members according to the standard.
All subtle API breaks.

3 years agoMerge pull request #136 from martin-belanger/memleak-swig-module
Hannes Reinecke [Wed, 1 Dec 2021 07:01:46 +0000 (08:01 +0100)]
Merge pull request #136 from martin-belanger/memleak-swig-module

Fix memory leak in SWIG module

3 years agoFix memory leak.
Martin Belanger [Tue, 30 Nov 2021 19:50:29 +0000 (14:50 -0500)]
Fix memory leak.

The API PyDict_SetItemString() does not steal references
when adding objects to a dictionary. Therefore, the caller
must decrement the reference count after adding objects to
the dictionary if those objects are no longer needed.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
3 years agoMerge pull request #133 from sc108-lee/update-id-ctrl
Hannes Reinecke [Mon, 29 Nov 2021 07:25:47 +0000 (08:25 +0100)]
Merge pull request #133 from sc108-lee/update-id-ctrl

recover monolithic commit 782086cc4fd590f1df171c927ebf9a2debc0a052

3 years agoMerge pull request #134 from hreinecke/discovery-fix
Hannes Reinecke [Mon, 29 Nov 2021 06:47:40 +0000 (07:47 +0100)]
Merge pull request #134 from hreinecke/discovery-fix

fabrics: fix endless loop in connect-all for NVME_NQN_CURR

3 years agofabrics: fix endless loop in connect-all for NVME_NQN_CURR
Sagi Grimberg [Sun, 28 Nov 2021 13:03:03 +0000 (15:03 +0200)]
fabrics: fix endless loop in connect-all for NVME_NQN_CURR

For a discovery log page entry that indicates the discovery controller
that returned it (i.e. itself), we need to set the controller as
discovered (because we got the discovery log page by connecting to it).

Without this connect-all goes in an endless loop keep connecting and
retrieving the log page from the same discovery subsystem port.

Fixes: 06a8f001d314 ("tree,fabrics: detect discovery loops")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
3 years agodoc: Add ocfs explaination
Steven Seungcheol Lee [Wed, 24 Nov 2021 09:51:16 +0000 (18:51 +0900)]
doc: Add ocfs explaination

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agonvme: add optional copy format support id ctrl field
Gollu Appalanaidu [Fri, 28 May 2021 05:10:40 +0000 (10:40 +0530)]
nvme: add optional copy format support id ctrl field

Add the OCFS field in Identify Controller Structure, as per the
Ratified TP 4065b (Simple Copy Command).

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agoMerge pull request #132 from hreinecke/loop-fix
Hannes Reinecke [Mon, 22 Nov 2021 16:42:30 +0000 (17:42 +0100)]
Merge pull request #132 from hreinecke/loop-fix

tree: fixup loop address handling

3 years agotree: fixup loop address handling
Hannes Reinecke [Mon, 22 Nov 2021 16:35:36 +0000 (17:35 +0100)]
tree: fixup loop address handling

'loop' controllers have an empty 'address' sysfs attribute, so we
need to check for loop to avoid failures due to an invalid controller
address.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoAdd libjson version check on configure to fix build error
Steven Seungcheol Lee [Thu, 14 Oct 2021 03:48:36 +0000 (12:48 +0900)]
Add libjson version check on configure to fix build error

json_util_get_last_err, json_object_to_fd are supported from json-c-0.13-20171207
if json-c version is lower than 0.13, build without it

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agodoc: There is no nvme_host_mem_buf_desc in source files
Steven Seungcheol Lee [Wed, 3 Nov 2021 10:17:33 +0000 (19:17 +0900)]
doc: There is no nvme_host_mem_buf_desc in source files

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoDocument meson's -Db_sanitize=address option
Martin Belanger [Fri, 19 Nov 2021 15:51:13 +0000 (10:51 -0500)]
Document meson's -Db_sanitize=address option

Describe how to use the -Db_sanitize=address and document how
to invoke executables with the LD_PRELOAD option.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
3 years agoMerge pull request #126 from igaw/drop-configurator
Daniel Wagner [Fri, 19 Nov 2021 11:19:28 +0000 (12:19 +0100)]
Merge pull request #126 from igaw/drop-configurator

build: Do not use the configurator for meson

3 years agobuild: Do not use the configurator for meson
Daniel Wagner [Fri, 19 Nov 2021 10:25:37 +0000 (11:25 +0100)]
build: Do not use the configurator for meson

meson does the feature detection itself and we don't have to rely on
the configurator. So don't use it.

To avoid touching the ccan files, we have to rethink our config.h to
libnvme-config.h rename change. Since the ccan files include
'config.h' we have to use the second option to avoid including it into
external include paths. This is moving the config.h file into a
private folder and drop the include path '.'.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #122 from hreinecke/zns-args
Hannes Reinecke [Thu, 18 Nov 2021 16:51:43 +0000 (17:51 +0100)]
Merge pull request #122 from hreinecke/zns-args

Sanitize zns command arguments

3 years agoMerge pull request #121 from hreinecke/json-fix
Hannes Reinecke [Thu, 18 Nov 2021 16:51:24 +0000 (17:51 +0100)]
Merge pull request #121 from hreinecke/json-fix

Add authentication keys to JSON schema

3 years agoSanitize zns command arguments
Hannes Reinecke [Thu, 18 Nov 2021 16:35:53 +0000 (17:35 +0100)]
Sanitize zns command arguments

With the recent up the calling convention has been sanitzed to always
have the 'timeout' argument as second-to-last, and the 'result' as the
laster argument.
Modify the zns commands accordingly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoAdd authentication keys to JSON schema
Hannes Reinecke [Thu, 18 Nov 2021 16:01:20 +0000 (17:01 +0100)]
Add authentication keys to JSON schema

Add the authentication key definitions to the JSON schema.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #100 from hreinecke/auth.v5
Hannes Reinecke [Thu, 18 Nov 2021 13:32:12 +0000 (14:32 +0100)]
Merge pull request #100 from hreinecke/auth.v5

Implement 'dhchap_key' host and controller attributes

3 years agoImplement 'dhchap_key' host and controller attributes
Hannes Reinecke [Wed, 11 Aug 2021 06:04:38 +0000 (08:04 +0200)]
Implement 'dhchap_key' host and controller attributes

Implement a 'dhchap_key' attribute for the nvme_host structure to
support the 'dhchap_secret' connection argument, and a
'dhchap_key' attribute for the nvme_controller structure to support
the 'dhchap_ctrl_secret' connection argument.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #120 from hreinecke/spdx
Hannes Reinecke [Thu, 18 Nov 2021 13:23:45 +0000 (14:23 +0100)]
Merge pull request #120 from hreinecke/spdx

log: fixup SPDX license

3 years agolog: fixup SPDX license
Hannes Reinecke [Thu, 18 Nov 2021 13:22:04 +0000 (14:22 +0100)]
log: fixup SPDX license

3 years agoMerge pull request #119 from minwooim/for-fix-chrdev-to-generic
Daniel Wagner [Thu, 18 Nov 2021 13:13:03 +0000 (14:13 +0100)]
Merge pull request #119 from minwooim/for-fix-chrdev-to-generic

tree: rename namespace function name chrdev to generic

3 years agotree: rename namespace function name chrdev to generic
Minwoo Im [Thu, 18 Nov 2021 13:09:05 +0000 (22:09 +0900)]
tree: rename namespace function name chrdev to generic

The attribute in `struct nvme_ns` is `generic_name`, not chrdev.  So
rename the function name of this attribute.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
3 years agoMerge pull request #118 from hreinecke/timeout
Hannes Reinecke [Thu, 18 Nov 2021 10:59:42 +0000 (11:59 +0100)]
Merge pull request #118 from hreinecke/timeout

RFC: Sanitize ioctl command wrappers

3 years agoMerge pull request #99 from wxiong38/pel_coredump
Hannes Reinecke [Thu, 18 Nov 2021 09:52:51 +0000 (10:52 +0100)]
Merge pull request #99 from wxiong38/pel_coredump

libnvme: core dump when running nvme persistent-event-log

3 years agoMerge pull request #117 from igaw/update-json-c-wrap
Daniel Wagner [Thu, 18 Nov 2021 09:29:44 +0000 (10:29 +0100)]
Merge pull request #117 from igaw/update-json-c-wrap

build: Set include dirs when buidling configurator

3 years agoAdd 'result' argument to ioctl wrapper functions
Hannes Reinecke [Thu, 18 Nov 2021 09:29:10 +0000 (10:29 +0100)]
Add 'result' argument to ioctl wrapper functions

The ioctl wrapper function are pretty inconsistent as to whether
the NVME cqe result is returned or not.
We'd better add it to every function to have a consistent interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agobuild: Set include dirs when buidling configurator
Daniel Wagner [Thu, 18 Nov 2021 09:23:04 +0000 (10:23 +0100)]
build: Set include dirs when buidling configurator

The default include paths are not set when building the configurator,
hence the build fails when libnvme is consumed by an project as wrap.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #116 from igaw/update-json-c-wrap
Daniel Wagner [Thu, 18 Nov 2021 09:12:26 +0000 (10:12 +0100)]
Merge pull request #116 from igaw/update-json-c-wrap

Update json c wrap

3 years agobuild: Rename config.h to libnvme-config.h
Daniel Wagner [Thu, 18 Nov 2021 09:04:13 +0000 (10:04 +0100)]
build: Rename config.h to libnvme-config.h

The meson documentation recommends not to put a config.h file in the
external search path. This will clash with any project consuming this
library. There are two ways to workaround, either renaming the config
header file or put it under a different path which isn't added into
the default include path.

Renaming is way simpler, let's do this.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Update json-c.wrap
Daniel Wagner [Thu, 18 Nov 2021 08:53:54 +0000 (09:53 +0100)]
build: Update json-c.wrap

The json-c wrap was updated to fix a deprecation warnings issued by
meson.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #103 from minwooim/for-chrdev-name
Daniel Wagner [Thu, 18 Nov 2021 08:34:27 +0000 (09:34 +0100)]
Merge pull request #103 from minwooim/for-chrdev-name

tree: add namespace chrdev name to nvme_ns

3 years agoAdd 'timeout' parameter to ioctl function
Hannes Reinecke [Thu, 18 Nov 2021 08:30:57 +0000 (09:30 +0100)]
Add 'timeout' parameter to ioctl function

Lift the 'timeout' parameter from the basic ioctl to the various
ioctl command abstractions to get a better flexibility when using
these commands.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agotree: add namespace chrdev name to nvme_ns
Minwoo Im [Mon, 15 Nov 2021 14:46:00 +0000 (23:46 +0900)]
tree: add namespace chrdev name to nvme_ns

Namespace device node is initialized into two different nodes: block
device and character device which is a generic device used when block
device is not available due to initialization failure in the kernel.

This can be directly retrieved from the `struct nvme_ns` to print out
the generic node in somewhere like `nvme list` command in nvme-cli.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
3 years agoMerge pull request #115 from hreinecke/doc-update
Hannes Reinecke [Wed, 17 Nov 2021 17:28:29 +0000 (18:28 +0100)]
Merge pull request #115 from hreinecke/doc-update

fabrics: add missing function documentation and mapfile update

3 years agofabrics: add missing function documentation and mapfile update
Hannes Reinecke [Wed, 17 Nov 2021 17:23:51 +0000 (18:23 +0100)]
fabrics: add missing function documentation and mapfile update

Add some function documentation and the missing symbol nvmf_eflags_str
to the mapfile.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #114 from martin-belanger/add-tp8013-to-python
Hannes Reinecke [Wed, 17 Nov 2021 17:07:51 +0000 (18:07 +0100)]
Merge pull request #114 from martin-belanger/add-tp8013-to-python

Add discovery_ctrl_set() to Python bindings

3 years agoAdd discovery_ctrl_set() to Python bindings.
Martin Belanger [Wed, 17 Nov 2021 15:20:28 +0000 (10:20 -0500)]
Add discovery_ctrl_set() to Python bindings.

Following Hannes' recent TP8013 changes, we need
to add this method to the Python bindings.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
3 years agoMerge pull request #112 from hreinecke/map-update
Hannes Reinecke [Wed, 17 Nov 2021 15:01:15 +0000 (16:01 +0100)]
Merge pull request #112 from hreinecke/map-update

Add missing symbols for discovery to map file

3 years agoAdd missing symbols for discovery to map file
Hannes Reinecke [Wed, 17 Nov 2021 14:58:03 +0000 (15:58 +0100)]
Add missing symbols for discovery to map file

Adding support for discovery controller discovery did not add
the new symbols to the map file.

3 years agoMerge pull request #110 from hreinecke/default-config
Hannes Reinecke [Wed, 17 Nov 2021 13:52:22 +0000 (14:52 +0100)]
Merge pull request #110 from hreinecke/default-config

fabrics: add nvmf_default_config()

3 years agofabrics: add nvmf_default_config()
Hannes Reinecke [Wed, 17 Nov 2021 13:01:02 +0000 (14:01 +0100)]
fabrics: add nvmf_default_config()

'struct nvme_fabrics_config' has some default values, and the output
functions key off these values to filter the values being printed.
So to avoid applications having to know these default values this
patch introduces a function nvmf_default_config() to ensure that
every application is using the same defaults.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #109 from igaw/json-c-dep
Hannes Reinecke [Wed, 17 Nov 2021 13:08:58 +0000 (14:08 +0100)]
Merge pull request #109 from igaw/json-c-dep

lower json-c depependecy for meson build

3 years agoworkflows: Install libjson-c-dev
Daniel Wagner [Wed, 17 Nov 2021 12:40:20 +0000 (13:40 +0100)]
workflows: Install libjson-c-dev

Since libnvme is able to use the 0.13 version provided by gitlabs CI,
let's use it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Lower json-c dependencies
Daniel Wagner [Wed, 17 Nov 2021 12:38:30 +0000 (13:38 +0100)]
build: Lower json-c dependencies

libnvme has no hard requirement on json-c 0.14. It was updated to
match to min version for nvme-cli. But nvme-cli has added a
workaround, to avoid requiring a newer version of json-c. Let's drop
the requirement here too.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #105 from hreinecke/discovery
Hannes Reinecke [Wed, 17 Nov 2021 09:34:50 +0000 (10:34 +0100)]
Merge pull request #105 from hreinecke/discovery

TP8013 & 8014 support

3 years agofabrics: set 'discovery' argument for unique discovery controllers
Hannes Reinecke [Tue, 16 Nov 2021 08:59:42 +0000 (09:59 +0100)]
fabrics: set 'discovery' argument for unique discovery controllers

Discovery controllers providing a unique NQN cannot be distinguished
by the NQN from 'normal' I/O controllers, so we need to add the keyword
'discovery' when creating the connection to indicate that this is a
disocvery connection.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoDistinguish between 'nvm' and 'discovery' subsystems
Hannes Reinecke [Mon, 15 Nov 2021 14:27:27 +0000 (15:27 +0100)]
Distinguish between 'nvm' and 'discovery' subsystems

Add a 'subsystype' value to the subsystem to determine if a given
subsystem is a 'discovery' or a 'nvm' subsystem.
And also add a flags 'discovery_ctrl' to specify if a given controller
is a discovery controller; this allows connection to discovery controllers
with unique subsystem NQNs, as these cannot distinguished by the NQN
anymore.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: decode discover log page flags
Hannes Reinecke [Mon, 15 Nov 2021 14:27:27 +0000 (15:27 +0100)]
fabrics: decode discover log page flags

TP8014 defines a new discovery log page entry field 'eflags', which
carries information about the returned entries.
This patch decodes the new field.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: decode new discovery log entry type '3'
Hannes Reinecke [Thu, 12 Aug 2021 11:23:13 +0000 (13:23 +0200)]
fabrics: decode new discovery log entry type '3'

TP8014 adds a new discovery log entry type '3' to describe the
current discovery controller.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #107 from igaw/update-json-c-dep
Daniel Wagner [Tue, 16 Nov 2021 22:02:09 +0000 (23:02 +0100)]
Merge pull request #107 from igaw/update-json-c-dep

Update json-c dependency

3 years agoworkflows: Don't install libjson-c-dev
Daniel Wagner [Tue, 16 Nov 2021 21:48:41 +0000 (22:48 +0100)]
workflows: Don't install libjson-c-dev

ubuntu-latest ships an old version of json-c (0.13). Let's use the
version from meson's wrapdb which is bit newer (0.15).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Update json-c dependencies
Daniel Wagner [Tue, 16 Nov 2021 21:47:18 +0000 (22:47 +0100)]
build: Update json-c dependencies

nvme-cli has a minimum dependency to json-c 0.14. Let's update libnvme
accordingly to avoid any confusions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>