]>
www.infradead.org Git - users/sagi/libnvme.git/log
Hannes Reinecke [Fri, 10 Sep 2021 16:06:03 +0000 (18:06 +0200)]
tree: fixup crash on pcie controller for older kernels
Older kernels do not provide an 'address' sysfs entry for 'pcie'
controllers, causing a crash during scanning.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 10 Sep 2021 12:50:12 +0000 (14:50 +0200)]
examples,test: depend on libnvme.a
When libnvme is changed we should be rebuilding the example and test
programs, too, to build them against the updated libnvme.
Signed-off-by: Hannes Reinecke <hare@suse.de>
chengjike [Thu, 9 Sep 2021 14:57:09 +0000 (22:57 +0800)]
fix path->nentry bugs
The "path->nentry" is initialized after it is added to the list in
"nvme_subsystem_set_path_ns" function.
Signed-off-by: chengjike <chengjike.cheng@huawei.com>
Keith Busch [Thu, 2 Sep 2021 16:53:29 +0000 (09:53 -0700)]
Revert "tree: rework topology for multiple hosts"
The hosts check breaks pci
This reverts commit
aad3881a446560e6add56202e8029183d5dd825d .
Link: https://github.com/linux-nvme/libnvme/issues/32
Signed-off-by: Keith Busch <kbusch@kernel.org>
Keith Busch [Mon, 23 Aug 2021 18:34:41 +0000 (12:34 -0600)]
Merge pull request #31 from martin-belanger/fix-compilation-warning
Allow control objects to be deleted.
Martin Belanger [Mon, 23 Aug 2021 17:52:38 +0000 (13:52 -0400)]
Un-stub nvme_free_ctrl(). In other words, nvme_free_ctrl() will now properly delete ctrl objects
Keith Busch [Thu, 19 Aug 2021 21:00:36 +0000 (15:00 -0600)]
Merge pull request #30 from martin-belanger/fix-compilation-warning
Fix memory leaks and double free
Martin Belanger [Thu, 19 Aug 2021 19:51:34 +0000 (15:51 -0400)]
Fix memory leaks and double free
Keith Busch [Fri, 13 Aug 2021 16:07:04 +0000 (10:07 -0600)]
Merge pull request #28 from hreinecke/topology
tree: rework topology for multiple hosts
Keith Busch [Fri, 13 Aug 2021 16:06:21 +0000 (10:06 -0600)]
Merge pull request #29 from martin-belanger/fix-compilation-warning
Fix compiler warning
Martin Belanger [Fri, 13 Aug 2021 13:08:26 +0000 (09:08 -0400)]
Fix compiler warning
Hannes Reinecke [Fri, 13 Aug 2021 10:33:17 +0000 (12:33 +0200)]
private.h: drop 'hostid' and 'hostnqn' from nvme_ctrl_t
Never referenced anywhere.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 13 Aug 2021 10:28:27 +0000 (12:28 +0200)]
src/Makefile: fixup depencendy for private.h
The Makefile references 'private.h' as 'libnvme_priv', not
'libnvme_private'.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 13 Aug 2021 09:58:08 +0000 (11:58 +0200)]
tree: rework topology for multiple hosts
Our tree structure host->subsys->ctrl doesn't match the underlying
topology; the subsystem actually just a container for controllers,
and the hosts are specified on the controller level, not the subsystem
level.
So to flatten that into our tree structure we need to duplicate the
subsystem objects for each host, and filter out the controllers such
that only the controllers with the correct hostnqn will show up
in our internal tree.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Keith Busch [Thu, 12 Aug 2021 19:58:57 +0000 (13:58 -0600)]
Merge pull request #27 from martin-belanger/fix-empty-model
Default empty model attribute to 'undefined'
Martin Belanger [Thu, 12 Aug 2021 19:52:30 +0000 (15:52 -0400)]
Default empty model attribute to 'undefined'
Keith Busch [Thu, 12 Aug 2021 15:46:12 +0000 (09:46 -0600)]
Merge pull request #26 from hreinecke/discovery-fixes
Discovery fixes
Hannes Reinecke [Thu, 12 Aug 2021 06:26:41 +0000 (08:26 +0200)]
tree.h: remove stale declaration of nvme_ctrl_get_nqn()
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 11 Aug 2021 08:59:42 +0000 (10:59 +0200)]
json: use nvme_msg() instead of fprintf()
Use nvme logging to make error output configurable.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 12 Aug 2021 06:25:45 +0000 (08:25 +0200)]
tree: set errno in nvme_create_ctrl()
There is no reason why we shouldn't be setting errno in
nvme_create_ctrl(); in fact, doing so will help with debugging.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 12 Aug 2021 09:29:25 +0000 (11:29 +0200)]
fabrics: add nvme_host_t as argument to build_options()
build_options() can be called when the controller hasn't been
instantiated; in that case the 'subsystem' link in the controller
is empty, and there is no host associated with it.
Rather than selecting the default nvme host (and thereby losing
any different hostnqn settings which might have passed in from
the commandline) we should be passing in the nvme host directly
as argument to build_options().
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 12 Aug 2021 09:28:31 +0000 (11:28 +0200)]
tree: avoid crash on unset subsystem in nvme_ctrl_get_host{nqn,id}
Signed-off-by: Hannes Reinecke <hare@suse.de>
Keith Busch [Fri, 6 Aug 2021 19:34:08 +0000 (13:34 -0600)]
Merge pull request #15 from jk-ozlabs/fixes
Minor fixes for a couple of compilation failures
Jeremy Kerr [Mon, 2 Aug 2021 05:50:16 +0000 (13:50 +0800)]
ioctl: Fix incorrect cdw initialisation in nvme_set_features
We're not currently setting cdw15 in nvme_set_features due to a typo in
the struct initialisation. This change fixes the init.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Jeremy Kerr [Thu, 8 Jul 2021 04:46:43 +0000 (12:46 +0800)]
Build c++ objects with c++ compiler
We should use $(CXX) when building objects from .cc sources
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Jeremy Kerr [Thu, 1 Jul 2021 06:26:57 +0000 (14:26 +0800)]
Separate libs from link flags to fix link-order compile failure
Currently, builds fail for me with a link error:
/usr/bin/ld: ../src//libnvme.a(tree.ol): in function `nvme_ns_get_uuid':
src/nvme/tree.c:1321: undefined reference to `uuid_copy'
/usr/bin/ld: ../src//libnvme.a(json.ol): in function `json_read_config':
src/nvme/json.c:152: undefined reference to `json_object_from_file'
Turns out my linker ("GNU ld (GNU Binutils for Debian) 2.35.2") is
sensitive to object argument order - the dependent libs need to be listed
last.
This change splits the required libraries into a LIBS variable, used
last on the Makefile rules to perform the link.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Keith Busch [Tue, 3 Aug 2021 17:24:18 +0000 (11:24 -0600)]
Merge pull request #24 from tbzatek/docs-updates-2
types: Device self-test doc strings update
Tomas Bzatek [Tue, 3 Aug 2021 16:29:53 +0000 (18:29 +0200)]
types: Device self-test doc strings update
Doc strings update related to the device self-test log page
retrieval and the self-test command issue.
API changes:
* renamed NVME_ST_CODE_RESRVED -> NVME_ST_CODE_RESERVED
* added enum nvme_st_curr_op definiton
Keith Busch [Fri, 30 Jul 2021 14:52:57 +0000 (08:52 -0600)]
Merge pull request #21 from martin-belanger/move-python-to-separate-dir
Move python bindings to a separate directory (pynvme)
Martin Belanger [Fri, 23 Jul 2021 19:39:29 +0000 (15:39 -0400)]
Merge latest changes from master branch
Martin Belanger [Fri, 23 Jul 2021 19:35:17 +0000 (15:35 -0400)]
Bug fix in Python SWIG module
Keith Busch [Fri, 23 Jul 2021 15:47:31 +0000 (09:47 -0600)]
Merge pull request #20 from tbzatek/json-c-build-fixes
build: Fix build without json-c
Keith Busch [Fri, 23 Jul 2021 15:19:01 +0000 (09:19 -0600)]
Merge pull request #19 from tbzatek/status-to-string
Add new status codes, add nvme_status_to_string()
Tomas Bzatek [Fri, 23 Jul 2021 14:16:47 +0000 (16:16 +0200)]
build: Fix build without json-c
Tomas Bzatek [Fri, 23 Jul 2021 14:03:02 +0000 (16:03 +0200)]
util: Add strings for new status codes
Tomas Bzatek [Fri, 23 Jul 2021 14:01:15 +0000 (16:01 +0200)]
types: Add new status codes
Sync with nvme-cli master, doc strings updates.
Tomas Bzatek [Thu, 22 Jul 2021 14:42:51 +0000 (16:42 +0200)]
util: Add nvme_status_to_string()
Taken from nvme-cli/libnvme-int-3.4.2021 branch,
commit
70b9835a9dace56557acc5ed10fd4c77ac063238 .
Martin Belanger [Fri, 16 Jul 2021 13:08:31 +0000 (09:08 -0400)]
add README file for python bindings
Martin Belanger [Wed, 14 Jul 2021 17:49:59 +0000 (13:49 -0400)]
Move 'Python bindings' SWIG and Makefile to 'pynvme' directory
Martin Belanger [Wed, 14 Jul 2021 15:10:47 +0000 (11:10 -0400)]
rename Python class names using SWIG's %rename
Martin Belanger [Wed, 14 Jul 2021 14:51:52 +0000 (10:51 -0400)]
fix memory leak
Martin Belanger [Wed, 14 Jul 2021 14:05:04 +0000 (10:05 -0400)]
Merge branch 'logging.v2' of https://github.com/hreinecke/libnvme
Keith Busch [Fri, 9 Jul 2021 15:19:17 +0000 (08:19 -0700)]
re-arm discovery AEN
Ensure that the discovery AEN is unmasked by clearing RAE on the last
read of the full discovery log page.
Link: https://github.com/linux-nvme/libnvme/issues/17
Signed-off-by: Keith Busch <kbusch@kernel.org>
Martin Belanger [Sat, 26 Jun 2021 12:02:25 +0000 (14:02 +0200)]
fabrics: Remove trailing newline from debugging messages
The debugging messages in __nvmf_add_ctrl() contained newlines,
making for an improper formatted message.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Martin Belanger [Sat, 26 Jun 2021 11:58:41 +0000 (13:58 +0200)]
Makefile: fix libnvme_wrap targets
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Hannes Reinecke [Sat, 26 Jun 2021 11:46:22 +0000 (13:46 +0200)]
tree: do not free 'path' in nvme_init_ctrl()
After nvme_configure_ctrl() completes successfully we must not
free the 'path' argument as control has been transferred to the
controller structure.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Sat, 26 Jun 2021 11:09:14 +0000 (13:09 +0200)]
tree: implement nvme_deconfigure_ctrl()
Separate out nvme_deconfigure_ctrl() from nvme_disconnect_ctrl()
to make it symmetric with nvme_configure_ctrl().
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Sat, 26 Jun 2021 11:08:29 +0000 (13:08 +0200)]
tree: rename __nvme_init_ctrl() to nvme_configure_ctrl()
To clarify the intent on the function, and reduce confusion between
nvme_ctrl_init() and __nvme_init_ctrl().
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Sat, 26 Jun 2021 11:05:10 +0000 (13:05 +0200)]
tree: use 'stat' to lookup nvme controller
When looking up nvme subsystems for individual controllers we should
be using 'stat()' instead of 'opendir()'; this is less heavy-handed
and provides better error checking.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 24 Jun 2021 14:28:52 +0000 (16:28 +0200)]
tree: add error logging when failing to lookup subsystem name
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 24 Jun 2021 07:20:25 +0000 (09:20 +0200)]
libnvme.i: add a 'log_level' function to nvme_root object
Add a 'log_level' function to the nvme_root object to allow to
increase the logging level of the libnvme library.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 24 Jun 2021 06:28:09 +0000 (08:28 +0200)]
libnvme.i: display last error message on connect()
Instead of displaying just a generic 'connect failed' message
we should be using nvme_log_message to display the most recent
failure message to the user.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 24 Jun 2021 06:26:46 +0000 (08:26 +0200)]
log: export last error message
Add a static string 'nvme_log_message' containing the last error
message written out by 'nvme_msg'.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Keith Busch [Wed, 23 Jun 2021 14:16:48 +0000 (08:16 -0600)]
Merge pull request #14 from hreinecke/realloc
Rework tree reallocation
Hannes Reinecke [Wed, 23 Jun 2021 09:51:10 +0000 (11:51 +0200)]
tree: rework topology deallocation
The original idea of implementing a simple refcount doesn't really
work out, as refcounting is everything but.
And especially when used with the SWIG bindings it's not easy to
figure if and when a refcount needs to be released.
So kill the entire refcounting and free the internal structure
only when calling nvme_free_tree(); the object-dependent functions
like nvme_free_subsystem() etc now merely become stubs for
symmetry and to keep SWIG happy.
That removes the need for refcounting at all as the tree
and its contents will always be available, and a call to
nvme_free_tree() will clear the entire structure.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 23 Jun 2021 07:43:07 +0000 (09:43 +0200)]
tree: initialize all lists
As otherwise python will crash horribly.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 23 Jun 2021 06:59:56 +0000 (08:59 +0200)]
libnvme.i: decode discover log page entry fields
Decode the individual fields from the discover log page entry to
make the output usable for creating controllers.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Keith Busch [Tue, 22 Jun 2021 17:16:28 +0000 (11:16 -0600)]
Merge pull request #13 from hreinecke/swig.v3
SWIG Python bindings
Hannes Reinecke [Mon, 21 Jun 2021 15:09:27 +0000 (17:09 +0200)]
tree: check hostnqn and hostid when scanning topology
Newer kernel versions will display the hostnqn and hostid in sysfs
attributes, so we should be using them to find the host structure
instead of the default host.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 17 Jun 2021 11:08:20 +0000 (13:08 +0200)]
test/tree.py: add test script for the python binding
Add a simple test script for the python binding which just
prints out details about the NVMe subsystem.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 11 May 2021 15:27:58 +0000 (17:27 +0200)]
examples/discover-loop.py: python example for nvme discovery
Add an example script on how nvme discovery can be done with
the libnvme python binding.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 6 May 2021 06:19:32 +0000 (08:19 +0200)]
Add SWIG interface generator files
Add files to generate a python binding via SWIG.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 11 May 2021 15:59:20 +0000 (17:59 +0200)]
tree: re-read 'state' attribute
The 'state' attribute might change at any time, so we need to update
it upon access.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 7 May 2021 15:13:22 +0000 (17:13 +0200)]
tree: rename nvme_disconnect_ctrl()
Rename nvme_ctrl_disconnect() to nvme_disconnect_ctrl() to avoid
name clash with SWIG generated interface files.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 17 Jun 2021 07:50:32 +0000 (09:50 +0200)]
tree: export nvme_free_subsystem()
Required for SWIG interface.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 17 Jun 2021 07:50:32 +0000 (09:50 +0200)]
tree: export nvme_free_host()
Required for SWIG interface.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 7 May 2021 14:54:19 +0000 (16:54 +0200)]
tree: add nvme_rescan_ctrl()
Add a function to rescan a controller eg after receiving an AEN.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 11 May 2021 10:30:47 +0000 (12:30 +0200)]
tree: add refcounting for objects
Each object can be referenced multiple times, so add
reference counting for hosts, subsystems, and controllers.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Hannes Reinecke [Fri, 7 May 2021 13:49:59 +0000 (15:49 +0200)]
tree: Move structures to private.h
Move generic structures to private.h to avoid having to duplicate
definitions in the SWIG interface file.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 5 May 2021 12:35:36 +0000 (14:35 +0200)]
tree: move static declarations into private header file
Static directory declarations are not part of the libnvme API, so
move them into the private header file.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 17 Jun 2021 09:00:58 +0000 (11:00 +0200)]
tree: controller subsystem pointer might be NULL
The subsystem pointer 's' in the controller structure might be
NULL, as the controller is only associated with a subsystem once
nvmf_add_ctrl() has been called.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Sat, 19 Jun 2021 11:22:28 +0000 (13:22 +0200)]
tree: error checking in nvme_init_ctrl()
nvme_init_ctrl() is called to initialize a controller after a
'connect' call. As this might fail for a variety of reasons we
need to ensure to change the controller state if we need to
return an error; this ensures that we can repeat a call to
nvme_init_ctrl() after the error causing the failure has been
resolved.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 11 May 2021 13:38:20 +0000 (15:38 +0200)]
tree: initialize subsystem in nvme_init_ctrl()
nvme_init_ctrl() might be called from a nvme_ctrl with no
subsystem set (eg after a connect call). So ensure to
re-scan the subsystem to have it fully initialized.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Thu, 17 Jun 2021 07:17:59 +0000 (09:17 +0200)]
tree: error checking in nvme_ns_init()
The call to 'nvme_ns_identify()' in nvme_ns_init() might fail,
leading to a largely unusable namespace. So not continue here, but
rather fail the call to nvme_ns_open().
Signed-off-by: Hannes Reinecke <hare@suse.de>
Keith Busch [Thu, 17 Jun 2021 15:12:14 +0000 (09:12 -0600)]
Merge pull request #12 from birkelund/fix
nvme/fabrics: fix compile error
Klaus Jensen [Thu, 17 Jun 2021 08:07:40 +0000 (10:07 +0200)]
nvme/fabrics: fix compile error
Fix string formatting of the uuid from systemd.
Fixes: 8999e3d9b218 ("fabrics: Read system UUID from DMI and merge hostnqn generation functions")
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Keith Busch [Wed, 16 Jun 2021 16:12:49 +0000 (10:12 -0600)]
Merge pull request #11 from hreinecke/int-fixes
fabrics,tree: Fixes for PCIe devices
Hannes Reinecke [Wed, 16 Jun 2021 15:49:54 +0000 (17:49 +0200)]
fabrics,tree: Fixes for PCIe devices
PCIe devices do not necessarily have a hostnqn set, so use the
default hostnqn when looking up hosts.
And for PCIe devices the transport address is the entire 'address'
string, no parsing required.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Keith Busch [Wed, 16 Jun 2021 15:20:55 +0000 (09:20 -0600)]
Merge pull request #10 from hreinecke/nvme-cli
Preparation for nvme-cli integration
Hannes Reinecke [Wed, 16 Jun 2021 08:06:42 +0000 (10:06 +0200)]
tree,fabrics: add 'host_iface' controller option
Add a 'host_iface' controller option.
Ported from nvme-cli.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 Jun 2021 07:56:07 +0000 (09:56 +0200)]
fabrics: add fast_io_fail_tmo option
Option to fail fast I/O when connecting to a controller. It is useful
to set a fast-fail timeout for nvme in case upper layer SW wants to
detect unresponsive controllers early (e.g. mdraid).
Ported from nvme-cli.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 Jun 2021 07:44:59 +0000 (09:44 +0200)]
fabrics: blank out invalid arguments in build_options()
Not all options are valid under all circumstances; eg for
discovery some options like 'nr_io_queues' are invalid.
So mask out invalid options to avoid a failure when creating
a controller.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 16 Jun 2021 07:25:50 +0000 (09:25 +0200)]
tree: argument checking for nvme_create_ctrl()
Add argument checking for nvme_create_ctrl() to ensure the controller
values are correct and avoid failures later on in nvme_add_ctrl().
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 14 Jun 2021 13:44:28 +0000 (15:44 +0200)]
Add logging functionality to libnvme
Port the logging functionality from nvme-cli to libnvme and
replace the 'verbose' option.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 14 Jun 2021 11:39:13 +0000 (13:39 +0200)]
ioctl: add 'nsid' parameter to nvme_identify_secondary_ctrl_list()
nvme_identify_secondary_ctrl_list() can relate to specific nsids,
so allow the nsid parameter to be settable.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 14 Jun 2021 10:24:42 +0000 (12:24 +0200)]
ioctl: add definitions for Namespace Write Protect Feature
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Mon, 14 Jun 2021 07:20:06 +0000 (09:20 +0200)]
fabrics: Read system UUID from DMI and merge hostnqn generation functions
Ported from nvme-cli.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Sun, 13 Jun 2021 10:40:54 +0000 (12:40 +0200)]
types: add NVME_LOG_LPO_NONE
Add additional log page definition.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Keith Busch [Tue, 15 Jun 2021 19:56:10 +0000 (13:56 -0600)]
Merge pull request #9 from birkelund/fixes
Typo fix
Klaus Jensen [Tue, 15 Jun 2021 19:22:20 +0000 (21:22 +0200)]
Typo fix
Fix a small typo.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Keith Busch [Tue, 15 Jun 2021 19:10:24 +0000 (13:10 -0600)]
Merge pull request #7 from hreinecke/topology.v2
Per-controller configuration support
Hannes Reinecke [Fri, 7 May 2021 08:12:41 +0000 (10:12 +0200)]
tree: move config_file argument into nvme_root
Store the config file in the nvme_root structure; that allows us
to call nvme_update_config() without having to specify the
configuration file.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 5 May 2021 12:15:55 +0000 (14:15 +0200)]
tree: add 'nvme_update_config()' as API function
Add a function nvme_update_config() to write out the configuration
as an JSON file.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 5 May 2021 11:55:39 +0000 (13:55 +0200)]
JSON configuration file handling
Add functions 'json_read_config()' and 'json_update_config()' to
read and write configuration informations from or to a JSON file.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 11 May 2021 11:26:36 +0000 (13:26 +0200)]
fabrics: 'tos' is invalid for loop
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 13 Apr 2021 07:55:19 +0000 (09:55 +0200)]
tree: implement nvme_ctrl_is_persistent()
Move the 'persistent' argument into the controller configuration.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 14 Apr 2021 06:10:26 +0000 (08:10 +0200)]
fabrics: add 'verbose' option
Add a 'verbose' option to print out logging messages during
discovery.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Wed, 14 Apr 2021 10:06:36 +0000 (12:06 +0200)]
tree,fabrics: detect discovery loops
Add an attribute 'discovered' to the controller configuration to
identify discovery referral loops; if the controller is already
discovered we'll skip it for subsequent discovery commands.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Tue, 13 Apr 2021 07:28:30 +0000 (09:28 +0200)]
tree,fabrics: per-controller configuration
Make the fabrics configuration settings per-controller and implement
nvme_ctrl_disable_sqflow().
Signed-off-by: Hannes Reinecke <hare@suse.de>
Hannes Reinecke [Fri, 30 Apr 2021 08:23:54 +0000 (10:23 +0200)]
tree,fabrics: use topology information for discovery
Implement a topology tree containing all hosts, subsystems, and
controllers in the system, and use that information during
discovery.
Signed-off-by: Hannes Reinecke <hare@suse.de>