freebsd-src/lib
John Baldwin 2da066ef6d libnvmf: Add internal library to support NVMe over Fabrics
libnvmf provides APIs for transmitting and receiving Command and
Response capsules along with data associated with NVMe commands.
Capsules are represented by 'struct nvmf_capsule' objects.

Capsules are transmitted and received on queue pairs represented by
'struct nvmf_qpair' objects.

Queue pairs belong to an association represented by a 'struct
nvmf_association' object.

libnvmf provides additional helper APIs to assist with constructing
command capsules for a host, response capsules for a controller,
connecting queue pairs to a remote controller and optionally
offloading connected queues to an in-kernel host, accepting queue pair
connections from remote hosts and optionally offloading connected
queues to an in-kernel controller, constructing controller data
structures for local controllers, etc.

libnvmf also includes an internal transport abstraction as well as an
implementation of a userspace TCP transport.

libnvmf is primarily intended for ease of use and low-traffic use cases
such as establishing connections that are handed off to the kernel.
As such, it uses a simple API built on blocking I/O.

For a host, a consumer first populates an 'struct
nvmf_association_params' with a set of parameters shared by all queue
pairs for a single association such as whether or not to use SQ flow
control and header and data digests and creates a 'struct
nvmf_association' object.  The consumer is responsible for
establishing a TCP socket for each queue pair.  This socket is
included in the 'struct nvmf_qpair_params' passed to 'nvmf_connect' to
complete transport-specific negotiation, send a Fabrics Connect
command, and wait for the Connect reply. Upon success, a new 'struct
nvmf_qpair' object is returned.  This queue pair can then be used to
send and receive capsules.  A command capsule is allocated, populated
with an SQE and optional data buffer, and transmitted via
nvmf_host_transmit_command.  The consumer can then wait for a reply
via nvmf_host_wait_for_response.  The library also provides some
wrapper functions such as nvmf_read_property and nvmf_write_property
which send a command and wait for a response synchronously.

For a controller, a consumer uses a single association for a set of
incoming connections.  A consumer can choose to use multiple
associations (e.g. a separate association for connections to a
discovery controller listening on a different port than I/O
controllers).  The consumer is responsible for accepting TCP sockets
directly, but once a socket has been accepted it is passed to
nvmf_accept to perform transport-specific negotiation and wait for the
Connect command.  Similar to nvmf_connect, nvmf_accept returns a newly
construct nvmf_qpair.  However, in contrast to nvmf_connect,
nvmf_accept does not complete the Fabrics negotiation.  The consumer
must explicitly send a response capsule before waiting for additional
command capsules to arrive.  In particular, in the kernel offload
case, the Connect command and data are provided to the kernel
controller and the Connect response capsule is sent by the kernel once
it is ready to handle the new queue pair.

