]> www.infradead.org Git - users/sagi/libnvme.git/log
users/sagi/libnvme.git
5 years agocommon code all the complex value accessors
Keith Busch [Tue, 9 Jun 2020 16:49:58 +0000 (09:49 -0700)]
common code all the complex value accessors

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoupdate and inline feature decoding
Keith Busch [Tue, 9 Jun 2020 14:27:24 +0000 (07:27 -0700)]
update and inline feature decoding

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agofix up get_nsid api
Keith Busch [Fri, 5 Jun 2020 15:01:27 +0000 (08:01 -0700)]
fix up get_nsid api

namespaces can be anything from 1 to 0xfffffffe, which means they must
be unsigned. Change the api to take a parameter for the nsid value
rather than try to return an 'int', which would have confusing
signedness.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoreport zones helpers
Keith Busch [Fri, 5 Jun 2020 03:36:52 +0000 (20:36 -0700)]
report zones helpers

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agozns and ns-types
Keith Busch [Tue, 2 Jun 2020 03:11:41 +0000 (20:11 -0700)]
zns and ns-types

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoexport metadata size
Keith Busch [Mon, 1 Jun 2020 16:59:14 +0000 (09:59 -0700)]
export metadata size

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agogeneric whitespace strip routine
Keith Busch [Mon, 1 Jun 2020 14:08:49 +0000 (07:08 -0700)]
generic whitespace strip routine

Printing routines have a need to strip white spaces too, so make this a
common nvme lib routine.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agohave tree export directly opening namespaces
Keith Busch [Fri, 29 May 2020 20:43:52 +0000 (13:43 -0700)]
have tree export directly opening namespaces

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agominor updates
Keith Busch [Fri, 29 May 2020 16:33:42 +0000 (09:33 -0700)]
minor updates

A collection of updates including:

  Naming consistency improvements

  Namespace descriptor attributes added to namespace elements

  Doc updates to use more consise descriptions

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoExplicit casting from void *
Keith Busch [Thu, 28 May 2020 20:41:32 +0000 (13:41 -0700)]
Explicit casting from void *

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agofix comment typo
Keith Busch [Thu, 28 May 2020 17:26:06 +0000 (10:26 -0700)]
fix comment typo

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoDefine all nvme registers
Keith Busch [Mon, 18 May 2020 19:39:53 +0000 (12:39 -0700)]
Define all nvme registers

Provide enum and accessor methods for all nvme regsiter values and
sub-values.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoExport single namespace open
Keith Busch [Fri, 27 Mar 2020 23:43:22 +0000 (16:43 -0700)]
Export single namespace open

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agonvme/types.h: avoid using anon enums
Chaitanya Kulkarni [Thu, 12 Mar 2020 18:06:23 +0000 (11:06 -0700)]
nvme/types.h: avoid using anon enums

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge branch 'master' of https://github.com/linux-nvme/libnvme
Keith Busch [Thu, 27 Feb 2020 18:21:45 +0000 (10:21 -0800)]
Merge branch 'master' of https://github.com/linux-nvme/libnvme

5 years agoFill out additional documentation fields
Keith Busch [Thu, 27 Feb 2020 18:21:30 +0000 (10:21 -0800)]
Fill out additional documentation fields

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge pull request #1 from safl/master
Keith Busch [Wed, 26 Feb 2020 20:24:01 +0000 (12:24 -0800)]
Merge pull request #1 from safl/master

Fix dependency on systemd

5 years agoFix dependency on systemd
Simon A. F. Lund [Wed, 26 Feb 2020 20:04:24 +0000 (21:04 +0100)]
Fix dependency on systemd

When libsystemd is not installed on the system, then the pkg-config
check would still be true when systemd itself is on the system. Also,
when the library is unavailable then the hard-coded "-lsystemd" would
cause the build to fail. The following changes fix that.

* configure: changed check from "systemd" to the library "libsystemd"

* examples/Makefile: Replaced hard-coded "-lsystemd" with "${LDFLAGS}"
  as defined by "config-host.mak" in examples/Makefile

* src/Makefile: added include of "config-host.mak", removed hard-coded
  "-lsystemd", "-lsystemd" will trickle in from LDFLAGS

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
5 years agoFix double free discover log
Keith Busch [Sat, 22 Feb 2020 22:09:38 +0000 (14:09 -0800)]
Fix double free discover log

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMove feature field decoding to utilitiies
Keith Busch [Sat, 22 Feb 2020 22:08:21 +0000 (14:08 -0800)]
Move feature field decoding to utilitiies

Export a more coder friendly way to decode complex status fields than
the mask+shift macros.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoTypo fixes
Keith Busch [Tue, 18 Feb 2020 22:33:01 +0000 (14:33 -0800)]
Typo fixes

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoFix status code mask
Keith Busch [Mon, 17 Feb 2020 21:01:07 +0000 (13:01 -0800)]
Fix status code mask

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge branch 'master' of https://github.com/linux-nvme/libnvme
Keith Busch [Mon, 17 Feb 2020 20:36:48 +0000 (12:36 -0800)]
Merge branch 'master' of https://github.com/linux-nvme/libnvme

