Page MenuHomeFreeBSD

nvmfd: A simple userspace daemon for the NVMe over Fabrics controller
ClosedPublic

Authored by jhb on Apr 9 2024, 11:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 15, 7:33 PM
Unknown Object (File)
Fri, May 3, 11:14 AM
Unknown Object (File)
Thu, May 2, 8:43 PM
Unknown Object (File)
Thu, May 2, 1:21 PM
Unknown Object (File)
Fri, Apr 26, 5:00 AM
Unknown Object (File)
Thu, Apr 25, 8:55 PM
Unknown Object (File)
Sat, Apr 20, 6:34 AM
Unknown Object (File)
Fri, Apr 19, 6:16 AM
Subscribers
None

Details

Summary

This daemon can operate as a purely userspace controller exporting one
or more simulated RAM disks or local block devices as NVMe namespaces
to a remote host. In this case the daemon provides a discovery
controller with a single entry for an I/O controller.

nvmfd can also offload I/O controller queue pairs to the nvmft.ko
in-kernel Fabrics controller when -K is passed. In this mode, nvmfd
still accepts connections and performs initial transport-specific
negotitation in userland. The daemon still provides a userspace-only
discovery controller with a single entry for an I/O controller.
However, queue pairs for the I/O controller are handed off to the CTL
NVMF frontend.

Eventually ctld(8) should be refactored to to provide an abstraction
for the frontend protocol and the discovery and the kernel mode of
this daemon should be merged into ctld(8). At that point this daemon
can be moved to tools/tools/nvmf as a debugging tool (mostly as sample
code for a userspace controller using libnvmf).

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Apr 9 2024, 11:05 PM
jhb created this revision.

This seems good, but again, it's kinda huge and that makes careful review is hard.

usr.sbin/nvmfd/controller.c
27

Consider omitting the boilerplate, here and elsewhere in the reviews.

usr.sbin/nvmfd/devices.c
81

I'd make this a #define... it could be 4k too, or at least it might be nice.

287

what happens when malloc fails? core dump?

This revision is now accepted and ready to land.Apr 12 2024, 12:36 AM
usr.sbin/nvmfd/devices.c
81

I guess this can use DEV_BSIZE as that is hardcoded as 512 in practice.

In theory this could be a configurable knob, but the userspace controller isn't really intended for serious production use, more for testing / debugging.

287

Yep. (Again, this is only relevant when running the userspace controller, not for the production use case).

Update TCP digest command line options to match nvme(1) on Linux

This revision now requires review to proceed.Wed, May 1, 9:13 PM

Switch to SPDX-only license blocks for C files

This revision was not accepted when it landed; it landed in state Needs Review.Fri, May 3, 12:17 AM
This revision was automatically updated to reflect the committed changes.