History log of /freebsd-current/sbin/nvmecontrol/Makefile
Revision Date Author Comments
# c1fccf0f 08-Apr-2024 Warner Losh <imp@FreeBSD.org>

nvmecontrol: Implement telemetry-log command.

This produces the same data as the Linux nvme-cli 'nvme telemetry-log'
command. It extracts the telemetry log from drive. This is a variable
length log, so we read the first page and find out how much of the log
to grab. There's 3 levels of details available, and we grab the level of
detail specified on the command line.

Sponsored by: Netflix


# 1058c121 02-May-2024 John Baldwin <jhb@FreeBSD.org>

nvmecontrol: New commands to support Fabrics hosts

- discover: Connects to a remote Discovery controller, fetches its
Discovery Log Page, and enumerates the remote controllers described
in the log page.

The -v option can be used to display the Identify Controller data
structure for the Discovery controller. This is only really useful
for debugging.

- connect: Connects to a remote I/O controller and establishes an
association of an admin queue and a single I/O queue. The
association is handed off to the in-kernel host to create a new
nvmeX device.

- connect-all: Connects to a Discovery controller and attempts to
create an association with each I/O controller enumerated in the
Discovery controller's Discovery Log Page.

- reconnect: Establishes a new association with a remote I/O
controller for an existing nvmeX device. This can be used to
restore access to a remote I/O controller after the loss of a prior
association due to a transport error, controller reboot, etc.

- disconnect: Deletes one or more nvmeX devices after detaching its
namespaces and terminating any active associations. The devices to
delete can be identified by either a nvmeX device name or the NQN of
the remote controller.

- disconnect-all: Deletes all active associations with remote
controllers.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44715


# 49ea0889 16-Apr-2024 Warner Losh <imp@FreeBSD.org>

nvmecontrol: One file per line

Move to a one file per line setup, and sort the files alphabetically.

Sponsored by: Netflix
Reviewed by: chuck, jhb
Differential Revision: https://reviews.freebsd.org/D44684


# 1c4b7eff 16-Apr-2024 Warner Losh <imp@FreeBSD.org>

nvmecontrol: Fix to128 for big endian targets

The source is always 128-bits in little endian format. For big endian
hosts, we have to convert, or we print bogus numbers.

Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44651


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 5f9db65d 22-Jul-2022 Emmanuel Vadot <manu@FreeBSD.org>

pkgbase: Put nvmecontrol in its own package

It doesn't really make sense to have it in runtime and let's not
bloat utilities more.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D36221


# 67334019 08-Jan-2021 Chuck Tuffli <chuck@FreeBSD.org>

nvmecontrol: add device self-test op and log page

Add decoding of the Device Self-test log page and the ability to start
or abort a test.

Reviewed by: imp, mav
Tested by: Muhammad Ahmad <muhammad.ahmad@seagate.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27517


# 0e3e53d7 07-Apr-2020 David Bright <dab@FreeBSD.org>

Add a basic test for nvmecontrol

I recently made some bug fixes in nvmecontrol. It occurred to me that
since nvmecontrol lacks any kyua tests, I should convert the informal
testing I did into a more formal automated test. The test in this
change should be considered just a starting point; it is neither
complete nor thorough. While converting the test to ATF/kyua, I
discovered a small bug in nvmecontrol; the nvmecontrol devlist command
would always exit with an unsuccessful status. So I included the fix
for that, too, so that the test won't fail.

Reviewed by: imp@
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24269


# ef7a2ead 06-Aug-2019 Warner Losh <imp@FreeBSD.org>

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.


# 70d20ed3 05-Aug-2019 Alexander Motin <mav@FreeBSD.org>

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.


# 278ba86c 03-Aug-2019 Alexander Motin <mav@FreeBSD.org>

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.


# a7bf63be 01-Aug-2019 Alexander Motin <mav@FreeBSD.org>

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.


