Commit Graph

203 Commits

Author SHA1 Message Date
David Bright
6995fb5eb7 Fix various Coverity-detected errors in nvmecontrol
This fixes several Coverity-detected errors in nvmecontrol. While in
here, a couple additional errors with shift/mask confusion that were
not diagnosed by Coverity are also fixed.

CIDs addressed: 1040299, 1040300, 1403972, 1403973, 1403985, 1403988,
1403990, 1404374, 1404427, 1404469, 1404510, 1404534, 1418118

CID 1403657 (resource leak of shared library handle) was marked
"intentional" in the Coverity scan database.

Reviewed by:	vangyzen, robert.herndon_dell.com
Reviewed by:	daniel.william.ryan_gmail.com (earlier version)
Reviewed by:	rramsden_isilon.com (earlier version), imp
MFC after:	5 days
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D24203
2020-04-02 13:52:54 +00:00
Alexander Motin
83018b7987 Fix host memory buffer sizes reporting.
Hardware reports values in 4KB units, not in bytes.

MFC after:	3 days
2020-01-06 01:51:23 +00:00
Warner Losh
a35a97ae12 Size is unsigned, so remove the test entirely.
The kernel won't crash if you have a bad value and I'd rather not have
nvmecontrol know the internal details about how the nvme driver limits
the transfer size.
2019-09-25 07:51:30 +00:00
Warner Losh
087d0e0b5e After my comnd changes, the number of threads and size weren't set. In
addition, the flags are optional, but were made to be mandatory. Set
these things, as well as santiy check the specified size.

Submitted by: Stefan Rink
PR: 240798
2019-09-25 00:24:57 +00:00
Warner Losh
21fae2d64f Assume all the short args have optional args so allocate space for the
':'. It's slightly wasteful, but much easier (and the savings in bytes
at runtime would be tiny, but the code to do it larger).

Submitted by: Sebastian Huber
2019-09-11 13:34:19 +00:00
Warner Losh
10bb6d358d Report the Host Buffer Memory minimum and preferred sizes.
The Host Buffer feature (NVMe 1.4 section 89) allows for the NVMe card
request the host provide it buffer for lookaside tables and maybe
other things. Report the card's minimum and preferred sizes with
nvmecontrol/camcontrol identify.
2019-09-04 19:19:23 +00:00
Alexander Motin
4035e778f8 Print few more useful identify fields.
MFC after:	2 weeks
2019-08-14 17:36:26 +00:00
Warner Losh
ef7a2ead30 Fix mismerge.
I merged passthru.c from the wrong branch (it was a branch that went further in
a direction I wound up not taking). Fix the mismerge and turn passthru on.
2019-08-06 18:15:26 +00:00
Alexander Motin
217c81f334 Fix alignment issue r350599.
MFC after:	10 days
2019-08-05 19:30:28 +00:00
Alexander Motin
70d20ed34f Add nvmecontrol resv to handle NVMe reservations.
NVMe reservations are quite alike to SCSI persistent reservations and
can be used in clustered setups with shared multiport storage.

MFC after:	10 days
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2019-08-05 17:36:00 +00:00
Alexander Motin
278ba86cec Add nvmecontrol sanitize command.
It allows to delete all user data from NVM subsystem in one of 3 methods.
It is a close equivalent of SCSI SANITIZE command of `camcontrol sanitize`,
so I tried to keep arguments as close as possible.

While there, fix supported sanitize methods reporting in `identify`.

MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2019-08-03 19:24:56 +00:00
Alexander Motin
ea44065c1f Fix parameter check broken at r350057.
MFC after:	2 weeks
2019-08-03 04:30:22 +00:00
Alexander Motin
6c99d1325e Decode few more NVMe log pages.
In particular: Changed Namespace List, Commands Supported and Effects,
Reservation Notification, Sanitize Status.

