History log of /freebsd/sys/dev/nvme/nvme_ctrlr.c (Results 1 – 25 of 258)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# dc95228d 25-Feb-2025 Warner Losh <imp@FreeBSD.org>

nvme: Fix hotplug on one of the amazon platforms

Amazon EC2 m7i cloud instances use PCI hotplug rather than ACPI
hotplug. The card is removed and detach is called to remove the drive
from the system

nvme: Fix hotplug on one of the amazon platforms

Amazon EC2 m7i cloud instances use PCI hotplug rather than ACPI
hotplug. The card is removed and detach is called to remove the drive
from the system. The hardware is no longer present at this point, but
the bridge doesn't translate the now-missing hardware reads to all ff's
leading us to conclude the hardware is there and we need to do a proper
shutdown of it. Fix this oversight by asking the bridge if the device is
still present as well. We need both tests since some systems one cane
remove the card w/o a hotplug event and we want to fail-safe in those
cases.

Convert gone to a bool while I'm here and update a comment about
shutting down the controller and why that's important.

Tested by: cperciva
Sponsored by: Netflix

show more ...


Revision tags: release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4
# 4298ce72 31-Jan-2025 John Baldwin <jhb@FreeBSD.org>

nvme/nvmf: Add NVME_GET_CONTROLLER_DATA ioctl to fetch cached cdata

Both nvme and nvmf cache a copy of the controller's identify data in
the softc. Add an ioctl to fetch this copy of the cdata. Th

nvme/nvmf: Add NVME_GET_CONTROLLER_DATA ioctl to fetch cached cdata

Both nvme and nvmf cache a copy of the controller's identify data in
the softc. Add an ioctl to fetch this copy of the cdata. This is
primarily useful for allowing commands like 'nvmecontrol devlist' to
work against a disconnected Fabrics host.

Reviewed by: dab, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48218

show more ...


Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0
# f08746a7 09-Nov-2024 Mark Johnston <markj@FreeBSD.org>

nvme: Pass malloc flags to request allocation functions

There are some contexts where it is safe to sleep, so we should pass
M_WAITOK to ensure that a null pointer dereference can't happen.

A few p

nvme: Pass malloc flags to request allocation functions

There are some contexts where it is safe to sleep, so we should pass
M_WAITOK to ensure that a null pointer dereference can't happen.

A few places allocate with M_NOWAIT but have no way to signal an error.
Flag those with an XXX comment.

PR: 276770
Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D47307

show more ...


# 3aac51cb 02-Nov-2024 Warner Losh <imp@FreeBSD.org>

nvme: Clarify a comment

Expand the comment a little to make it clearer: Once we've restarted,
we're out of the resetting phase in our state machine. The controller
has actually been out of reset sin

nvme: Clarify a comment

Expand the comment a little to make it clearer: Once we've restarted,
we're out of the resetting phase in our state machine. The controller
has actually been out of reset since we started issuing commands to it
earlier in the resetting phase.

Sponsored by: Netflix

show more ...


# 9dbff03c 16-Oct-2024 Warner Losh <imp@FreeBSD.org>

nvme: Inject artificial failure on reset

Add a sysctl to artificially fail the reset to test the failure to reset
hardware code path. While there are many ways that reset can fail, this
provides an

nvme: Inject artificial failure on reset

Add a sysctl to artificially fail the reset to test the failure to reset
hardware code path. While there are many ways that reset can fail, this
provides an adequate way that similates enough of the failures well
enough to shake out this failure path.

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

show more ...


Revision tags: release/13.4.0
# 3d89acf5 15-Aug-2024 Warner Losh <imp@FreeBSD.org>

nvme: Separate total failures from I/O failures

When it's a I/O failure, we can still send admin commands. Separate out
the admin failures and flag them as such so that we can still send admin
comma

nvme: Separate total failures from I/O failures

When it's a I/O failure, we can still send admin commands. Separate out
the admin failures and flag them as such so that we can still send admin
commands on half-failed drives.

Fixes: 9229b3105d88 (nvme: Fail passthrough commands right away in failed state)
Sponsored by: Netflix

show more ...


# ce7fac64 16-Aug-2024 Warner Losh <imp@FreeBSD.org>

Revert "nvme: Separate total failures from I/O failures"

All kinds of crazy stuff was mixed into this commit. Revert
it and do it again.

This reverts commit d5507f9e436698ac17dc5ace7ef58493988a9b04

Revert "nvme: Separate total failures from I/O failures"

All kinds of crazy stuff was mixed into this commit. Revert
it and do it again.

This reverts commit d5507f9e436698ac17dc5ace7ef58493988a9b04.

