nvmf_tcp: Add a TCP transport for NVMe over FabricsStructurally this is very similar to the TCP transport for iSCSI(icl_soft.c). One key difference is that NVMeoF transports use a moreabstract i
nvmf_tcp: Add a TCP transport for NVMe over FabricsStructurally this is very similar to the TCP transport for iSCSI(icl_soft.c). One key difference is that NVMeoF transports use a moreabstract interface working with NVMe commands rather than transportPDUs. Thus, the data transfer for a given command is managed entirelyin the transport backend.Similar to icl_soft.c, separate kthreads are used to handle transmitand receive for each queue pair. On the transmit side, when a capsuleis transmitted by an upper layer, it is placed on a queue forprocessing by the transmit thread. The transmit thread convertscommand response capsules into suitable TCP PDUs where each PDU isdescribed by an mbuf chain that is then queued to the backing socket'ssend buffer. Command capsules can embed data along with the NVMecommand.On the receive side, a socket upcall notifies the receive kthread whenmore data arrives. Once enough data has arrived for a PDU, the PDU ishandled synchronously in the kthread. PDUs such as R2T or datarelated PDUs are handled internally, with callbacks invoked if a datatransfer encounters an error, or once the data transfer has completed.Received capsule PDUs invoke the upper layer's capsule_receivedcallback.struct nvmf_tcp_command_buffer manages a TCP command buffer for datatransfers that do not use in-capsule-data as described in the NVMeoFspec. Data related PDUs such as R2T, C2H, and H2C are associated witha command buffer except in the case of the send_controller_datatransport method which simply constructs one or more C2H PDUs from thecaller's mbuf chain.Sponsored by: Chelsio CommunicationsDifferential Revision: https://reviews.freebsd.org/D44712
show more ...