Page MenuHomeFreeBSD

nvmf_tcp: Add a TCP transport for NVMe over Fabrics
Needs ReviewPublic

Authored by jhb on Tue, Apr 9, 11:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 6:24 AM
Unknown Object (File)
Sat, Apr 27, 6:22 AM
Unknown Object (File)
Sat, Apr 27, 6:17 AM
Unknown Object (File)
Sat, Apr 27, 6:17 AM
Unknown Object (File)
Fri, Apr 26, 6:47 PM
Unknown Object (File)
Fri, Apr 26, 4:58 AM
Unknown Object (File)
Fri, Apr 26, 3:57 AM
Unknown Object (File)
Fri, Apr 19, 2:56 AM
Subscribers

Details

Reviewers
imp
Summary

Structurally this is very similar to the TCP transport for iSCSI
(icl_soft.c). One key difference is that NVMeoF transports use a more
abstract interface working with NVMe commands rather than transport
PDUs. Thus, the data transfer for a given command is managed entirely
in the transport backend.

Similar to icl_soft.c, separate kthreads are used to handle transmit
and receive for each queue pair. On the transmit side, when a capsule
is transmitted by an upper layer, it is placed on a queue for
processing by the transmit thread. The transmit thread converts
command response capsules into suitable TCP PDUs where each PDU is
described by an mbuf chain that is then queued to the backing socket's
send buffer. Command capsules can embed data along with the NVMe
command.

On the receive side, a socket upcall notifies the receive kthread when
more data arrives. Once enough data has arrived for a PDU, the PDU is
handled synchronously in the kthread. PDUs such as R2T or data
related PDUs are handled internally, with callbacks invoked if a data
transfer encounters an error, or once the data transfer has completed.
Received capsule PDUs invoke the upper layer's capsule_received
callback.

struct nvmf_tcp_command_buffer manages a TCP command buffer for data
transfers that do not use in-capsule-data as described in the NVMeoF
spec. Data related PDUs such as R2T, C2H, and H2C are associated with
a command buffer except in the case of the send_controller_data
transport method which simply constructs one or more C2H PDUs from the
caller's mbuf chain.

Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57003
Build 53891: arc lint + arc unit