Add few new arguments to `nvmecontrol log` subcommand.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2019-08-02 20:16:21 +00:00
Alexander Motin
90dfa8f0ac Add more new fields and values from NVMe 1.4.
MFC after:	2 weeks
2019-08-02 03:43:24 +00:00
Alexander Motin
48ec75f0e7 Rename function added in r350523 to make gcc happy.
MFC after:	2 weeks
2019-08-01 22:22:06 +00:00
Alexander Motin
a7bf63be69 Add IOCTL to translate nvdX into nvmeY and NSID.
While very useful by itself, it also makes `nvmecontrol` not depend on
hardcoded device names parsing, that in its turn makes simple to take
nvdX (and potentially any other) device names as arguments.

Also added IOCTL bypass from nvdX to respective nvmeYnsZ makes them
interchangeable for management purposes.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2019-08-01 21:44:07 +00:00
Alexander Motin
3b3dd3f770 Feature-complete NVMe Namespace Management.
This adds several previously missed but important subcommands to list
namespaces and controllers.  It also fixes few previously added but
just found with real testing to be broken subcommands.

Also while there, add possibility to explicitly specify nsid for
`nvmecontrol identify` subcommand.  It may be useful to specify nsids
not having own devices, for example 0xffffffff, or just newly created
ones.

MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2019-07-31 18:44:20 +00:00
Alexander Motin
e843651ba0 Tune some commands desctiption.
MFC after:	2 weeks
2019-07-31 04:19:53 +00:00
Alexander Motin
628d03169e Fix usage printing for nested subcommands.
Instead of `nvmecontrol create` should be `nvmecontrol ns create`, etc.

MFC after:	2 weeks
2019-07-31 03:48:48 +00:00
Alexander Motin
8de2d8c009 Add some new fields and bits from NVMe 1.4.
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2019-07-29 03:28:46 +00:00
Warner Losh
160915367c Fix the fix to the logic bug. Upon further testing, the bug is that we shadoow
opt.vendor with vendor. We shouldn't. Delete the latter and use the former
everywhere and restore the prior logic which is now correct.
2019-07-24 23:08:49 +00:00
Warner Losh
ae5f2ca7b9 Fix several related coverity issues:
Make sure to always free shortopts and lopts when returning.
Fix minor logic bug to guard against NULLs properly.

CID: 1403654, 1403656, 1403658
2019-07-24 23:04:26 +00:00
Warner Losh
7d88a2f89e Implement {io,admin}-passthru commands.
These are mostly compatible with Linux, with three exceptions.
1. We don't do metadata segment stuff. Our passthrough interface
   doesn't cope. The code is there, but generates an error.
2. Linux lets you specify a namespace ID for the command. We current
   do not: we get ours from the namespace device, or pass in a generic
   one. Generally, this will lead to the same command, but FreeBSD's
   is safer since you can't specify the wrong id.
3. --show-command outputs to stderr instead of stdout so you can both
   see your command, and capture its output with a simple redirect.

Differential Revision: https://reviews.freebsd.org/D19296
2019-07-16 17:24:25 +00:00
Warner Losh
f634b4c1be Create generic command / arg parsing routines
Create a set of routines and structures to hold the data for the args
for a command. Use them to generate help and to parse args. Convert
all the current commands over to the new format. "comnd" is a hat-tip
to the TOPS-20 %COMND JSYS that (very) loosely inspired much of the
subsequent command line notions in the industry, but this is far
simpler (the %COMND man page is longer than this code) and not in the
kernel... Also, it implements today's de-facto
	command [verb]+ [opts]* [args]*
format rather than the old, archaic TOPS-20 command format :)

This is a snapshot of a work in progress to get the nvme passthru
stuff committed. In time it will become a private library and used
by some other programs in the tree that conform to the above pattern.