# f634b4c1 16-Jul-2019 Warner Losh <imp@FreeBSD.org>

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


# eac8e827 06-Dec-2018 Warner Losh <imp@FreeBSD.org>

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


# 228c4255 06-Dec-2018 Warner Losh <imp@FreeBSD.org>

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


# 2da383a5 02-Dec-2018 Warner Losh <imp@FreeBSD.org>

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


# e505b7ec 13-Jun-2018 Warner Losh <imp@FreeBSD.org>

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


# ba405bc8 05-May-2018 Alexander Motin <mav@FreeBSD.org>

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


# 635c517a 12-Mar-2018 Alexander Motin <mav@FreeBSD.org>

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.


# 970d454f 27-Jun-2017 Warner Losh <imp@FreeBSD.org>

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)


# 22289a8c 04-Mar-2017 Enji Cooper <ngie@FreeBSD.org>

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


# ffce99f5 03-Feb-2017 Warner Losh <imp@FreeBSD.org>

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


# 406d87b1 09-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Explicitly add more files to the 'runtime' package.

Sponsored by: The FreeBSD Foundation


# 038659e7 30-Jan-2016 Warner Losh <imp@FreeBSD.org>

Implement power command to list all power modes, find out the power
mode we're in and to set the power mode.


# a2d0c525 30-Jan-2016 Enji Cooper <ngie@FreeBSD.org>

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>


# d636ad2e 29-Jan-2016 Warner Losh <imp@FreeBSD.org>

Implement power command to list all power modes, find out the power
mode we're in and to set the power mode.


# 38441bd9 19-Jul-2013 Jim Harris <jimharris@FreeBSD.org>

Add message when nvd disks are attached and detached.

As part of this commit, add an nvme_strvis() function which borrows
heavily from cam_strvis(). This will allow stripping of
leading/trailing whitespace and also handle unprintable characters
in model/serial numbers. This function goes into a new nvme_util.c
file which is used by both the driver and nvmecontrol.

Sponsored by: Intel
Reviewed by: carl
MFC after: 3 days


# 49fac610 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Add firmware replacement and activation support to nvmecontrol(8) through
a new firmware command.

NVMe controllers may support up to 7 firmware slots for storing of
different firmware revisions. This new firmware command supports
firmware replacement (i.e. firmware download) with or without immediate
activation, or activation of a previously stored firmware image. It
also supports selection of the firmware slot during replacement
operations, using IDENTIFY information from the controller to
check that the specified slot is valid.

Newly activated firmware does not take effect until the new controller
reset, either via a reboot or separate 'nvmecontrol reset' command to the
same controller.

Submitted by: Joe Golio <joseph.golio@emc.com>
Obtained from: EMC / Isilon Storage Division
MFC after: 3 days


# 75871362 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Add log page support to nvmecontrol(8) through a new logpage command.

This includes pretty printers for all of the standard NVMe log pages
(Error, SMART/Health, Firmware), as well as hex output for non-standard
or vendor-specific log pages.

Submitted by: Joe Golio <joseph.golio@emc.com>
Obtained from: EMC / Isilon Storage Division
MFC after: 3 days


# 28c09110 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Break out code related to the reset command into a separate source file.

Sponsored by: Intel
MFC after: 3 days


# bbc1ac63 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Break out code related to the perftest command into a separate file.

Sponsored by: Intel
MFC after: 3 days


# 6f0823e4 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Break out code related to the identify command into a separate source file.

Sponsored by: Intel
MFC after: 3 days


# 6660d5e4 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Break out code related to the devlist command into a separate source file.

Sponsored by: Intel
MFC after: 3 days


# 4cb79292 17-Sep-2012 Jim Harris <jimharris@FreeBSD.org>

Add nvmecontrol(8) source code and beginnings of a man page to the tree.

Sponsored by: Intel
Contributions from: Joe Golio/EMC <joseph dot golio at emc dot com>