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)
Thu, Nov 14, 4:13 PM
Unknown Object (File)
Thu, Nov 14, 4:11 PM
Unknown Object (File)
Thu, Nov 14, 3:24 AM
Unknown Object (File)
Fri, Nov 1, 2:15 PM
Unknown Object (File)
Fri, Oct 25, 6:50 PM
Unknown Object (File)
Oct 21 2024, 6:39 PM
Unknown Object (File)
Oct 21 2024, 6:29 PM
Unknown Object (File)
Oct 19 2024, 12:08 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 57518
Build 54406: arc lint + arc unit

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.May 1 2024, 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.May 3 2024, 12:17 AM
This revision was automatically updated to reflect the committed changes.