Differential Revision: https://reviews.freebsd.org/D19296
2019-07-16 17:24:03 +00:00
Scott Long
8212cecdde Better formatting for the logpage section 2019-05-17 18:15:47 +00:00
Alexander Motin
1aed499575 Decode Deallocate Logical Block Features.
MFC after:	1 week
2019-05-05 15:47:21 +00:00
Warner Losh
e96f6eda1b Add SPDX tag. 2019-02-28 02:29:48 +00:00
Warner Losh
f428a90ad9 Rework logpage extensibility.
Move from using a linker set to a constructor function that's
called. This simplifies the code and is slightly more obvious.  We now
keep a list of page decoders rather than having an array we managed
before. Commands will move to something similar in the future.

Reviewed by: jhb@
Differential Revision: https://reviews.freebsd.org/D19275
2019-02-22 15:15:36 +00:00
Warner Losh
95e310720d Remove write-only s_flag. 2019-02-16 00:15:02 +00:00
Warner Losh
52467047aa Regularize the Netflix copyright
Use recent best practices for Copyright form at the top of
the license:
1. Remove all the All Rights Reserved clauses on our stuff. Where we
   piggybacked others, use a separate line to make things clear.
2. Use "Netflix, Inc." everywhere.
3. Use a single line for the copyright for grep friendliness.
4. Use date ranges in all places for our stuff.

Approved by: Netflix Legal (who gave me the form), adrian@ (pmc files)
2019-02-04 21:28:25 +00:00
Warner Losh
9d0e9f8ef5 Try the first 256 units with nvmecontrol devlist.
The nvmecontrol code that did the devlist assumed that we had a
tightly-packed allocation of units. Since pci writing exists, this
isn't the case. Loop over the first 256 units, which is a reasonable
number of possible units.

Sponsored by: Netflix
2018-12-21 23:22:37 +00:00
Warner Losh
e8c7837685 Update paths based on last-minute changes from libexec to lib. 2018-12-06 23:40:56 +00:00
Warner Losh
44d31a441e Declare global function print_intel_add_smart in header 2018-12-06 23:29:06 +00:00
Warner Losh
4b639af1d4 Use proper prototypes. 2018-12-06 23:28:55 +00:00
Warner Losh
e4aa091bd1 It's useful to have this be a global function.
Other vendors base their additional smart info pages on what Intel did
plus some other bits. So it's convenient to have this be global.

Sponsored by: Netflix
2018-12-06 22:59:18 +00:00
Warner Losh
8775459902 This is not a samsung standard, so remove that alias.
This was never documented, and isn't needed, so it's best removed to
avoid confusion.

Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D18460
2018-12-06 22:59:08 +00:00
Warner Losh
eac8e82796 Move intel and wdc files to their own modules
Move the intel and wdc vendor specific stuff to their own modules.

Sponsored by: Netflix
Differential Revision:  https://reviews.freebsd.org/D18460
2018-12-06 22:58:55 +00:00
Warner Losh
0d095c23a0 Const poison the command interface
Make the pointers we pass into the commands const, also make the
linker set mirrors const.

Suggested by: cem@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18459
2018-12-06 22:58:42 +00:00
Warner Losh
228c425533 Dynamically load .so modules to expand functionality
o Dynamically load all the .so files found in /libexec/nvmecontrol and
  /usr/local/libexec/nvmecontrol.
o Link nvmecontrol -rdynamic so that its symbols are visible to the
  libraries we load.
o Create concatinated linker sets that we dynamically expand.
o Add the linked-in top and logpage linker sets to the mirrors for them
  and add those sets to the mirrors when we load a new .so.
o Add some macros to help hide the names of the linker sets.
o Update the man page.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18455

