freebsd-dev/sys
John Baldwin 67360f7bb0 cxgbei: Support iSCSI offload on T6.
T6 makes several changes relative to T5 for receive of iSCSI PDUs.

First, earlier adapters issue either 2 or 3 messages to the host for
each PDU received: CPL_ISCSI_HDR contains the BHS of the PDU,
CPL_ISCSI_DATA (when DDP is not used for zero-copy receive) contains
the PDU data as buffers on the freelist, and CPL_RX_ISCSI_DDP with
status of the PDU such as result of CRC checks.  In T6, a new
CPL_RX_ISCSI_CMP combines CPL_ISCSI_HDR and CPL_RX_ISCSI_DDP.  Data
PDUs which are directly placed via DDP only report a single
CPL_RX_ISCSI_CMP message.  Data PDUs received on the free lists are
reported as CPL_ISCSI_DATA followed by CPL_RX_ISCSI_CMP.  Control PDUs
such as R2T are still reported via CPL_ISCSI_HDR and CPL_RX_ISCSI_DDP.

Supporting this requires changing the CPL_ISCSI_DATA handler to
allocate a PDU structure if it is not preceded by a CPL_ISCSI_HDR as
well as support for the new CPL_RX_ISCSI_CMP.

Second, when using DDP for zero-copy receive, T6 will only issue a
CPL_RX_ISCSI_CMP after a burst of PDUs have been received (indicated
by the F flag in the BHS).  In this case, the CPL_RX_ISCSI_CMP can
reflect the completion of multiple PDUs and the BHS and TCP sequence
number included in the message are from the last PDU received in the
burst.  Notably, the message does not include any information about
earlier PDUs received as part of the burst.  Instead, the driver must
track the amount of data already received for a given transfer and use
this to compute the amount of data received in a burst.  In addition,
the iSCSI layer currently has no way to permit receiving a logical PDU
which spans multiple PDUs.  Instead, the driver presents each burst as
a single, "large" PDU to the iSCSI target and initiators.  This is
done by rewriting the buffer offset and data length fields in the BHS
of the final PDU as well as rewriting the DataSN so that the received
PDUs appear to be in order.

To track all this, cxgbei maintains a hash table of 'cxgbei_cmp'
structures indexed by transfer tags for each offloaded iSCSI
connection.  When a SCSI_DATA_IN message is received, the ITT from the
received BHS is used to find the necessary state in the hash table,
whereas SCSI_DATA_OUT replies use the TTT as the key.  The structure
tracks the expected starting offset and DataSN of the next burst as
well as the rewritten DataSN value used for the previously received
PDU.

Discussed with:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D30458
2021-05-28 16:45:29 -07:00
..
amd64 x86: initialize initial FPU state earlier 2021-05-28 21:38:32 +03:00
arm arm: RPI-B: Add ext_resources driver 2021-05-24 12:53:00 +02:00
arm64 linux: make linux64.ko loadable again on aarch64 2021-05-28 14:20:30 +00:00
bsm Add aio_writev and aio_readv 2021-01-02 19:57:58 -07:00
cam cam_sim: style: sort includes 2021-05-25 09:56:56 -06:00
cddl fbt: Remove some handling for multiple CTF containers 2021-04-02 17:49:13 -04:00
compat linux: add new syscall numbers 2021-05-28 09:02:16 +01:00
conf Assume OCF is the only KTLS software backend. 2021-05-25 16:59:19 -07:00
contrib ipfilter: Fix ip_nat memory leak and use-after-free 2021-05-25 11:58:14 -07:00
crypto ossl: Use crypto_cursor_segment(). 2021-05-25 16:59:19 -07:00
ddb fix style nit: space after if 2021-05-05 15:26:09 -06:00
dev cxgbei: Support iSCSI offload on T6. 2021-05-28 16:45:29 -07:00
dts arm64: rockchip: Add some DTSO to disable sd/mmc 2021-05-13 18:15:31 +02:00
fs nfscl: Use hash lists to improve expected search performance for opens 2021-05-27 19:08:36 -07:00
gdb gdb: report specific stop reason for watchpoints 2021-03-30 11:36:41 -03:00
geom gmultipath: make physpath distinct from the underlying providers' 2021-05-06 12:32:27 -06:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 x86: initialize initial FPU state earlier 2021-05-28 21:38:32 +03:00
isa Remove more remnants of sio(4) 2021-04-07 14:33:02 -04:00
kern ktrace: Fix a race with fork() 2021-05-27 15:52:20 -04:00
kgssapi opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
libkern Use '.arch_extension crc' in the arm64 crc32 code 2021-05-06 07:42:35 +00:00
mips [mips/broadcom] set sysctl "hw.model" by SoC ChipCommon ID 2021-05-28 23:35:37 +03:00
modules Assume OCF is the only KTLS software backend. 2021-05-25 16:59:19 -07:00
net pf: Track the original kif for floating states 2021-05-20 12:49:27 +02:00
net80211 net80211: prefix get_random_bytes() with net80211_ 2021-03-24 22:16:09 +00:00
netgraph Fix a use-after-free in an error case. 2021-05-26 18:23:33 +09:00
netinet tcp: When we have an out-of-order FIN we do want to strip off the FIN bit. 2021-05-27 10:50:32 -04:00
netinet6 Fix mbuf leaks in various pru_send implementations 2021-05-12 13:00:09 -04:00
netipsec Add missing sockaddr length and family validation to various protocols 2021-05-03 13:35:19 -04:00
netpfil pf: Move nvlist conversion functions to pf_nv 2021-05-26 13:18:47 +02:00
netsmb netsmb: Avoid a read-after-free in smb_t2_request_int() 2021-05-26 10:45:40 -04:00
nfs Fix panic when using BOOTP to resolve root path. 2021-03-28 14:02:40 -05:00
nfsclient nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nfsserver nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed OFED: migrate LinuxKPI net_device/ifnet macros into ofed 2021-05-27 12:26:01 +00:00
opencrypto cryptosoft: Use crypto_cursor_segment(). 2021-05-25 16:59:19 -07:00
powerpc cam: clear on-stack CCBs in last few drivers 2021-05-21 08:53:59 +01:00
riscv arm64, riscv: remove reference to fsu_intr_fault 2021-05-25 12:26:52 -03:00
rpc rpcsec_gss: Use a designated initializer for rpc_gss_ops 2021-05-26 10:45:40 -04:00
security tcp_input/syncache: acquire only read lock on PCB for SYN,!ACK packets 2021-04-12 08:25:31 -07:00
sys hwpmc: Move 4 bits of mode to extend class size to 8 2021-05-26 18:40:58 +00:00
teken loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
tests Revise FIB lookups per second benchmarking routines. 2021-05-05 12:28:17 +02:00
tools makesyscalls.lua: improve generated file style(9) compliance 2021-05-13 13:59:25 -04:00
ufs Move mnt_maxsymlinklen into appropriate fs mount data structures 2021-05-22 15:16:09 +03:00
vm vm: add another pager private flag 2021-05-15 20:47:29 +00:00
x86 x86/xen: further PVHv1 removal cleanup 2021-05-18 10:43:31 +02:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen x86/xen: remove PVHv1 code 2021-05-17 11:41:21 +02:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00