Commit Graph

90 Commits

Author SHA1 Message Date
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
Enji Cooper
a2d0c52540 Revert r295062 to unbreak buildworld
Some of the structures referenced in power.c (in particular
struct nvme_power_state) are missing from sbin/nvmecontrol/

Pointyhat to: imp
Reported by: Jenkins [*], O. Hartmann <ohartman@zedat.fu-berlin.de>, Outback Dingo <outbackdingo@gmail.com>
2016-01-30 17:10:14 +00:00
Warner Losh
d636ad2ee8 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 06:18:37 +00:00
Jim Harris
628683cb81 nvmecontrol: read controller identify data before any log page operations
MFC after:	3 days
Sponsored by:	Intel
2015-07-22 16:10:29 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin
bd0891ceb3 use .Mt to mark up email addresses consistently (part1)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:40:43 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Jim Harris
efa2980530 For "nvmecontrol devlist", show namespace sizes in terms of MB instead of
GB to improve granularity of the reporting - especially for namespaces
that are on the order of 1 or 2 GB.

Submitted by:	Tony Beltran <anthony.beltran@emc.com>
MFC after:	3 days
2014-01-06 23:48:47 +00:00
Jim Harris
4a14f9dadc Check for special status code from FIRMWARE_ACTIVATE command
signifying that a reboot is required to complete activation
of the requested firmware image.

Reported by:	Joe Golio <joseph.golio@emc.com>
Sponsored by:	Intel
MFC after:	3 days
2013-11-12 21:14:19 +00:00
Jim Harris
f97bf48a87 Do not exit with error status after printing data for perftest.
Sponsored by:	Intel
Reported by:	Joe Golio <joseph.golio@emc.com>
MFC after:	3 days
2013-11-01 22:05:29 +00:00