fold
2018-12-06 22:58:26 +00:00
Warner Losh
e860439466 Fix typo in comment
Sponsored by: Netflix
2018-12-02 23:13:45 +00:00
Warner Losh
48133c3ff3 Delete the undocumented alias 'wds'.
This was a typo for wdc. Eliminate it since it was in error. People
should use either 'wdc' or 'hgst' for the vendor from now on. 'hgst'
works for all versions this functionality is present for.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:13:35 +00:00
Warner Losh
2da383a59a Move Intel specific log pages to intel.c
Move the Intel specific log pages (including the one that samsung
implements) to intel.c. Add comment to the samsung vendor that it will
be going away soon.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:13:24 +00:00
Warner Losh
d4fdb249f2 Usage cleanup pt 2
Eliminage redundant spaces and nvmecontrol at start of all the usage
strings. Update the usage printing code to add them back when
presenting to the user. Allow multi-line usage messages and print
proper leading spaces for lines starting with a space.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:13:12 +00:00
Warner Losh
7d923c13d7 Usage cleanup pt 1
Provide a usage() function that takes a struct nvme_function pointer
and produces a usage mssage. Eliminate all now-redundant usage
functions. Propigate the new argument through the program as needed.
Use common routine to print usage.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:12:58 +00:00
Warner Losh
fbf14fe84b Return after we find the dispatched function.
If the dispatched function doesn't exit, then we get can get a
spurious function not found message. They all do exit, but this is a
little cleaner.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:12:48 +00:00
Warner Losh
e2ed7941e0 Move the hgst/wdc log page printing code into wdc.c
These are all hgst/wdc specific, so move them into the wdc.c to live
with the wdc command.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:12:37 +00:00
Warner Losh
a773b08b88 Move common logpage routines into nvmecontrol.h
For the upcoming move of vendor specific code into vendor specific
files, make the common logpage routines global and move them to
nvmecontrol.h.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:12:26 +00:00
Warner Losh
aecd1901a9 Make logpage functions a linker set.
Move logpage function def to header. Convert all the logpage_function
elements to elements of the linker set. Leave them all in logpage.c
for the moment.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:12:16 +00:00
Warner Losh
a13a291adf Move nvmecontrol to using linker sets for commands
More commands will be added to nvmecontrol. Also, there will be a few
more vendor commands (some of which may need to remain private to
companies writing them). The first step on that journey is to move to
using linker sets to dispatch commands. The next step will be using
dlopen to bring in the .so's that have the command that might need
to remain private for seamless integration.

Similar changes to this will be needed for vendor specific log pages.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
2018-12-02 23:10:55 +00:00
Warner Losh
102cb8b907 Fix typo
The vendor name wds should have been wdc. Add wdc and keep the wds for
script compat.

MFC after: 3 days
2018-10-20 21:13:57 +00:00
Chuck Tuffli
9544e6dcf1 Make NVMe compatible with the original API
The original NVMe API used bit-fields to represent fields in data
structures defined by the specification (e.g. the op-code in the command
data structure). The implementation targeted x86_64 processors and
defined the bit fields for little endian dwords (i.e. 32 bits).

This approach does not work as-is for big endian architectures and was
changed to use a combination of bit shifts and masks to support PowerPC.
Unfortunately, this changed the NVMe API and forces #ifdef's based on
the OS revision level in user space code.

This change reverts to something that looks like the original API, but
it uses bytes instead of bit-fields inside the packed command structure.
As a bonus, this works as-is for both big and little endian CPU
architectures.

Bump __FreeBSD_version to 1200081 due to API change

Reviewed by: imp, kbowling, smh, mav
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D16404
2018-08-22 04:29:24 +00:00
Warner Losh
e505b7eced Make it possible to use print_controller from another program
Rename print_controller to nvme_print_controller. Put it in its
own file for easy inclusion. Move util.c to be nc_util.c to not
conflict with camcontrol. add nvecontrol_ext.h to define shared
interfaces.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D15371
2018-06-13 22:00:02 +00:00
Justin Hibbits
2bac48c266 Print Maximum Data Transfer Size as a long rather than int
PowerPC has PAGE_SIZE as a long, not an int.  This causes the compiler to throw
a format mismatch warning on this print.  To work around the difference, print
it as a long instead of an int, and force the argument to a long.

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D15653
2018-06-07 04:02:09 +00:00
Alexander Motin
ba405bc811 Add NVMe Namespace Management support to nvmecontrol(8).
This allows create/delete/attach/detach namespaces on new NVMe controllers.
This is only a first user-level part of the bigger change set.  Kernel part
required to detect and handle the configuration changes without reboot is
completely independent and will be added separately.

