Page MenuHomeFreeBSD

nvmfdd: A simple userspace NVMe over Fabrics host

Authored by jhb on Apr 9 2024, 11:05 PM.
Referenced Files
Unknown Object (File)
Thu, Jun 13, 6:28 PM
Unknown Object (File)
Mon, Jun 3, 2:46 PM
Unknown Object (File)
Mon, May 27, 2:12 AM
Unknown Object (File)
May 3 2024, 10:30 AM
Unknown Object (File)
Apr 26 2024, 5:00 AM
Unknown Object (File)
Apr 12 2024, 7:14 PM



This program uses libnvmf to connect to a remote Fabrics controller
and perform a single read or write operation. The write command reads
data from stdin to construct one or more NVM Write commands sent to
the remote namespace. The read command uses one or more NVM Read
commands to read blocks frmo a remote namespace writing the data to

Sponsored by: Chelsio Communications

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

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

I used this to test my initial libnvmf code against a Linux target before then implementing the in-kernel host. I also used this as the first client to test the userspace and later kernel controllers.

s/frmo/from/ typo in the commit log I will fix before merging

A quick review didn't see any glaring problems.
But I have little nvmf clue, so I Don't know if the details are right.

This revision is now accepted and ready to land.Apr 13 2024, 5:49 PM

Handful of nits, but overall, LGTM!


FWIW, there are a couple of edge cases around transitioning cc.en with respect to csts.rdy. Typically this only matters when hardware gets "grumpy", so the extra complexity might not be worth it here.


The other NSID check for I/O commands would be against nsid != 0


Might be worth checking the return value and bailing on NULL.


Should this error block free the association too?

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
jhb marked an inline comment as done.May 1 2024, 10:21 PM
jhb added inline comments.

In this case csts.rdy is known to be zero when you first connect and we are going to wait for it to transition to 1 in the loop below after setting cc.en.


That is handled down in main after the getopt loop:

	if (nsid == 0 || nsid >= 0xffffffff)
		errx(1, "Invalid namespace ID %u", nsid);

Yes, good catch

jhb marked an inline comment as done.

Add missing nvmf_free_association

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.