xref: /netbsd-src/sbin/nvmectl/nvmectl.8 (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1.\" $NetBSD: nvmectl.8,v 1.5 2018/04/18 10:17:54 nonaka Exp $
2.\"
3.\" Copyright (c) 2012 Intel Corporation
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions, and the following disclaimer,
11.\"    without modification.
12.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
13.\"    substantially similar to the "NO WARRANTY" disclaimer below
14.\"    ("Disclaimer") and any redistribution must be conditioned upon
15.\"    including a substantially similar Disclaimer requirement for further
16.\"    binary redistribution.
17.\"
18.\" NO WARRANTY
19.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
22.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
28.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29.\" POSSIBILITY OF SUCH DAMAGES.
30.\"
31.\" nvmecontrol man page.
32.\"
33.\" Author: Jim Harris <jimharris@FreeBSD.org>
34.\"
35.\" $FreeBSD: head/sbin/nvmecontrol/nvmecontrol.8 314230 2017-02-25 00:09:16Z imp $
36.\"
37.Dd May 19, 2016
38.Dt NVMECTL 8
39.Os
40.Sh NAME
41.Nm nvmectl
42.Nd NVM Express control utility
43.Sh SYNOPSIS
44.Nm
45.Ic devlist
46.Nm
47.Ic identify
48.Op Fl x Op Fl v
49.Ar device_id
50.\".Nm
51.\".Ic perftest
52.\".Op Fl p
53.\".Aq Fl n Ar num_threads
54.\".Aq Fl o Ar read|write
55.\".Aq Fl s Ar size_in_bytes
56.\".Aq Fl t Ar time_in_sec
57.\".Aq namespace_id
58.\".Nm
59.\".Ic reset
60.\".Aq controller_id
61.Nm
62.Ic logpage
63.Op Fl x
64.Op Fl p Ar page_id
65.Op Fl v Ar vendor-string
66.Op Fl b
67.Ar device_id Ns | Ns Ar namespace_id
68.\".Nm
69.\".Ic firmware
70.\".Op Fl a
71.\".Op Fl s Ar slot
72.\".Op Fl f Ar path_to_firmware
73.\".Aq device id
74.Nm
75.Ic power
76.Op Fl l
77.Op Fl p Ar power_state
78.Op Fl w Ar workload_hint
79.Ar device_id
80.Nm
81.Ic wdc cap-diag
82.Op Fl o path_template
83.Ar device_id
84.Sh DESCRIPTION
85NVM Express (NVMe) is a storage protocol standard, for SSDs and other
86high-speed storage devices over PCI Express.
87.Ss logpage
88The logpage command knows how to print log pages of various types.
89It also knows about vendor specific log pages from hgst/wdc and intel.
90Page 0xc1 for hgst/wdc contains the advanced smart information about
91the drive.
92Page 0xc1 is read latency stats for intel.
93Page 0xc2 is write latency stats for intel.
94Page 0xc5 is temperature stats for intel.
95Page 0xca is advanced smart information for intel.
96.Pp
97Specifying
98.Fl p
99.Ic help
100will list all valid vendors and pages.
101.Fl x
102will print the page as hex.
103.Fl b
104will print the binary data for the page.
105.Ss wdc
106The various wdc commands retrieve log data from the wdc/hgst drives.
107The
108.Fl o
109flag specifies a path template to use to output the files.
110Each file takes the path template (which defaults to nothing), appends
111the drive's serial number and the type of dump it is followed
112by
113.Pa .bin .
114These logs must be sent to the vendor for analysis.
115This tool only provides a way to extract them.
116.Sh EXAMPLES
117.Dl nvmectl devlist
118.Pp
119Display a list of NVMe controllers and namespaces along with their device nodes.
120.Pp
121.Dl nvmectl identify nvme0
122.Pp
123Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data.
124.Pp
125.Dl nvmectl identify -x -v nvme0ns1
126.Pp
127Display an hexadecimal dump of the nvme0
128.Dv IDENTIFY_NAMESPACE
129data for namespace 1.
130.\".Pp
131.\".Dl nvmectl perftest -n 32 -o read -s 512 -t 30 nvme0ns1
132.\".Pp
133.\"Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds.
134.\"Each thread will issue a single 512 byte read command.
135.\"Results are printed to stdout when 30 seconds expires.
136.\".Pp
137.\".Dl nvmectl reset nvme0
138.\".Pp
139.\"Perform a controller-level reset of the nvme0 controller.
140.Pp
141.Dl nvmectl logpage -p 1 nvme0
142.Pp
143Display a human-readable summary of the nvme0 controller's Error Information Log.
144Log pages defined by the NVMe specification include Error Information Log (ID=1),
145SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3).
146.Pp
147.Dl nvmectl logpage -p 0xc1 -v wdc nvme0
148.Pp
149Display a human-readable summary of the nvme0's wdc-specific advanced
150SMART data.
151.Pp
152.Dl nvmectl logpage -p 1 -x nvme0
153.Pp
154Display a hexadecimal dump of the nvme0 controller's Error Information Log.
155.Pp
156.Dl nvmectl logpage -p 0xcb -b nvme0 > /tmp/page-cb.bin
157.Pp
158Print the contents of vendor specific page 0xcb as binary data on
159standard out.
160Redirect it to a temporary file.
161.\".Pp
162.\".Dl nvmectl firmware -s 2 -f /tmp/nvme_firmware nvme0
163.\".Pp
164.\"Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the
165.\"nvme0 controller, but do not activate the image.
166.\".Pp
167.\".Dl nvmectl firmware -s 4 -a nvme0
168.\".Pp
169.\"Activate the firmware in slot 4 of the nvme0 controller on the next reset.
170.\".Pp
171.\".Dl nvmectl firmware -s 7 -f /tmp/nvme_firmware -a nvme0
172.\".Pp
173.\"Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the
174.\"nvme0 controller and activate it on the next reset.
175.Pp
176.Dl nvmectl power -l nvme0
177.Pp
178List all the current power modes.
179.Pp
180.Dl nvmectl power -p 3 nvme0
181.Pp
182Set the current power mode.
183.Pp
184.Dl nvmectl power nvme0
185.Pp
186Get the current power mode.
187.Sh HISTORY
188The nvmecontrol utility appeared in
189.Fx 9.2 .
190.Sh AUTHORS
191.An -nosplit
192nvmecontrol was developed by Intel and originally written by
193.An Jim Harris Aq Mt jimharris@FreeBSD.org .
194.Pp
195This man page was written by
196.An Jim Harris Aq Mt jimharris@FreeBSD.org .
197