1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun 3*4882a593Smuzhiyun================================= 4*4882a593SmuzhiyunChelsio S3 iSCSI Driver for Linux 5*4882a593Smuzhiyun================================= 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunIntroduction 8*4882a593Smuzhiyun============ 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunThe Chelsio T3 ASIC based Adapters (S310, S320, S302, S304, Mezz cards, etc. 11*4882a593Smuzhiyunseries of products) support iSCSI acceleration and iSCSI Direct Data Placement 12*4882a593Smuzhiyun(DDP) where the hardware handles the expensive byte touching operations, such 13*4882a593Smuzhiyunas CRC computation and verification, and direct DMA to the final host memory 14*4882a593Smuzhiyundestination: 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun - iSCSI PDU digest generation and verification 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun On transmitting, Chelsio S3 h/w computes and inserts the Header and 19*4882a593Smuzhiyun Data digest into the PDUs. 20*4882a593Smuzhiyun On receiving, Chelsio S3 h/w computes and verifies the Header and 21*4882a593Smuzhiyun Data digest of the PDUs. 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun - Direct Data Placement (DDP) 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun S3 h/w can directly place the iSCSI Data-In or Data-Out PDU's 26*4882a593Smuzhiyun payload into pre-posted final destination host-memory buffers based 27*4882a593Smuzhiyun on the Initiator Task Tag (ITT) in Data-In or Target Task Tag (TTT) 28*4882a593Smuzhiyun in Data-Out PDUs. 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun - PDU Transmit and Recovery 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun On transmitting, S3 h/w accepts the complete PDU (header + data) 33*4882a593Smuzhiyun from the host driver, computes and inserts the digests, decomposes 34*4882a593Smuzhiyun the PDU into multiple TCP segments if necessary, and transmit all 35*4882a593Smuzhiyun the TCP segments onto the wire. It handles TCP retransmission if 36*4882a593Smuzhiyun needed. 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun On receiving, S3 h/w recovers the iSCSI PDU by reassembling TCP 39*4882a593Smuzhiyun segments, separating the header and data, calculating and verifying 40*4882a593Smuzhiyun the digests, then forwarding the header to the host. The payload data, 41*4882a593Smuzhiyun if possible, will be directly placed into the pre-posted host DDP 42*4882a593Smuzhiyun buffer. Otherwise, the payload data will be sent to the host too. 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunThe cxgb3i driver interfaces with open-iscsi initiator and provides the iSCSI 45*4882a593Smuzhiyunacceleration through Chelsio hardware wherever applicable. 46*4882a593Smuzhiyun 47*4882a593SmuzhiyunUsing the cxgb3i Driver 48*4882a593Smuzhiyun======================= 49*4882a593Smuzhiyun 50*4882a593SmuzhiyunThe following steps need to be taken to accelerates the open-iscsi initiator: 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun1. Load the cxgb3i driver: "modprobe cxgb3i" 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun The cxgb3i module registers a new transport class "cxgb3i" with open-iscsi. 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun * in the case of recompiling the kernel, the cxgb3i selection is located at:: 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun Device Drivers 59*4882a593Smuzhiyun SCSI device support ---> 60*4882a593Smuzhiyun [*] SCSI low-level drivers ---> 61*4882a593Smuzhiyun <M> Chelsio S3xx iSCSI support 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun2. Create an interface file located under /etc/iscsi/ifaces/ for the new 64*4882a593Smuzhiyun transport class "cxgb3i". 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun The content of the file should be in the following format:: 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun iface.transport_name = cxgb3i 69*4882a593Smuzhiyun iface.net_ifacename = <ethX> 70*4882a593Smuzhiyun iface.ipaddress = <iscsi ip address> 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun * if iface.ipaddress is specified, <iscsi ip address> needs to be either the 73*4882a593Smuzhiyun same as the ethX's ip address or an address on the same subnet. Make 74*4882a593Smuzhiyun sure the ip address is unique in the network. 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun3. edit /etc/iscsi/iscsid.conf 77*4882a593Smuzhiyun The default setting for MaxRecvDataSegmentLength (131072) is too big; 78*4882a593Smuzhiyun replace with a value no bigger than 15360 (for example 8192):: 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun node.conn[0].iscsi.MaxRecvDataSegmentLength = 8192 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun * The login would fail for a normal session if MaxRecvDataSegmentLength is 83*4882a593Smuzhiyun too big. A error message in the format of 84*4882a593Smuzhiyun "cxgb3i: ERR! MaxRecvSegmentLength <X> too big. Need to be <= <Y>." 85*4882a593Smuzhiyun would be logged to dmesg. 86*4882a593Smuzhiyun 87*4882a593Smuzhiyun4. To direct open-iscsi traffic to go through cxgb3i's accelerated path, 88*4882a593Smuzhiyun "-I <iface file name>" option needs to be specified with most of the 89*4882a593Smuzhiyun iscsiadm command. <iface file name> is the transport interface file created 90*4882a593Smuzhiyun in step 2. 91