Submitted by:	Matt Williams <mffbsdw@gmail.com> (original version)
Differential Revision:	https://reviews.freebsd.org/D11399
2018-05-05 20:08:03 +00:00
Alexander Motin
011bbaa513 Add some argument checks to be more user-friendly.
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2018-03-13 15:29:13 +00:00
Alexander Motin
635c517ae9 Add nvmecontrol format subcommand.
It allows to change namespace parameters, such as block size, metadata,
protection information, etc. and/or erase the data.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2018-03-13 03:02:09 +00:00
Alexander Motin
01c1be35e0 Print fuses and fna fields in identify data.
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2018-03-12 16:31:25 +00:00
Alexander Motin
3fa5467a06 Add new identify data structures fields from NVMe 1.3a.
Some of them are already supported by existing hardware, so reporting
them `nvmecontrol identify` can be useful.
2018-03-11 05:09:02 +00:00
Alan Somers
deeec7728b nvmecontrol: fix build on amd64/clang
Broken by:	329824
Sponsored by:	Spectra Logic Corp
2018-02-22 17:47:16 +00:00
Wojciech Macek
0d787e9b35 NVMe: Add big-endian support
Remove bitfields from defined structures as they are not portable.
Instead use shift and mask macros in the driver and nvmecontrol application.

NVMe is now working on powerpc64 host.

Submitted by:          Michal Stanek <mst@semihalf.com>
Obtained from:         Semihalf
Reviewed by:           imp, wma
Sponsored by:          IBM, QCM Technologies
Differential revision: https://reviews.freebsd.org/D13916
2018-02-22 13:32:31 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Warner Losh
24e99dabf7 Report only the valid slots in the firmware log page.
Printing the entire log page is causing confusion over available
slots. Report only those slots that are valid. In the case where the
firmware download isn't supported, assume that only the first slot is
valid (I have no hardware to test this assumption though)

Sponsored by: Netflix
2017-10-25 15:26:03 +00:00
Warner Losh
8ce85adf7d Add nvme_controller_data argument to all print functions.
It's desirable to access controler data to inform printing log pages
(such as limiting the printing to valid ranges).

Sponsored by: Netflix
2017-10-25 15:25:55 +00:00
Warner Losh
781fe538ae Print the controller's ID in identify.
Submitted by: Matt Williams
Sponsored by: Netflix
2017-08-28 23:54:08 +00:00
Warner Losh
4d81e14528 Fix sign of resid and add a mostly useless cast to cope with signed vs
unsigned check warnings from traditional unix code construsts bogusly
flagged as potentially unsafe.
2017-07-01 02:19:48 +00:00
Warner Losh
440f35093c Improve wdc error log pulling.
After review by the WDC engineers, improve how we pull down the
so-called 'e6' logs. The 'c6' logs are obsolete and support for them
has been removed because FreeBSD needed to pull them in chunks, which
is incompatible with the 0xc6 opcode implementation. Rather than leave
the code in place that produces bad log pulls, remove it.
2017-06-29 23:15:28 +00:00
Warner Losh
bbd508cae9 Report some aspects of namespaces and namespace support in identify
command.

Sponsored by: Netflix
Submitted by: Matt Williams (via D11330)
2017-06-27 20:24:44 +00:00
Warner Losh
970d454f63 Move 128-bit integer routines to util.c so they can be used by more
than just the log page code.

Sponsored by: Netflix, Inc
Submitted by: Matt Williams (via D11330)
2017-06-27 20:24:25 +00:00
Enji Cooper
4914b39f09 Don't use K&R style prototypes; ANSIfy them
This fixes several -Wold-style-definition warnings.