For userspace controller command handling, the consumer uses
nvmf_controller_receive_capsule to wait for a command capsule.
nvmf_receive_controller_data is used to retrieve any data from a
command (e.g. the data for a WRITE command).  It can be called
multiple times to split the data transfer into smaller sizes.
nvmf_send_controller_data is used to send data to a remote host in
response to a command.  It also sends a response capsule indicating
success, or an error if an internal error occurs.  nvmf_send_response
is used to send a response without associated data.  There are also
several convenience wrappers such as nvmf_send_success and
nvmf_send_generic_error.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44710
2024-05-02 16:28:16 -07:00
..
atf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
clang Merge llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6 2024-04-20 16:02:57 +02:00
csu csu: add crtbrand.o dependency on sys/param.h 2024-01-31 15:40:27 -05:00
flua flua: Add hash module 2024-02-15 20:59:23 -07:00
geom glabel: Add support for Linux swap 2024-04-28 22:39:47 -06:00
googletest Fix GoogleTest 1.14.0 import 2023-08-18 19:33:58 -07:00
lib9p dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
lib80211 Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
libalias Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libarchive libarchive: merge from vendor branch 2024-04-29 10:17:53 +02:00
libauditd package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
libbe libbe(3): history: fix 2024-04-09 22:01:10 -06:00
libbearssl bearssl: Make shared library link 2024-02-20 20:31:41 -07:00
libbegemot Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libblacklist Track upstream project rename in contrib/blocklistd 2023-11-03 16:53:04 -04:00
libblocksruntime Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbluetooth Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libbsddialog dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
libbsdstat libbsdstat: Fix typo in bsdstat.h 2024-02-13 16:53:35 +08:00
libbsm package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
libbsnmp Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libbz2 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libc sctp: document sctp_recvmsg as implemented 2024-05-02 15:17:43 +02:00
libc++ Merge llvm-project main llvmorg-18-init-18359-g93248729cfae 2024-04-06 22:13:49 +02:00
libc++experimental Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb 2024-04-06 22:11:55 +02:00
libc_nonshared Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libcalendar Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libcam lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libcapsicum Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libcasper libcasper: fix cap_rights_init usage 2024-02-14 22:33:24 -05:00
libcbor Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libclang_rt Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb 2024-04-06 22:11:55 +02:00
libcom_err Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libcompat libcompat: silence -Wdeprecated-non-prototype 2024-02-06 20:32:46 +01:00
libcompiler_rt libgcc_s: __extendxftf2 and __trunctfxf2 are amd64-only 2024-05-02 18:13:23 +01:00
libcrypt lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libcuse Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libcxxrt libcxxrt: align more with libc/Makefile 2024-04-22 21:28:51 +01:00
libdevctl lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdevdctl libdevdctl: Fix typo (triple S) 2023-12-27 20:24:30 -07:00
libdevinfo lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdevstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdiff diff: Integrate libdiff from OpenBSD GoT. 2024-03-27 11:03:33 +01:00
libdl Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libdpv lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libdwarf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libedit lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libefivar lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libelf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libelftc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libevent1 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libexecinfo lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libexpat MFV: expat 2.6.0. 2024-02-17 14:04:14 -08:00
libfdt libfdt: Make an internal FDT library available 2024-03-21 01:05:05 -04:00
libfetch libfetch: parse scheme://domain:/ correctly 2024-03-25 16:11:42 -04:00
libfido2 libfido2: update to 1.13.0 2023-09-19 13:06:12 -04:00
libfigpar lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libgcc_eh libgcc_{eh,s}: restore __*_frame_info symbols post llvm18 2024-04-19 22:56:13 +01:00
libgcc_s libgcc_s: __extendxftf2 and __trunctfxf2 are amd64-only 2024-05-02 18:13:23 +01:00
libgeom lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libgpio libgpio: Fix type mismatch for gpio_pin_[gs]et 2023-11-14 18:34:21 -08:00
libgssapi Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libiconv_modules lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libifconfig libifconfig: Fix bridge status member list 2023-12-21 16:50:27 +01:00
libipsec libipsec: make const-correct 2024-04-22 22:36:34 -06:00
libipt Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libiscsiutil lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libjail libjail: Guard against programmer error in jailparam_export() 2024-02-04 17:52:30 -05:00
libkiconv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libkvm lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libldns Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
liblua dirdeps: Remove $FreeBSD$ 2023-11-26 15:47:54 -05:00
liblutok Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
liblzma Backport export of lzma_mt_block_size symbol. 2024-04-04 23:39:33 -07:00
libmagic libmagic: Use HOST_CC when compiling hostprog used by build 2024-03-27 19:18:43 -04:00
libmd lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libmemstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libmilter Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libmixer mixer(3): Do not hardcode "/dev/mixer" 2024-02-12 13:00:05 +02:00
libmp Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libmt lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetbsd lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetgraph lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetmap libnetmap: remove interface name validation 2023-12-21 14:43:57 +00:00
libnv lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnvmf libnvmf: Add internal library to support NVMe over Fabrics 2024-05-02 16:28:16 -07:00
libomp Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb 2024-04-06 22:11:55 +02:00
libopenbsd lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libopencsd Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpam package: move cron into its own package 2024-04-22 22:36:35 -06:00
libpathconv Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libpcap dirdeps: Fix libpcap Makefile.depend.options 2023-11-17 11:34:57 -05:00
libpe Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpfctl pf: convert DIOCGETSTATUS to netlink 2024-04-29 16:32:23 +02:00
libpjdlog lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libpmc libpmc: Import AMD Zen 4 PMU events 2024-04-20 11:54:04 -04:00
libpmcstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libproc lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libprocstat inpcb: fully retire inp_ppcb pointer 2024-03-29 12:18:32 -07:00
libradius lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libregex dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
librpcsec_gss librpcsec_gss: don't export non-existant symbols 2024-04-16 22:14:21 +01:00
librpcsvc lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
librss lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
librt lib{c,rt}: use libsys.h for __sys_* declerations 2024-04-16 17:48:07 +01:00
librtld_db lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libsbuf lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libsdp Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libsecureboot libsecureboot do not report expected unverified files 2024-02-12 14:35:01 -08:00
libsm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmb Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmdb Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsmutil Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libsqlite3 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libssp lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libssp_nonshared Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libstats dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
libstdbuf Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libstdthreads libstdthreads: destroy mutexattr in mtx_init() 2024-02-04 13:50:56 +02:00
libsys libsys: don't try to expose freebsd7___semctl 2024-04-30 19:06:10 +01:00
libsysdecode libsysdecode use MKTABLES_INCLUDEDIR 2024-03-21 11:55:56 -07:00
libtacplus lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libtelnet lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libthr Add test for pthread_sigqueue(3) 2024-04-23 19:51:31 +03:00
libthread_db lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libucl Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libufs lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libugidfw Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
libulog libulog: Make sure ut_line, ut_user, ut_host are terminated. 2024-04-29 12:11:37 +02:00
libunbound unbound: Vendor import 1.19.3 2024-03-17 01:57:42 -06:00
libusb libusb(3): Fix link in comment 2024-02-13 16:55:54 +08:00
libusbhid lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libutil login_cap.h: Remove LOGIN_DEFPRI 2024-01-29 22:58:10 +01:00
libveriexec lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libvgl lib/libvgl/main.c: remove an extra semicolon 2024-02-02 18:35:01 -07:00
libvmmapi libvmmapi: Conditionalize compilation of some functions 2024-04-10 11:17:56 -04:00
libwrap Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libxo dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
liby lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libypclnt Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libz dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
libzstd libzstd: Explicitly define ZSTD_DISABLE_ASM 2023-08-22 21:01:03 +01:00
msun pow,powf(3),__ieee754_rem_pio2(f): Avoid negative integer left shift UB 2024-04-23 14:04:07 -06:00
ncurses ncurses: serialize the tinfo build a little bit 2024-01-23 23:00:36 -06:00
nss_tacplus nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). 2023-08-31 07:49:57 +00:00
ofed Trim various $FreeBSD$ 2023-10-10 10:34:43 -07:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile libnvmf: Add internal library to support NVMe over Fabrics 2024-05-02 16:28:16 -07:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00