Linux's `nvme sanititze -a` takes a number, not a string. Accept 1-4 for
compatibility so vendor's recepies are easier to implmement.
Sponsored by: Netflix
The internal KATO is stored in milliseconds, so convert the command
line argument (given in seconds) to milliseconds before passing to
nvmf_connect().
Sponsored by: Chelsio Communications
Consistently use the weird ssize_t type for things I know are unsigned,
but which none-the-less need to be compared to signed things to prevent
a bogus warning. Sigh, these aren't bugs, can't possibly be bugs and
a waste of time to fix.
Sponsored by: Netflix
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
In this case it is harmless since it is an array of pointers so the
resulting length is identical.
Reported by: Coverity Scan
CID: 1545055
Sponsored by: Chelsio Communications
Even though mqes (uint16_t) and queue_size (u_int) are both unsigned,
the expression 'mqes + 1' gets promoted to int which is signed. Keep
the value unsigned by explicitly promoting mqes to u_int before
incrementing the value.
Reported by: GCC
- 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
nvmecontrol operates on devices. Allow a user to specify the /dev/ if
they want. Any device that starts with / will be treated as if it was a
full path for maximum flexbility.
Sponsored by: Netflix
The format command takes a number of different parameters. Include a
brief summary of what the values mean, though since the driver's support
for metadata is at best weak, 0's are almost always used for values
other than -f format. Add an example that ties it all together.
Sponsored by: Netflix
Reviewed by: pauamma@gundo.com, chuck
Differential Revision: https://reviews.freebsd.org/D44958
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
Add the lpo, ot, csi and uuid_index fields to read_logpage. The logpage
command has not been updated to allow these to be specified.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44683
Provide preliminary namespace subcommand documentation, along with some
basic definitions from the NVM standards relating to namespaces.
Sponsored by: Netflix
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D44682
Also, add printing vnedor_specific field, which doesn't have a valid
bit, so is always valid.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44654
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
armv7, powerpc, powerpcspe and i386 all lack 128-bit integer
types. Adjust the comment and #ifdef. I don't think we support nvme on
any of these other architectures at the moment, but it won't hurt to be
more precise.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44650
As the number of page types proliferates, it becomes untennable to
convert them in read_logpage (especailly since new UUID page types will
need to be supported). Convert the error page printing code to operate
on little endian data.
Sponsored by: Netflix
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44680
Using _Generic, create letoh which will generically convert uintXX_t
types from little endian to host, regardless of the size. This name has
been floated as a possible addition to endian.h.
Sponsored by: Netflix
Discussed with: jhb
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D44649
Some of these fields are specific to Fabrics controllers (such as the
size of capsules) while other fields are shared with PCI-e
controllers, but are more relevant for Fabrics controllers (such as
KeepAlive timer properties).
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44449
In particular, don't try to byteswap the values as 64-bit integers and
always print a non-empty version as a string.
Reviewed by: chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44121
The manpage of nvmecontrol(8) has the following SYNOPSIS:
nvmecontrol format [-f fmt] [-m mset] [-o pi] [-l pil] [-E]
[-C] <device-id | namespace-id>
The correct switch for the pi option is -p according
to sbin/nvmecontrol/format.c:
OPT("pi", 'p', arg_uint32, opt, pi, "Protective information")
So correct the SYNOPSIS section accordingly.
PR: 276554
Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44099
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix