HardenedBSD/share/mk
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.test.mk atf.test: fix installation of python test scripts 2023-12-19 17:23:54 +01:00
auto.obj.mk
bsd.arch.inc.mk
bsd.clang-analyze.mk
bsd.compat.mk bsd.compat.mk: Set MACHINE before including bsd.opts.mk 2023-11-10 09:57:45 +00:00
bsd.compat.pre.mk
bsd.compiler.mk
bsd.confs.mk
bsd.cpu.mk share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures 2024-04-18 20:42:21 +02:00
bsd.crunchgen.mk crunchgen: fix "keep" for an ELF world, break it out 2023-11-09 22:33:58 -06:00
bsd.dep.mk
bsd.dirs.mk
bsd.doc.mk share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
bsd.dtb.mk
bsd.endian.mk
bsd.files.mk
bsd.incs.mk
bsd.info.mk
bsd.init.mk
bsd.kmod.mk
bsd.lib.mk Add an UNDEFINED_VERSION option 2024-03-01 23:22:11 +00:00
bsd.libnames.mk lib{c,sys}: move auxargs more firmly into libsys 2024-02-19 22:44:08 +00:00
bsd.linker.mk
bsd.links.mk share/mk: Don't install only differing in case files on case insensitive fs 2024-03-15 09:01:25 -06:00
bsd.man.mk share/mk: Don't install only differing in case files on case insensitive fs 2024-03-15 09:01:25 -06:00
bsd.mkopt.mk
bsd.nls.mk
bsd.obj.mk
bsd.opts.mk Revert "Make WITHOUT_UNDEFINED_VERSION the default" 2024-05-02 22:55:08 +01:00
bsd.own.mk bsd.own.mk: Assume a modern make 2024-01-03 12:13:57 -07:00
bsd.port.mk bsd.port.mk: No need to support fmake anymore 2024-01-03 12:14:07 -07:00
bsd.port.options.mk
bsd.port.post.mk
bsd.port.pre.mk
bsd.port.subdir.mk bsd.port.mk: No need to support fmake anymore 2024-01-03 12:14:07 -07:00
bsd.prog.mk
bsd.progs.mk <bsd.progs.mk>: Allow using SRCS for common sources 2023-12-27 17:01:39 -07:00
bsd.README share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
bsd.sanitizer.mk
bsd.snmpmod.mk
bsd.subdir.mk bsd.subdir.mk: improve SUBDIR.${MK_FOO} advice 2024-04-21 09:30:09 -07:00
bsd.suffixes-posix.mk
bsd.suffixes.mk
bsd.symver.mk
bsd.sys.mk bsd.sys.mk: Disable -Wdangling-reference for GCC 13+ 2023-11-14 18:35:04 -08:00
bsd.sysdir.mk
bsd.test.mk
dirdeps-options.mk Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
dirdeps-targets.mk Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
dirdeps.mk Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
gendirdeps.mk bsd.progs.mk must pass META_XTRAS to gendirdeps.mk 2023-11-04 10:17:40 -07:00
googletest.test.inc.mk
googletest.test.mk
host-target.mk Add support for host32 for DIRDEPS_BUILD 2023-09-22 23:27:37 -07:00
install-new.mk
jobs.mk
kmod.opts.mk
local.autodep.mk Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
local.dirdeps-options.mk loader: add target for dirdeps build 2023-11-02 19:35:08 -04:00
local.dirdeps-targets.mk Add share/mk/local.dirdeps-targets.mk 2024-02-27 13:37:50 -08:00
local.dirdeps.mk loader: add target for dirdeps build 2023-11-02 19:35:08 -04:00
local.gendirdeps.mk Stop adding $FreeBSD$ to Makefile.depend 2023-10-29 11:40:03 -07:00
local.init.mk Add support for host32 for DIRDEPS_BUILD 2023-09-22 23:27:37 -07:00
local.meta.sys.env.mk
local.sys.dirdeps.env.mk Add support for host32 for DIRDEPS_BUILD 2023-09-22 23:27:37 -07:00
local.sys.dirdeps.mk Add support for host32 for DIRDEPS_BUILD 2023-09-22 23:27:37 -07:00
local.sys.env.mk
local.sys.machine.mk Add support for host32 for DIRDEPS_BUILD 2023-09-22 23:27:37 -07:00
local.sys.mk Guard CROSS_TARGET_FLAGS from buildworld 2023-09-23 15:58:13 -07:00
Makefile share: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
meta2deps.py Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
meta2deps.sh Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
meta.autodep.mk meta.autodep.mk do not override start_utc 2024-04-24 12:25:42 -07:00
meta.stage.mk Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
meta.subdir.mk Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
meta.sys.mk Update dirdeps.mk et al 2024-03-13 22:51:08 -07:00
netbsd-tests.test.mk
plain.test.mk
src.init.linux.mk Add support for host32 for DIRDEPS_BUILD 2023-09-22 23:27:37 -07:00
src.init.mk Remove unnecessary -isystem for host 2023-09-28 14:19:25 -07:00
src.libnames.mk libnvmf: Add internal library to support NVMe over Fabrics 2024-05-02 16:28:16 -07:00
src.lua.mk
src.opts.mk Revert "config.mk: Add MK_VIMAGE knob" 2024-04-25 22:43:36 +01:00
src.sys.env.mk
src.sys.mk pkgbase: set the prefix of debug files and macros to /usr/src 2023-11-14 08:43:15 +01:00
src.sys.obj.mk
src.tools.mk
stage-install.sh
suite.test.mk
sys.dependfile.mk
sys.dirdeps.mk Update sys.dirdeps.mk set default DEP_* 2024-04-18 14:07:24 -07:00
sys.mk sys.mk: Define HOST_CC as CC by default. 2024-03-27 18:21:50 -04:00
tap.test.mk
version_gen.awk