Backend Interface#
The core of the xNVMe API is encapsulated by a backend interface. The backend interface consists of implementations of the following.
Attributes#
name, name of the backend configdescr, human-readable descriptioncaps, bitmask of capabilities (xnvme_be_cap) used for URI-based config selection
Device#
enumerate(), lists devicesdev_from_ident(), open of a given device and return a handledev_close(), close a device handle
Memory#
buf_alloc(), allocate buffer usable with commandsbuf_free(), de-allocate buffersbuf_vtophys()buf_realloc()
Asynchronous#
cmd_io(), submit an IO-command to a qpairpoke(), process completions on a qpairwait(), wait until all outstanding commands are completedinit(), initialize a qpairterm(), terminate a qpairsupported(), informed whether async. commands are supported
Synchronous#
cmd_io(), submit an IO-command and wait for its completioncmd_admin(), submit and Admin-command and wait for its completionsupported(), inform wether sync. commands are supported
Backend Interface - Implementation#
Each platform defines its available backend configs in a
xnvme_platform_<os>.c file, registering them via the
g_xnvme_platform structure. A backend config (xnvme_be_config) is a
complete recipe combining async, sync, admin, dev, and mem implementations.
Have a look at the existing implementations:
lib/xnvme_platform_*.c— platform registration and config arrayslib/xnvme_be_*.c— backend implementationsinclude/xnvme_be_registry.h— extern declarations for all configs
And the definition of the backend interface in:
include/xnvme_be.h