Hannes Reinecke [Fri, 19 Mar 2021 09:50:37 +0000 (10:50 +0100)]
Parse 'address' string into components
The 'address' string really are several parts (traddr, trsvcid, and
host_addr) which are separated by commas. So avoid every user having
to parse that string on its own this patch exposes the individual parts
via nvme_ctrl_get_{traddr,trsvcid,host_traddr}.
Each call might return NULL if the respective value isn't set.
Han Han [Tue, 20 Oct 2020 12:45:31 +0000 (20:45 +0800)]
examples: Add src/ into the include and library path
That will fix the compiling errors like:
CC telemetry-listen
telemetry-listen.c:21:10: fatal error: libnvme.h: No such file or directory
21 | #include <libnvme.h>
| ^~~~~~~~~~~
Han Han [Tue, 20 Oct 2020 13:49:21 +0000 (21:49 +0800)]
spec: Fix the sub-include dir name to nvme
It will fix the error of "libnvme/ dir is not found":
$ rpmbuild -ba ~/rpmbuild/SPECS/libnvme.spec
...
error: Directory not found:
/home/hhan/rpmbuild/BUILDROOT/libnvme-0.1-0.x86_64/usr/include/libnvme
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.
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>
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.
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>
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.
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.
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.