2 .\" Copyright (c) 2012-2016 Intel Corporation
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions, and the following disclaimer,
10 .\" without modification.
11 .\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
12 .\" substantially similar to the "NO WARRANTY" disclaimer below
13 .\" ("Disclaimer") and any redistribution must be conditioned upon
14 .\" including a substantially similar Disclaimer requirement for further
15 .\" binary redistribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
21 .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 .\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGES.
30 .\" nvme driver man page.
32 .\" Author: Jim Harris <jimharris@FreeBSD.org>
41 .Nd NVM Express core driver
43 To compile this driver into your kernel,
44 place the following line in your kernel configuration file:
45 .Bd -ragged -offset indent
49 Or, to load the driver as a module at boot, place the following line in
51 .Bd -literal -offset indent
55 Most users will also want to enable
57 to surface NVM Express namespaces as disk devices which can be
59 Note that in NVM Express terms, a namespace is roughly equivalent to a
64 driver provides support for NVM Express (NVMe) controllers, such as:
67 Hardware initialization
69 Per-CPU IO queue pairs
71 API for registering NVMe namespace consumers such as
74 API for submitting NVM commands to namespaces
76 Ioctls for controller and namespace configuration and management
81 driver creates controller device nodes in the format
83 and namespace device nodes in
86 Note that the NVM Express specification starts numbering namespaces at 1,
87 not 0, and this driver follows that convention.
91 will create an I/O queue pair for each CPU, provided enough MSI-X vectors
92 and NVMe queue pairs can be allocated. If not enough vectors or queue
93 pairs are available, nvme(4) will use a smaller number of queue pairs and
94 assign multiple CPUs per queue pair.
96 To force a single I/O queue pair shared by all CPUs, set the following
99 .Bd -literal -offset indent
100 hw.nvme.per_cpu_io_queues=0
103 To assign more than one CPU per I/O queue pair, thereby reducing the number
104 of MSI-X vectors consumed by the device, set the following tunable value in
106 .Bd -literal -offset indent
107 hw.nvme.min_cpus_per_ioq=X
110 To force legacy interrupts for all
112 driver instances, set the following tunable value in
114 .Bd -literal -offset indent
118 Note that use of INTx implies disabling of per-CPU I/O queue pairs.
120 The following controller-level sysctls are currently implemented:
121 .Bl -tag -width indent
122 .It Va dev.nvme.0.num_cpus_per_ioq
123 (R) Number of CPUs associated with each I/O queue pair.
124 .It Va dev.nvme.0.int_coal_time
125 (R/W) Interrupt coalescing timer period in microseconds.
127 .It Va dev.nvme.0.int_coal_threshold
128 (R/W) Interrupt coalescing threshold in number of command completions.
132 The following queue pair-level sysctls are currently implemented.
133 Admin queue sysctls take the format of dev.nvme.0.adminq and I/O queue sysctls
134 take the format of dev.nvme.0.ioq0.
135 .Bl -tag -width indent
136 .It Va dev.nvme.0.ioq0.num_entries
137 (R) Number of entries in this queue pair's command and completion queue.
138 .It Va dev.nvme.0.ioq0.num_tr
139 (R) Number of nvme_tracker structures currently allocated for this queue pair.
140 .It Va dev.nvme.0.ioq0.num_prp_list
141 (R) Number of nvme_prp_list structures currently allocated for this queue pair.
142 .It Va dev.nvme.0.ioq0.sq_head
143 (R) Current location of the submission queue head pointer as observed by
145 The head pointer is incremented by the controller as it takes commands off
146 of the submission queue.
147 .It Va dev.nvme.0.ioq0.sq_tail
148 (R) Current location of the submission queue tail pointer as observed by
150 The driver increments the tail pointer after writing a command
151 into the submission queue to signal that a new command is ready to be
153 .It Va dev.nvme.0.ioq0.cq_head
154 (R) Current location of the completion queue head pointer as observed by
156 The driver increments the head pointer after finishing
157 with a completion entry that was posted by the controller.
158 .It Va dev.nvme.0.ioq0.num_cmds
159 (R) Number of commands that have been submitted on this queue pair.
160 .It Va dev.nvme.0.ioq0.dump_debug
161 (W) Writing 1 to this sysctl will dump the full contents of the submission
162 and completion queues to the console.
172 driver first appeared in
178 driver was developed by Intel and originally written by
179 .An Jim Harris Aq Mt jimharris@FreeBSD.org ,
180 with contributions from
184 This man page was written by
185 .An Jim Harris Aq Mt jimharris@FreeBSD.org .