X-MFC with:	313191
Reported by:	amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc)
Sponsored by:	Dell EMC Isilon
2017-03-28 20:34:02 +00:00
Enji Cooper
22289a8c3d sbin: normalize paths using SRCTOP-relative paths or :H when possible
This simplifies make logic/output

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-03-04 11:33:01 +00:00
Warner Losh
d8fab838af Make nvmecontrol logpage -p help list known pages.
Make -p help and -v help list all the pages we know about.
Add -v to usage.
Update the man page.

Sponsored by: Netflix
2017-02-25 00:09:16 +00:00
Warner Losh
e71bab696f Exit with usage if argv[1] is NULL in dispatch. This fixes core dumps
when a command has subcommands, but the user doesn't give the
parameters on the command line.

Sponsored by: Netflix
2017-02-25 00:09:12 +00:00
Warner Losh
56e101b337 Fix typos in output.
Sponsored by: Netflix
2017-02-25 00:09:02 +00:00
Warner Losh
1b44f31b19 Use ssize_t instead of uint32_t to prevent warnings about a comparison
with different signs. Due to the promotion rules, this would only
happen on 32-bit platforms.
2017-02-05 01:20:39 +00:00
Warner Losh
ba6da68645 Add the ability to dump log pages directly in binary to stdout.
Update man page to include this flag, and an example of dumping a
vendor-specific page while I'm here.
2017-02-05 00:55:07 +00:00
Warner Losh
033ccbc91f Add some descriptions to the man page for the supported log pages as
well as the new wdc commands. Make wdc be an alias for hgst when
specifying the vendor to use to interpret the page.
2017-02-05 00:45:02 +00:00
Warner Losh
0fe4a5189c Fix off by one error that truncated the serial number for filenames. 2017-02-04 20:43:54 +00:00
Warner Losh
dd8374eb70 Fix a typo in usage string for unimplemented command. 2017-02-04 20:43:45 +00:00
Warner Losh
ffce99f502 Implement 5 wdc-specific nvme control options for their HGST drives:
wdc cap-diag		Capture diagnostic data from drive
	wdc drive-log		Capture drive history data from drive
	wdc get-crash-dump	Retrieve firmware crash dump from drive
2017-02-04 05:53:00 +00:00
Warner Losh
ccac2ba7ec Move the usage and command name lookup into functions. 2017-02-04 05:52:53 +00:00
Warner Losh
3f13e7a8a2 Put the arguments to aligned_alloc in the right order. 2017-02-04 05:52:50 +00:00
Warner Losh
dc935c4f19 Use aligned buffer for the firmware data. Otherwise, when loading a
MAXPHYS bytes of data, the I/O would require MAXPHYS + PAGE_SIZE worth
of pages to do the I/O and we'd hit an assertion in
vm_fault_quick_hold_pages unless MAXPHYS was larger than 1M +
PAGE_SIZE.
2017-02-02 23:04:00 +00:00
Warner Losh
40975988cb Implement Intel's log page 0xc1 (Read Command Latency Log) and page
0xc1 (Write Command Latency Log).

Sponsored By: Netflix, Inc
2016-12-09 23:37:14 +00:00
Warner Losh
f1b276bec8 Fix Typo 2016-12-07 21:47:14 +00:00
Warner Losh
5619c99fb3 Flag the vendor specific pages as such. This allows different decoding
for the same page number as different vendors encode vendor specific
pages differently.
2016-12-02 14:44:45 +00:00
Warner Losh
4e44c386ff i386 turns out to not have __uint128_t. So confusingly use 64-bit math
instead. Since we're little endian, we can get away with it. Also,
since the counters in quesitons would require billions of iops for
tens of billions of seconds to overflow, and since such data rates are
unlikely for people using i386 for a while, that's OK. The fastest
cards today can't do even a million IOPs.

Noticed by: dim@
Sponsored by: Netflix, Inc
2016-11-19 21:46:13 +00:00
Warner Losh
9caeb4305d Decode the Intel-specific Additional SMART data page (0xca) and print
it in human readable form. Include a pointer to the public spec that
was followed to implement this in the code. Samsung also implements
page 0xca on some of their drives, but the format is slighly
different, so the code skips printing zero keys. Samsung's log page
has additional, unknown data after the end of Intel defined data which
isn't displayed.