Sponsored by: Netflix

show more ...


# d5507f9e 15-Aug-2024 Warner Losh <imp@FreeBSD.org>

nvme: Separate total failures from I/O failures

When it's a I/O failure, we can still send admin commands. Separate out
the admin failures and flag them as such so that we can still send admin
comma

nvme: Separate total failures from I/O failures

When it's a I/O failure, we can still send admin commands. Separate out
the admin failures and flag them as such so that we can still send admin
commands on half-failed drives.

Fixes: 9229b3105d88 (nvme: Fail passthrough commands right away in failed state)
Sponsored by: Netflix

show more ...


# 8c44df32 14-Aug-2024 Warner Losh <imp@FreeBSD.org>

nvme: Add a clarifying comment

While it is easy enough to bounce over to nvme.c from nvme_ctrlr.c to
find this out, I've had to do that several times, so a little bit of
context is quite helpful.

S

nvme: Add a clarifying comment

While it is easy enough to bounce over to nvme.c from nvme_ctrlr.c to
find this out, I've had to do that several times, so a little bit of
context is quite helpful.

Sponsored by: Netflix

show more ...


# d40fc35f 14-Aug-2024 Warner Losh <imp@FreeBSD.org>

nvme: Make is_initialized a bool

is_initialized is used as a bool everywhere, and we never do any atomics
with it, so make it really a bool.

Sponsored by: Netflix


# d37286b9 29-Jul-2024 Mark Johnston <markj@FreeBSD.org>

proc: Remove kernel stack swapping support, part 7

Remove some uses of PHOLD which were there only to prevent the process'
threads from being swapped out.

Tested by: pho
Reviewed by: imp, kib
Diffe

proc: Remove kernel stack swapping support, part 7

Remove some uses of PHOLD which were there only to prevent the process'
threads from being swapped out.

Tested by: pho
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D46118

show more ...


# b195d749 27-Jun-2024 Ryan Libby <rlibby@FreeBSD.org>

nvme: avoid gcc -Werror=int-to-pointer-cast on 32-bit arch

Reviewed by: chuck (previous version), imp
Differential Revision: https://reviews.freebsd.org/D45750


# 1bce7cd8 15-Jun-2024 Warner Losh <imp@FreeBSD.org>

nvme: Add Linux copatible ioctls

Add the NVME_IOCTL_ID, NVME_IOCTL_ADMIN_CMD, and NVME_IOCTL_IO_CMD Linux
compatible ioctls. These may be run on either an I/O (ns) dev or a nvme
(admin) dev. Linux a

nvme: Add Linux copatible ioctls

Add the NVME_IOCTL_ID, NVME_IOCTL_ADMIN_CMD, and NVME_IOCTL_IO_CMD Linux
compatible ioctls. These may be run on either an I/O (ns) dev or a nvme
(admin) dev. Linux allows both on either device, and programs use this
and aren't careful about having the right device open. Emulate this
feature, and implement these ioctls. The data is passed in into the
kernel in host byte order (not converted to le). Results are returned in
host order.

The timeout field is ignore, and the metadata and metadata_len fields
must be zero.

