]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Implement zero-copy iSCSI target transmission/read.
authormav <mav@FreeBSD.org>
Mon, 8 Jun 2020 20:53:57 +0000 (20:53 +0000)
committermav <mav@FreeBSD.org>
Mon, 8 Jun 2020 20:53:57 +0000 (20:53 +0000)
commitd0d0c2627385859d405d30934034098b1132a2f3
tree745260c79d32f36611ac94bef82297b5cd51cf9d
parentaefd5f515c882abf51e3965b12c55dea78bc1b92
Implement zero-copy iSCSI target transmission/read.

Add ICL_NOCOPY flag to icl_pdu_append_data(), specifying that the method
can just reference the data buffer instead of immediately copying it.

Extend the offload KPI with optional PDU queue method, allowing to specify
completion callback, called when all the data referenced by above has been
transferred and won't be accessed any more (the buffers can be freed).

Implement the above functionality in software iSCSI driver using mbufs
with external storage and reference counter.  Note that some NICs (ixl(4))
may keep the mbuf in TX queue for a long time, so CTL has to be ready.

Add optional method to struct ctl_scsiio for buffer reference counting.
Implement it for CTL block backend, allowing to delay free of the struct
ctl_be_block_io and memory it references as needed.  In first reincarnation
of the patch I tried to delay whole I/O as it is done for FibreChannel,
that was cleaner, but due to the above callback delays I had to rewrite
it this way to not leave LUN referenced potentially for hours or more.

All together on sequential read from ZFS ARC this saves about 30% of CPU
time and memory bandwidth by avoiding one of 3 memory copies (the other
two are from ZFS ARC to DMU cache and then from DMU cache to CTL buffers).
On tests with 2x Xeon Silver 4114 this allows to reach full line rate of
100GigE NIC.  Tests with Gold CPUs and two 100GigE NICs are stil TBD,
but expectations to saturate them are pretty high. ;)

Discussed with: Chelsio
Sponsored by: iXsystems, Inc.
sys/cam/ctl/ctl_backend_block.c
sys/cam/ctl/ctl_frontend_iscsi.c
sys/cam/ctl/ctl_io.h
sys/dev/iscsi/icl.h
sys/dev/iscsi/icl_conn_if.m
sys/dev/iscsi/icl_soft.c
sys/dev/iscsi/icl_wrappers.h