5 years agoFix install make targets
Keith Busch [Sat, 15 Feb 2020 19:53:38 +0000 (11:53 -0800)]
Fix install make targets

The makefile needs to be updated to reflect the current layout after
shuffling some things around,

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoFix split line documentation
Keith Busch [Mon, 17 Feb 2020 20:32:58 +0000 (12:32 -0800)]
Fix split line documentation

The documentation parser won't recognize the desired link nmae if enum
and the name are on separate lines.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge branch 'master' of https://github.com/linux-nvme/libnvme
Keith Busch [Mon, 17 Feb 2020 20:32:48 +0000 (12:32 -0800)]
Merge branch 'master' of https://github.com/linux-nvme/libnvme

5 years agoTesting rst html options
Keith Busch [Mon, 17 Feb 2020 03:03:32 +0000 (19:03 -0800)]
Testing rst html options

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoFix typo in comments
Keith Busch [Sat, 15 Feb 2020 18:31:51 +0000 (10:31 -0800)]
Fix typo in comments

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoIntegration fixes
Keith Busch [Sat, 15 Feb 2020 18:25:47 +0000 (10:25 -0800)]
Integration fixes

Fix up inconsistencies and missing features discovered while integrating
with nvme-cli.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoUpdate .gitignore
Keith Busch [Fri, 14 Feb 2020 23:57:31 +0000 (15:57 -0800)]
Update .gitignore

Update ccan artifacts to their correct directory.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoFill in more documentation details
Keith Busch [Fri, 14 Feb 2020 23:20:13 +0000 (15:20 -0800)]
Fill in more documentation details

And start adding more cross references.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd man pages for exports
Keith Busch [Thu, 13 Feb 2020 21:00:03 +0000 (13:00 -0800)]
Add man pages for exports

Generate man-pages from existing source. This will likely change soon
as the types (struct and enum) should probably be grouped in the same
manual as the primary function that uses it rather than have their own,
and similiar functions can in turn be grouped in the same manual as
well.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoSet up ccan make dependency correctly
Keith Busch [Thu, 13 Feb 2020 19:48:08 +0000 (11:48 -0800)]
Set up ccan make dependency correctly

Fixes parallel -j make.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoFix copyright comments
Keith Busch [Thu, 13 Feb 2020 18:01:09 +0000 (10:01 -0800)]
Fix copyright comments

Don't use the kernel-doc style as that will try to get interpreted by
the scripts.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMove ccan up a directory
Keith Busch [Thu, 13 Feb 2020 17:59:08 +0000 (09:59 -0800)]
Move ccan up a directory

This will make it easier to generate library documentation when the
source is not mixed with external libraries.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoApply kernel-doc comments to more structs and enums
Keith Busch [Thu, 13 Feb 2020 17:50:49 +0000 (09:50 -0800)]
Apply kernel-doc comments to more structs and enums

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd licence tags, copyright, and author comments
Keith Busch [Wed, 12 Feb 2020 15:19:13 +0000 (00:19 +0900)]
Add licence tags, copyright, and author comments

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd c++ inclusion support
Keith Busch [Tue, 11 Feb 2020 01:38:36 +0000 (17:38 -0800)]
Add c++ inclusion support

extern "C" the top level header file, and add a simple c++ compile test.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMake systemd-devel optional
Keith Busch [Mon, 10 Feb 2020 23:29:10 +0000 (15:29 -0800)]
Make systemd-devel optional

There's only one libnvme feature that uses this package. Let's make this
feature optional and return error ENOTSUP if the package is not available.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoUpdate .gitignore
Keith Busch [Mon, 10 Feb 2020 21:09:13 +0000 (13:09 -0800)]
Update .gitignore

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoConsolodate features into common header
Keith Busch [Mon, 10 Feb 2020 21:03:38 +0000 (13:03 -0800)]
Consolodate features into common header

Locate all command submission helper declarations into common ioctl.h
header rather than split these.

Remove the private.h file as only one .c was using it.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agolibnvme: code cleanup src/nvme/util.c
Chaitanya Kulkarni [Mon, 10 Feb 2020 19:37:49 +0000 (11:37 -0800)]
libnvme: code cleanup src/nvme/util.c

Various coding style fixes.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agolibnvme: code cleanup src/nvme/tree.c
Chaitanya Kulkarni [Mon, 10 Feb 2020 19:37:48 +0000 (11:37 -0800)]
libnvme: code cleanup src/nvme/tree.c

Various coding style fixes.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agolibnvme: code cleanup src/nvme/ioctl.c
Chaitanya Kulkarni [Mon, 10 Feb 2020 19:37:47 +0000 (11:37 -0800)]
libnvme: code cleanup src/nvme/ioctl.c