Supported by: Netfix, Inc
2016-11-19 17:13:12 +00:00
Warner Losh
0cf14228c4 Implement HGST Log page 0xc1, as documented in the HGST SN100 and
SN150 product manuals. Subpage 0x32 is documented, but not implemented.

Sponsored by: Netflix, Inc
2016-11-19 17:13:08 +00:00
Warner Losh
ab1dd0917b Print Intel's expanded Temperature log page.
Sponsored by: Netflix, Inc
2016-11-19 17:13:03 +00:00
Warner Losh
dc58cdf95e Expand the SMART / Health Information Log Page (Page 02) printout
based on NVM Express 1.2.1 Standard.

Sponsored by: Netflix, Inc
2016-11-19 17:12:49 +00:00
Warner Losh
33a099d2e5 Print numbers instead of hex values for smart data. The full 128-bit
number is printed, even though you'd need like a billion IOPs for a 10
billion seconds to overflow the 64-bit counters (~300 years).

Sponsored by: Netflix, Inc
2016-11-19 17:12:44 +00:00
Warner Losh
cc63e8e6ab Use a table for pages we know the size of. We have a special case for
the error log since it isn't a fixed size.

Sponsored by: Netflix, Inc
2016-11-19 17:12:39 +00:00
Warner Losh
fbc3f2995e Remove check for valid log pages. Let the drive tell us which pages
are valid or not. While many pages are reserved in the standard, that
doesn't make them invalid and future versions of the standard may
define then.

Sponsored by: Netflix, Inc
2016-11-19 17:12:28 +00:00
Allan Jude
0fcf43f6f3 Add missing history sections to a number of storage related man pages
gmultipath.8: Add HISTORY
	Adjust sentences with bad phrases picked up by igor

ggatec.8: Add HISTORY

ggated.8: Add HISTORY

ggatel.8: Add HISTORY
	Seperate out sentence as advised by igor.

hastctl.8: Add HISTORY

hastd.8: Add HISTORY
	Fix sentence highlighted by igor.

iscontrol.8: Add HISTORY

mdmfs.8: Add HISTORY
	Address issues raised by igor

mount_nfs.8: Add HISTORY
	Not sure where mount_nfs first showed up, but the verison used
	in the BSD's originates from 4.4BSD according to CSRG archive.

	Though commercial offerings from Sun and others covers older
	systems, eg https://groups.google.com/forum/#!topic/net.unix-wizards/lMe7aQikqJI

nandfs.8: Add HISTORY
	Adjust sentence in description to address bad phrase highlighted
	by igor.

nvmecontrol.8: Add HISTORY

PR:		212491
PR:		212498
PR:		212499
PR:		212500
PR:		212501
PR:		212502
PR:		212505
PR:		212508
PR:		212540
PR:		212543
PR:		212546
Submitted by:	Sevan Janiyan <venture37@geeklan.co.uk>
2016-09-16 04:28:31 +00:00
Pedro F. Giffuni
eabd8f1210 nvmecontrol.8: minor spelling fix.
No functional change.
2016-05-06 03:11:34 +00:00
Glen Barber
538354481e MFH
Sponsored by:	The FreeBSD Foundation
2016-03-14 18:54:29 +00:00
Dimitry Andric
b130d07f90 In nvmecontrol, fix gcc warnings about the local 'power' variables
shadowing a global declaration.
2016-03-11 17:25:18 +00:00
Glen Barber
406d87b1c3 Explicitly add more files to the 'runtime' package.
Sponsored by:	The FreeBSD Foundation
2016-02-09 20:19:31 +00:00
Warner Losh
038659e7dd Implement power command to list all power modes, find out the power
mode we're in and to set the power mode.
2016-01-30 22:48:06 +00:00