History log of /freebsd-current/sys/dev/nvmf/host/nvmf.c
Revision Date Author Comments
# f46d4971 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

nvmf: Handle shutdowns more gracefully

If an association is disconnected during a clean shutdown, abort all
pending and future I/O requests with an error to avoid hangs either due
to filesystem unmounts or a stuck GEOM event.

If an association is connected during a clean shutdown, gracefully
disconnect from the remote controller and close the open queues.

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


# aacaeeee 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

nvmf: Permit failing I/O requests while disconnected

Add a kern.nvmf.fail_on_disconnection sysctl similar to the
kern.iscsi.fail_on_disconnection sysctl. This causes pending I/O
requests to fail with an error if an association is disconnected
instead of requeueing to be retried once the association is
reconnected. As with iSCSI, the default is to queue and retry
operations.

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


# e140f85d 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

nvmf: Rescan namespaces after reconnecting

While a host was disconnected from a remote controller, namespaces
might have been added, removed, or altered properties. Rescan the
namespaces after reconnecting to detect any such changes.

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


# f6d434f1 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

nvmf: Rescan all namespaces if the changed NS log page is too large

Previously this just punted with a warning message.

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


# 8a082ca8 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

nvmf: Factor out most of nvmf_rescan_ns into a helper routine

This function accepts a namespace ID and associated namespace data
from IDENTIFY and takes care of updating nvmeXnY and ndaZ.

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


# 02ddb305 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

nvmf: Refactor nvmf_add_namespaces to be more generic

Rename to nvmf_scan_active_namespaces and accept an additional
callback function and callback argument. The callback is invoked on
each active namespace enumerated by the active namespace list from the
IDENTIFY command.

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


# 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


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

nvmf: The in-kernel NVMe over Fabrics host

This is the client (initiator in SCSI terms) for NVMe over Fabrics.
Userland is responsible for creating a set of queue pairs and then
handing them off via an ioctl to this driver, e.g. via the 'connect'
command from nvmecontrol(8). An nvmeX new-bus device is created
at the top-level to represent the remote controller similar to PCI
nvmeX devices for PCI-express controllers.

As with nvme(4), namespace devices named /dev/nvmeXnsY are created and
pass through commands can be submitted to either the namespace devices
or the controller device. For example, 'nvmecontrol identify nvmeX'
works for a remote Fabrics controller the same as for a PCI-express
controller.

nvmf exports remote namespaces via nda(4) devices using the new NVMF
CAM transport. nvmf does not support nvd(4), only nda(4).

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44714