The addr field can be null, even when the data_len is non zero (FreeBSD's
ioctl interface prohibits this, Linux's just ignores the inconsistency).

Only the cdw10 is returned from the command: the status is not returned
in 'result' field. XXX need to verify that this is what Linux does on an
error signaled from the drive.

No external include file is yet available for this: most programs that
call this interface either use a linux-specific path <linux/nvme.h> or
have their own private copy of the data. It's unclear the best thing to
do.

Also, create a /dev/nvmeXnY as an alias for /dev/nvmeXnsY.

These changes allow a native build of nvme-cli to work for everything
that doesn't depend on sysfs entries in /sys, calls that use metadata,
send / receive drive data and sed functionality not in our nvme driver.

Sponsored by: Netflix
Co-Authored-by: Chuck Tuffli <chuck@freebsd.org>
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D45415

show more ...


# ce75bfca 01-Jun-2024 Chuck Tuffli <chuck@FreeBSD.org>

nvme: Change namespace device name

Changes the device name for NVMe and NVMe-oF namespaces from using "ns"
to "n" to be more compatible with other operating systems. For example,
a device which was

nvme: Change namespace device name

Changes the device name for NVMe and NVMe-oF namespaces from using "ns"
to "n" to be more compatible with other operating systems. For example,
a device which was previously /dev/nvme0ns1 is now /dev/nvme0n1.

Preserves the existing functionality by creating alias from nvmeXnY to
nvmeXnsY.

Reviewed by: imp
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D45414

show more ...


Revision tags: release/14.1.0
# d09ee08f 24-May-2024 Warner Losh <imp@FreeBSD.org>

nvme: Count number of alginment splits

When possible, we split up I/Os to NVMe drives that advertise a
preferred alignment. Add a counter for this.

Sponsored by: Netflix
Reviewed by: chuck, mav
D

nvme: Count number of alginment splits

When possible, we split up I/Os to NVMe drives that advertise a
preferred alignment. Add a counter for this.

Sponsored by: Netflix
Reviewed by: chuck, mav
Differential Revision: https://reviews.freebsd.org/D45311

show more ...


# da4230af 13-May-2024 John Baldwin <jhb@FreeBSD.org>

nvme/f: Use strlcpy instead of strncpy + manual string termination

Reviewed by: dab, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D45153


# 97b77de2 17-Apr-2024 Warner Losh <imp@FreeBSD.org>

nvme: Eliminate intel_log_temp_stats_swapbytes

We can't post a AER for this page, so there's no need to be able to swap
it to host byte order. It's not one of the standard defined pages that
can pos

nvme: Eliminate intel_log_temp_stats_swapbytes

We can't post a AER for this page, so there's no need to be able to swap
it to host byte order. It's not one of the standard defined pages that
can post via AER, and the vendor's public docs for this temperature page
don't suggest it's possible to get over or under event changes. Since
nvmecontrol no longer needsd the swap routine, remove it since it's
now unused.

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

show more ...


# b354bb04 23-Mar-2024 John Baldwin <jhb@FreeBSD.org>

nvme: Add constants for fields in AER completion dword 0

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


# 2a2682ee 07-Mar-2024 Warner Losh <imp@FreeBSD.org>

nvme: Add SMART WARNING for persistent memory region

NVME 2.0 added persistent memory regions, and this bit reports critical
warnings / errors with those regions.

Sponsored by: Netflix
Reviewed by

nvme: Add SMART WARNING for persistent memory region

NVME 2.0 added persistent memory regions, and this bit reports critical
warnings / errors with those regions.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D44213

show more ...


# 5cdedf67 07-Mar-2024 Warner Losh <imp@FreeBSD.org>

nvme: Log reset success or failure to devd

We're logging when we start a reset, but not when we complete it, nor
the result. Create now log a success or timed_out event for the reset.
Currently, the

nvme: Log reset success or failure to devd

We're logging when we start a reset, but not when we complete it, nor
the result. Create now log a success or timed_out event for the reset.
Currently, the only detectable error we have from reset is 'failure to
become ready in time,' though the code looks like it might be more
generic. Log this and if we ever have other failure modes, change the
logging to devd when that happens.

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

show more ...


# 4f817fcf 07-Mar-2024 Warner Losh <imp@FreeBSD.org>

nvme: Change devctl events for the controller

Change the devctl events slightly for the controller. SMART errors will
log the changed bits in the NVME SMART Critical Warning State as its
event.

Res

nvme: Change devctl events for the controller

Change the devctl events slightly for the controller. SMART errors will
log the changed bits in the NVME SMART Critical Warning State as its
event.

Reset will now emit 'event=start'. Soon more.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D44210

show more ...


# fc3afe93 07-Mar-2024 Warner Losh <imp@FreeBSD.org>

nvme: split devctl out to its own function

Split the devctl aspect of things out to its own function in
nvme_ctrlr_devctl_log. In preparing to document this, and based on
actual use, we want somethi

nvme: split devctl out to its own function

Split the devctl aspect of things out to its own function in
nvme_ctrlr_devctl_log. In preparing to document this, and based on
actual use, we want something different for the SMART errors, so this
will facilitate that.

Sponsored by: Netflix
Reviewed by: chuck, mav
Differential Revision: https://reviews.freebsd.org/D44209

show more ...


# c5246cb7 02-Mar-2024 Warner Losh <imp@FreeBSD.org>

nvme: Report only the unknown bits

When we get a smart error that's unknown, report only the unknown
(reserved) bits of the Critical Warning Bitfield.

Sponsored by: Netflix


# 7485926e 01-Mar-2024 John Baldwin <jhb@FreeBSD.org>

nvme: Firmware revisions in the firmware slot info logpage are ASCII strings

In particular, don't try to byteswap the values as 64-bit integers and
always print a non-empty version as a string.

Rev

nvme: Firmware revisions in the firmware slot info logpage are ASCII strings

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

show more ...


Revision tags: release/13.3.0
# 5650bd3f 29-Jan-2024 John Baldwin <jhb@FreeBSD.org>

nvme: Use the NVMEF macro to construct fields

Reviewed by: chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43605


1234567891011