NDA(4)
π NDA(4) π
okay bestie, so this is the Kernel Interfaces Manual page for NDA(4), and trust me, it's giving storage icon energy β¨ β let's get into it π
πΈ NAME πΈ
nda β the NVMe Direct Access device driver, aka the main character of your SSD's whole existence π
β¨ SYNOPSIS β¨
device nvme
device scbus
like, that's it. that's the whole summoning ritual π―οΈ
π¦ DESCRIPTION π¦
okay so the nda driver is literally out here providing support for direct access devices, and these babies implement the NVMe command protocol. they're attached to the system through a host adapter that's supported by the CAM subsystem. no cap, that's the whole vibe π«Ά
π₯ HARDWARE π₯
the nda driver supports NVMe (Non-Volatile Memory Express) storage devices connected via PCIe or over NVMF (NVMe over Fabric) via the CAM subsystem. it's giving versatile π
β SYSCTL VARIABLES β
these variables are available as BOTH sysctl(8) variables AND loader(8) tunables, which is honestly so convenient of them π
hw.nvme.use_nvdβ when this is set to0, thenvme(4)driver will createndadevice nodes for block storage. when it's set to1, it createsnvd(4)device nodes for block storage instead. seenvd(4)when set to1, iykyk πkern.cam.nda.nvd_compatβ when this is1,nvd(4)aliases get created for ALLndadevices, including partitions and othergeom(4)providers that take their names from the disk's name. BUT (and this is important bestie)nvd(4)devices will not be reported in thekern.diskssysctl(8). noted πkern.cam.nda.sort_io_queueβ this one determines whether the software queued entries are sorted in LBA order or not. and honestly? sorting is almost always a waste of time π₯΄ the default is to not sort. periodt.kern.cam.nda.enable_biospeedupβ this determines if thendadevices participate in the speedup protocol. when a device participates, then when the upper layers send aBIO_SPEEDUP, all currentBIO_DELETErequests that haven't been sent to the hardware yet get completed successfully and immediately, WITHOUT being sent to the hardware. this is used in low disk space scenarios when the filesystem hits a critical shortage and needs blocks immediately. and since trims have maximum benefit when the LBA is unused for a long time, skipping the trim when space is needed for immediate writes results in little to no excess wear β slay, efficiency π when participation is disabled,BIO_SPEEDUPrequests are just ignored, no biggie πββοΈkern.cam.nda.max_trimβ the maximum number of LBA ranges to be collected together for each DSM trim sent to the hardware. defaults to256, which is the max number of ranges the protocol supports. sometimes poor trim performance can be mitigated by limiting the number of ranges sent to the device. this value must be between1and256inclusive β don't push it bestie π¨
the following report per-device settings, and they're read-only unless otherwise indicated. replace N with the device unit number, got it? π
kern.cam.nda.N.rotatingβ reports whether the storage volume is spinning or flash. its value is hard coded to0, indicating flash. so yeah, it's a flash girlie β‘kern.cam.nda.N.unmapped_ioβ reports whether thendadriver accepts unmapped I/O for this unit.kern.cam.nda.N.flagsβ reports the current flags. and the flags are:OPENβ the device is open.DIRTYβ set when a write to the drive is scheduled. cleared after flush commands.SCTX_INITβ an internal flag set aftersysctl(8)nodes have been created.
kern.cam.nda.N.sort_io_queueβ same as thekern.cam.nda.sort_io_queuetunable, literally the same thing π«kern.cam.nda.N.trim_ticksβ writable. when greater than zero, hold trims for up to this many ticks before sending to the drive. sometimes waiting a little bit to collect more trims and send them at one time improves trim performance. when0, no delaying of trims is done. your call bestie β³kern.cam.nda.N.trim_goalβ writable. when delaying a bit to collect multiple trims, send the accumulated DSM TRIM to the drive.kern.cam.nda.N.trim_lbasβ total number of LBAs that have been trimmed.kern.cam.nda.N.trim_rangesβ total number of LBA ranges that have been trimmed.kern.cam.nda.N.trim_countβ total number of trims sent to the hardware.kern.cam.nda.N.deletesβ total number ofBIO_DELETErequests queued to the device.
π§ NAMESPACE MAPPING π§
okay so each nvme(4) drive has one or more namespaces associated with it. one instance of the nda driver gets created for each of the namespaces on the drive. all the nda nodes for a nvme(4) device are at target 0. however, the namespace ID maps to the CAM lun, as reported in kernel messages and in the devlist sub command of camcontrol(8) β so like, that's where you find it π
namespaces are managed with the ns sub command of nvmecontrol(8). not all drives support namespace management, but all drives support at least one namespace (thank goodness π). device nodes for nda will be created and destroyed dynamically as namespaces are activated or detached. it's giving flexible πΈ
π FILES π
/dev/nda*β NVMe storage device nodes, the whole point π
π SEE ALSO π
cam(4), geom(4), nvd(4), nvme(4), gpart(8) β go read these too bestie, they're all connected π«Ά
π HISTORY π
the nda driver first appeared in FreeBSD 12.0. a legend was born β¨
π AUTHORS π
Warner Losh <imp@FreeBSD.org> β we stan π«‘
π and that's the whole page bestie! this Debian version is dated October 2, 2025 and it's the NDA(4) Kernel Interfaces Manual β go forth and slay your NVMe game π
β¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 2017 Netflix, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms