opnsense-src/sys/dev/cxgbe
John Baldwin cc44e4e55b 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

(cherry picked from commit 67360f7bb0)
2021-10-29 16:07:26 -07:00
..
common cxgbe(4): Display HMA information in meminfo. 2021-10-20 10:48:22 -07:00
crypto cryptosoft: Fix support for variable tag lengths in AES-CCM. 2021-10-21 14:19:04 -07:00
cudbg Fix some common typos in source code comments 2021-08-31 08:13:15 +02:00
cxgbei cxgbei: Support iSCSI offload on T6. 2021-10-29 16:07:26 -07:00
firmware cxgbe(4): Update firmwares to 1.26.2.0. 2021-10-20 10:36:34 -07:00
iw_cxgbe cxgbe/iw_cxgbe: Support for 512 SGL entries in one memory registration. 2021-10-20 10:32:18 -07:00
tom cxgbei: Support DDP for target I/O S/G lists with more than one entry. 2021-10-29 15:53:37 -07:00
adapter.h cxgbe: Make the TOE ISCSI RX stats per-queue instead of per adapter. 2021-10-29 15:24:27 -07:00
if_cc.c cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will 2016-09-16 00:08:37 +00:00
if_ccv.c cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will 2016-09-16 00:08:37 +00:00
if_cxl.c cxgbe(4): Add a minimal if_cxl module that pulls in the real driver as 2015-02-06 01:10:04 +00:00
if_cxlv.c Chelsio T4/T5 VF driver. 2016-09-07 18:13:57 +00:00
offload.h cxgbe: Add a struct sge_ofld_txq type. 2021-04-26 12:02:06 -07:00
osdep.h cxgbe(4): make the logging helpers a little more robust. 2021-05-15 20:26:22 -07:00
t4_clip.c cxgbe(4): Empty the clib_db before trying to destroy it. 2021-10-20 10:16:58 -07:00
t4_clip.h cxgbe(4): Overhaul CLIP (Compressed Local IPv6) table management. 2021-10-20 10:05:02 -07:00
t4_filter.c cxgbe(4): Add support for NIC suspend/resume and live reset. 2021-10-20 06:59:41 -07:00
t4_if.m Use the port device name for the iov device for Chelsio T4/T5 cards. 2016-08-03 17:11:08 +00:00
t4_ioctl.h cxgbe(4): Overhaul CLIP (Compressed Local IPv6) table management. 2021-10-20 10:05:02 -07:00
t4_iov.c cxgbe(4): Allow the PF driver to set a VF's MAC address. 2020-11-09 00:08:35 +00:00
t4_l2t.c NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_l2t.h NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_main.c cxgbe: Make the TOE ISCSI RX stats per-queue instead of per adapter. 2021-10-29 15:24:27 -07:00
t4_mp_ring.c cxgbe(4): changes in the Tx path to help increase tx coalescing. 2020-07-03 04:44:23 +00:00
t4_mp_ring.h cxgbe(4): changes in the Tx path to help increase tx coalescing. 2020-07-03 04:44:23 +00:00
t4_netmap.c cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-10-20 06:55:38 -07:00
t4_sched.c cxgbe(4): Do not configure traffic classes automatically on attach. 2021-10-20 10:35:14 -07:00
t4_sge.c cxgbe: Make the TOE ISCSI RX stats per-queue instead of per adapter. 2021-10-29 15:24:27 -07:00
t4_smt.c cxgbe(4): Move all control queues to the adapter. 2018-08-11 21:10:08 +00:00
t4_smt.h cxgbe(4): Retire an old check. 2018-06-01 01:05:34 +00:00
t4_tracer.c cxgbe(4): Add support for NIC suspend/resume and live reset. 2021-10-20 06:59:41 -07:00
t4_vf.c cxgbe(4): Break up t4_read_chip_settings. 2021-05-15 19:45:16 -07:00