152467047SWarner Losh.\" 252467047SWarner Losh.\" Copyright (c) 2017 Netflix, Inc. 34d21bbd1SWarner Losh.\" 44d21bbd1SWarner Losh.\" Redistribution and use in source and binary forms, with or without 54d21bbd1SWarner Losh.\" modification, are permitted provided that the following conditions 64d21bbd1SWarner Losh.\" are met: 74d21bbd1SWarner Losh.\" 1. Redistributions of source code must retain the above copyright 84d21bbd1SWarner Losh.\" notice, this list of conditions and the following disclaimer. 94d21bbd1SWarner Losh.\" 104d21bbd1SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright 114d21bbd1SWarner Losh.\" notice, this list of conditions and the following disclaimer in the 124d21bbd1SWarner Losh.\" documentation and/or other materials provided with the distribution. 134d21bbd1SWarner Losh.\" 144d21bbd1SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 154d21bbd1SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 164d21bbd1SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 174d21bbd1SWarner Losh.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 184d21bbd1SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 194d21bbd1SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 204d21bbd1SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 214d21bbd1SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 224d21bbd1SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 234d21bbd1SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 244d21bbd1SWarner Losh.\" SUCH DAMAGE. 254d21bbd1SWarner Losh.\" 265ed1576eSWarner Losh.Dd June 6, 2020 274d21bbd1SWarner Losh.Dt NDA 4 284d21bbd1SWarner Losh.Os 294d21bbd1SWarner Losh.Sh NAME 304d21bbd1SWarner Losh.Nm nda 314d21bbd1SWarner Losh.Nd NVMe Direct Access device driver 324d21bbd1SWarner Losh.Sh SYNOPSIS 334d21bbd1SWarner Losh.Cd device nvme 344d21bbd1SWarner Losh.Cd device scbus 354d21bbd1SWarner Losh.Sh DESCRIPTION 364d21bbd1SWarner LoshThe 374d21bbd1SWarner Losh.Nm 384d21bbd1SWarner Loshdriver provides support for direct access devices, implementing the 394d21bbd1SWarner Losh.Tn NVMe 404d21bbd1SWarner Loshcommand protocol, that are attached to the system through a host adapter 414d21bbd1SWarner Loshsupported by the CAM subsystem. 424d21bbd1SWarner Losh.Sh SYSCTL VARIABLES 434d21bbd1SWarner LoshThe following variables are available as both 444d21bbd1SWarner Losh.Xr sysctl 8 454d21bbd1SWarner Loshvariables and 464d21bbd1SWarner Losh.Xr loader 8 474d21bbd1SWarner Loshtunables: 484d21bbd1SWarner Losh.Bl -tag -width 12 495ed1576eSWarner Losh.It Va hw.nvme.use_nvd 505ed1576eSWarner LoshThe 515ed1576eSWarner Losh.Xr nvme 4 525ed1576eSWarner Loshdriver will create 535ed1576eSWarner Losh.Nm 545ed1576eSWarner Loshdevice nodes for block storage when set to 0. 555ed1576eSWarner LoshCreate 565ed1576eSWarner Losh.Xr nvd 4 575ed1576eSWarner Loshdevice nodes for block storage when set to 1. 585ed1576eSWarner LoshSee 595ed1576eSWarner Losh.Xr nvd 4 605ed1576eSWarner Loshwhen set to 1. 615ed1576eSWarner Losh.It Va kern.cam.nda.nvd_compat 625ed1576eSWarner LoshWhen set to 1, 635ed1576eSWarner Losh.Xr nvd 4 645ed1576eSWarner Loshaliases will be created for all 655ed1576eSWarner Losh.Nm 665ed1576eSWarner Loshdevices, including partitions and other 671bb6f1d1SWarner Losh.Xr geom 4 685ed1576eSWarner Loshproviders that take their names from the disk's name. 69*d458747eSChristian Brueffer.Xr nvd 4 705ed1576eSWarner Loshdevices will not, however, be reported in the 715ed1576eSWarner Losh.Va kern.disks 725ed1576eSWarner Losh.Xr sysctl 8 . 734d21bbd1SWarner Losh.It Va kern.cam.nda.sort_io_queue 744d21bbd1SWarner LoshThis variable determines whether the software queued entries are 754d21bbd1SWarner Loshsorted in LBA order or not. 764d21bbd1SWarner LoshSorting is almost always a waste of time. 774d21bbd1SWarner LoshThe default is to not sort. 785ed1576eSWarner Losh.It Va kern.cam.nda.enable_biospeedup 795ed1576eSWarner LoshThis variable determines if the 805ed1576eSWarner Losh.Nm 815ed1576eSWarner Loshdevices participate in the speedup protocol. 825ed1576eSWarner LoshWhen the device participates in the speedup, then when the upper layers 835ed1576eSWarner Loshsend a 845ed1576eSWarner Losh.Va BIO_SPEEDUP , 855ed1576eSWarner Loshall current 865ed1576eSWarner Losh.Va BIO_DELETE 875ed1576eSWarner Loshrequests not yet sent to the hardware are completed successfully immediate 885ed1576eSWarner Loshwithout sending them to the hardware. 895ed1576eSWarner LoshUsed in low disk space scenarios when the filesystem encounters 905ed1576eSWarner Losha critical shortage and needs blocks immediately. 915ed1576eSWarner LoshSince trims have maximum benefit when the LBA is unused for a long time, 925ed1576eSWarner Loshskipping the trim when space is needed for immediate writes results in little to 935ed1576eSWarner Loshno excess wear. 945ed1576eSWarner LoshWhen participation is disabled, 955ed1576eSWarner Losh.Va BIO_SPEEDUP 965ed1576eSWarner Loshrequests are ignored. 975ed1576eSWarner Losh.It Va kern.cam.nda.max_trim 985ed1576eSWarner LoshThe maximum number of LBA ranges to be collected together for each DSM trims 995ed1576eSWarner Loshsend to the hardware. 1005ed1576eSWarner LoshDefaults to 256, which is the maximum number of ranges the protocol supports. 1015ed1576eSWarner LoshSometimes poor trim performance can be mitigated by limiting the number of 1025ed1576eSWarner Loshranges sent to the device. 1035ed1576eSWarner LoshThis value must be between 1 and 256 inclusive. 1044d21bbd1SWarner Losh.El 1054d21bbd1SWarner Losh.Pp 1064d21bbd1SWarner LoshThe following report per-device settings, and are read-only unless 1075ed1576eSWarner Loshotherwise indicated. 1085ed1576eSWarner LoshReplace 1094d21bbd1SWarner Losh.Va N 1104d21bbd1SWarner Loshwith the device unit number. 1114d21bbd1SWarner Losh.Bl -tag -width 12 1124d21bbd1SWarner Losh.It Va kern.cam.nda.N.rotating 1134d21bbd1SWarner LoshThis variable reports whether the storage volume is spinning or 1144d21bbd1SWarner Loshflash. 1155ed1576eSWarner LoshIts value is hard coded to 0 indicating flash. 1164d21bbd1SWarner Losh.It Va kern.cam.nda.N.unmapped_io 1174d21bbd1SWarner LoshThis variable reports whether the 1184d21bbd1SWarner Losh.Nm 1194d21bbd1SWarner Loshdriver accepts unmapped I/O for this unit. 1205ed1576eSWarner Losh.It Va kern.cam.nda.N.flags 1215ed1576eSWarner LoshThis variable reports the current flags. 1225ed1576eSWarner Losh.Bl -tag -width 12 1235ed1576eSWarner Losh.It Va OPEN 1245ed1576eSWarner LoshThe device is open. 1255ed1576eSWarner Losh.It Va DIRTY 1265ed1576eSWarner LoshSet when a write to the drive is scheduled. 1275ed1576eSWarner LoshCleared after flush commands. 1285ed1576eSWarner Losh.It Va SCTX_INIT 1295ed1576eSWarner LoshInternal flag set after 1305ed1576eSWarner Losh.Xr sysctl 8 1315ed1576eSWarner Loshnodes have been created. 1321adc28f5SChristian Brueffer.El 1335ed1576eSWarner Losh.It Va kern.cam.nda.N.sort_io_queue 1345ed1576eSWarner LoshSame as the 1355ed1576eSWarner Losh.Va kern.cam.nda.sort_io_queue 1365ed1576eSWarner Loshtunable. 1375ed1576eSWarner Losh.It Va kern.cam.nda.N.trim_ticks 1385ed1576eSWarner LoshWritable. 1395ed1576eSWarner LoshWhen greater than zero, hold trims for up to this many ticks before sending 1405ed1576eSWarner Loshto the drive. 1415ed1576eSWarner LoshSometimes waiting a little bit to collect more trims to send at one time 1425ed1576eSWarner Loshimproves trim performance. 1435ed1576eSWarner LoshWhen 0, no delaying of trims are done. 1445ed1576eSWarner Losh.It Va kern.cam.nda.N.trim_goal 1455ed1576eSWarner LoshWritable. 1465ed1576eSWarner LoshWhen delaying a bit to collect multiple trims, send the accumulated DSM TRIM to 1475ed1576eSWarner Loshthe drive. 1485ed1576eSWarner Losh.It Va kern.cam.nda.N.trim_lbas 1495ed1576eSWarner LoshTotal number of LBAs that have been trimmed. 1505ed1576eSWarner Losh.It Va kern.cam.nda.N.trim_ranges 1515ed1576eSWarner LoshTotal number of LBA ranges that have been trimmed. 1525ed1576eSWarner Losh.It Va kern.cam.nda.N.trim_count 1535ed1576eSWarner LoshTotal number of trims sent to the hardware. 1545ed1576eSWarner Losh.It Va kern.cam.nda.N.deletes 1555ed1576eSWarner LoshTotal number of 1565ed1576eSWarner Losh.Va BIO_DELETE 1575ed1576eSWarner Loshrequests queued to the device. 1585ed1576eSWarner Losh.El 1595ed1576eSWarner Losh.Sh NAMESPACE MAPPING 1605ed1576eSWarner LoshEach 1615ed1576eSWarner Losh.Xr nvme 4 1625ed1576eSWarner Loshdrive has one or more namespaces associated with it. 1635ed1576eSWarner LoshOne instance of the 1645ed1576eSWarner Losh.Nm 1655ed1576eSWarner Loshdriver will be created for each of the namespaces on 1665ed1576eSWarner Loshthe drive. 1675ed1576eSWarner LoshAll the 1685ed1576eSWarner Losh.Nm 1695ed1576eSWarner Loshnodes for a 1705ed1576eSWarner Losh.Xr nvme 4 1715ed1576eSWarner Loshdevice are at target 0. 1725ed1576eSWarner LoshHowever, the namespace ID maps to the CAM lun, as reported 1735ed1576eSWarner Loshin kernel messages and in the 1745ed1576eSWarner Losh.Va devlist 1755ed1576eSWarner Loshsub command of 1765ed1576eSWarner Losh.Xr camcontrol 8 . 1775ed1576eSWarner Losh.Pp 1785ed1576eSWarner LoshNamespaces are managed with the 1795ed1576eSWarner Losh.Va ns 1805ed1576eSWarner Loshsub command of 1815ed1576eSWarner Losh.Xr nvmecontrol 8 . 1825ed1576eSWarner LoshNot all drives support namespace management, 1835ed1576eSWarner Loshbut all drives support at least one namespace. 1845ed1576eSWarner LoshDevice nodes for 1855ed1576eSWarner Losh.Nm 1865ed1576eSWarner Loshwill be created and destroyed dynamically as 1875ed1576eSWarner Loshnamespaces are activated or detached. 1884d21bbd1SWarner Losh.Sh FILES 1894d21bbd1SWarner Losh.Bl -tag -width ".Pa /dev/nda*" -compact 1904d21bbd1SWarner Losh.It Pa /dev/nda* 1914d21bbd1SWarner LoshNVMe storage device nodes 1924d21bbd1SWarner Losh.El 1934d21bbd1SWarner Losh.Sh SEE ALSO 1945ed1576eSWarner Losh.Xr cam 4 , 1955ed1576eSWarner Losh.Xr geom 4 , 1961adc28f5SChristian Brueffer.Xr nvd 4 , 1975ed1576eSWarner Losh.Xr nvme 4 , 1985ed1576eSWarner Losh.Xr gpart 8 1994d21bbd1SWarner Losh.Sh HISTORY 2004d21bbd1SWarner LoshThe 2014d21bbd1SWarner Losh.Nm 2024d21bbd1SWarner Loshdriver first appeared in 2034d21bbd1SWarner Losh.Fx 12.0 . 2044d21bbd1SWarner Losh.Sh AUTHORS 2054d21bbd1SWarner Losh.An Warner Losh Aq Mt imp@FreeBSD.org 206