Various coding style fixes.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agolibnvme: code cleanup src/nvme/filters.c
Chaitanya Kulkarni [Mon, 10 Feb 2020 19:37:46 +0000 (11:37 -0800)]
libnvme: code cleanup src/nvme/filters.c

Make sure lines length stays <= 80 character.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agolibnvme: code cleanup src/nvme/fabrics.c
Chaitanya Kulkarni [Mon, 10 Feb 2020 19:37:45 +0000 (11:37 -0800)]
libnvme: code cleanup src/nvme/fabrics.c

This patch has following style fixes :-
Add a new line after function.
Adjust function arguments.
Init array remove memset.
Return early in the function.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoSplit host and controller telemetry log API
Keith Busch [Mon, 10 Feb 2020 19:04:51 +0000 (11:04 -0800)]
Split host and controller telemetry log API

While similar, these are logs are not obtained the same way.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoImport ccan modules
Keith Busch [Sat, 8 Feb 2020 00:32:35 +0000 (16:32 -0800)]
Import ccan modules

Replace <sys/queue.h> list implementation with the superior ccan list.
This is a more pleasant C implementation to work with, and since we the
structures using this are not exported through the API, we can freely
change these kinds of implementation details.

And while we're at it, include a few other useful modules to provide
useful macros and compile time checks on spec defined structs.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agotests: Fix fw log check
Keith Busch [Fri, 7 Feb 2020 04:30:03 +0000 (20:30 -0800)]
tests: Fix fw log check

Had the return check inverted (0 is success).

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoutil: Fix default log transfer length typo
Keith Busch [Fri, 7 Feb 2020 04:26:06 +0000 (20:26 -0800)]
util: Fix default log transfer length typo

Transfer lengths are 4k, not 4086 bytes.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd README
Keith Busch [Fri, 7 Feb 2020 04:08:39 +0000 (20:08 -0800)]
Add README

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd license information
Keith Busch [Fri, 7 Feb 2020 03:55:01 +0000 (19:55 -0800)]
Add license information

Added LGPL licence via:

  wget https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt -O COPYING

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agotests: Remove some of the output
Keith Busch [Fri, 7 Feb 2020 02:37:51 +0000 (18:37 -0800)]
tests: Remove some of the output

Remove parts made redundant with the examples/display programs.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd documentation
Keith Busch [Fri, 7 Feb 2020 02:04:07 +0000 (18:04 -0800)]
Add documentation

Experimenting with documentation generation:

Initialize sphinx documentation building.

Use linux's 'scripts/kernel-doc' to extract documentation comments from
source and format as .rst file.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoexamples: Add loop discover example
Keith Busch [Fri, 7 Feb 2020 00:43:45 +0000 (16:43 -0800)]
examples: Add loop discover example

A basic fabrics example discoverying loop nvme fabric targets. Apply
fixes and updates to lib code as needed from testing.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoexamples: Add column disaply of topology
Keith Busch [Thu, 6 Feb 2020 23:12:55 +0000 (15:12 -0800)]
examples: Add column disaply of topology

Pretty print nvme topology in detailed columns.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoexamples/telemetry: Fix scanning uevent file
Keith Busch [Thu, 6 Feb 2020 22:58:10 +0000 (14:58 -0800)]
examples/telemetry: Fix scanning uevent file

Continue to the next line if current one does not contain async event
information.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd nvme display tree example
Keith Busch [Thu, 6 Feb 2020 22:49:40 +0000 (14:49 -0800)]
Add nvme display tree example

Simple visual demonstration of an nvme topology.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd exported symbols to libnvme.map
Keith Busch [Thu, 6 Feb 2020 22:23:26 +0000 (14:23 -0800)]
Add exported symbols to libnvme.map

And add the kernel-doc style comments in all exported functions.

This is just a capture of what currently exists and may change prior to tagging
as a stable release.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoAdd a telemetry scan example
Keith Busch [Thu, 6 Feb 2020 20:53:30 +0000 (12:53 -0800)]
Add a telemetry scan example

Copy the liburing directory structure and start adding examples. The first
example monitors all devices for telemetry events, and if available will write
out the telemetry log to a file in /var/log/.

While developing the example, some other misc fixes and updates were added to
the library code.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoInitial libnvme commit
Keith Busch [Thu, 6 Feb 2020 14:14:59 +0000 (06:14 -0800)]
Initial libnvme commit

Most of the planned features are developed, however many of the interfaces have
only been lighlty touched as the features they implement are not broadly
supported in hardware.

The remaining gaps in command support from 1.4 are:

  Management Interface Send/Recieve OOB support
  Persistent Event Logs

There is no plan to support Abort, AER, IO SQ/CQ Create/Delete, or Doorbell
Buffer Config since that has high risk to abuse and interfere with the
stability of a running system.

Signed-off-by: Keith Busch <kbusch@kernel.org>