Skip to contentSkip to conversation

cxgb3i - accelerating open-iscsi initiator

PATCH In review Karen Xie 2 participants 2 messages Dec 9, 2008 – Dec 12, 2008

Subsystems (2)
lore
Share & tools
lore

Karen Xie

author
#0 lore raw

PATCH v2 2/2 cxgb3i - accelerating open-iscsi initiator

[PATCH v2 2/2 2.6.29] cxgb3i - accelerating open-iscsi initiator

From: Karen Xie <[email protected]>

Add cxgb3i iSCSI driver.

This patch implements the cxgb3i iscsi connection acceleration for the open-iscsi initiator.

The cxgb3i driver offers the iscsi PDU based offload:
- digest insertion and verification
- payload direct-placement into host memory buffer.

---

 Documentation/scsi/cxgb3i.txt        |   85 ++
 drivers/scsi/Kconfig                 |    2 
 drivers/scsi/Makefile                |    1 
 drivers/scsi/cxgb3i/Kbuild           |    4 
 drivers/scsi/cxgb3i/Kconfig          |    6 
 drivers/scsi/cxgb3i/cxgb3i.h         |  139 +++
 drivers/scsi/cxgb3i/cxgb3i_ddp.c     |  770 ++++++++++++++
 drivers/scsi/cxgb3i/cxgb3i_ddp.h     |  306 ++++++
 drivers/scsi/cxgb3i/cxgb3i_init.c    |  107 ++
 drivers/scsi/cxgb3i/cxgb3i_iscsi.c   |  951 ++++++++++++++++++
 drivers/scsi/cxgb3i/cxgb3i_offload.c | 1810 ++++++++++++++++++++++++++++++++++
 drivers/scsi/cxgb3i/cxgb3i_offload.h |  231 ++++
 drivers/scsi/cxgb3i/cxgb3i_pdu.c     |  402 ++++++++
 drivers/scsi/cxgb3i/cxgb3i_pdu.h     |   59 +
 14 files changed, 4873 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/scsi/cxgb3i.txt
 create mode 100644 drivers/scsi/cxgb3i/Kbuild
 create mode 100644 drivers/scsi/cxgb3i/Kconfig
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i.h
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_ddp.c
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_ddp.h
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_init.c
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_iscsi.c
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_offload.c
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_offload.h
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_pdu.c
 create mode 100644 drivers/scsi/cxgb3i/cxgb3i_pdu.h
Documentation/scsi/cxgb3i.txt new file +85 -0
new file mode 100644
index 0000000..8141fa0
@@ -0,0 +1,85 @@
+Chelsio S3 iSCSI Driver for Linux
+
+Introduction
+============
+
+The Chelsio T3 ASIC based Adapters (S310, S320, S302, S304, Mezz cards, etc.
+series of products) supports iSCSI acceleration and iSCSI Direct Data Placement
+(DDP) where the hardware handles the expensive byte touching operations, such
+as CRC computation and verification, and direct DMA to the final host memory
+destination:
+
+	- iSCSI PDU digest generation and verification
+
+	  On transmitting, Chelsio S3 h/w computes and inserts the Header and
+	  Data digest into the PDUs.
+	  On receiving, Chelsio S3 h/w computes and verifies the Header and
+	  Data digest of the PDUs.
+
+	- Direct Data Placement (DDP)
+
+	  S3 h/w can directly place the iSCSI Data-In or Data-Out PDU's
+	  payload into pre-posted final destination host-memory buffers based
+	  on the Initiator Task Tag (ITT) in Data-In or Target Task Tag (TTT)
+	  in Data-Out PDUs.
+
+	- PDU Transmit and Recovery
+
+	  On transmitting, S3 h/w accepts the complete PDU (header + data)
+	  from the host driver, computes and inserts the digests, decomposes
+	  the PDU into multiple TCP segments if necessary, and transmit all
+	  the TCP segments onto the wire. It handles TCP retransmission if
+	  needed.
+
+	  On receving, S3 h/w recovers the iSCSI PDU by reassembling TCP
+	  segments, separating the header and data, calculating and verifying
+	  the digests, then forwards the header to the host. The payload data,
+	  if possible, will be directly placed into the pre-posted host DDP
+	  buffer. Otherwise, the payload data will be sent to the host too.
+
+The cxgb3i driver interfaces with open-iscsi initiator and provides the iSCSI
+acceleration through Chelsio hardware wherever applicable.
+
+Using the cxgb3i Driver
+=======================
+
+The following steps need to be taken to accelerates the open-iscsi initiator:
+
+1. Load the cxgb3i driver: "modprobe cxgb3i"
+
+   The cxgb3i module registers a new transport class "cxgb3i" with open-iscsi.
+
+   * in the case of recompiling the kernel, the cxgb3i selection is located at
+	Device Drivers
+		SCSI device support --->
+			[*] SCSI low-level drivers  --->
+				<M>   Chelsio S3xx iSCSI support
+
+2. Create an interface file located under /etc/iscsi/ifaces/ for the new
+   transport class "cxgb3i".
+
+   The content of the file should be in the following format:
+	iface.transport_name = cxgb3i
+	iface.net_ifacename = <ethX>
+	iface.ipaddress = <iscsi ip address>
+
+   * if iface.ipaddress is specified, <iscsi ip address> needs to be either the
+	same as the ethX's ip address or an address on the same subnet. Make
+	sure the ip address is unique in the network.
+
+3. edit /etc/iscsi/iscsid.conf
+   The default setting for MaxRecvDataSegmentLength (131072) is too big,
+   replace "node.conn[0].iscsi.MaxRecvDataSegmentLength" to be a value no
+   bigger than 15360 (for example 8192):
+
+	node.conn[0].iscsi.MaxRecvDataSegmentLength = 8192
+
+   * The login would fail for a normal session if MaxRecvDataSegmentLength is
+	too big.  A error message in the format of
+	"cxgb3i: ERR! MaxRecvSegmentLength <X> too big. Need to be <= <Y>."
+	would be logged to dmesg.
+
+4. To direct open-iscsi traffic to go through cxgb3i's accelerated path,
+   "-I <iface file name>" option needs to be specified with most of the
+   iscsiadm command. <iface file name> is the transport interface file created
+   in step 2.
drivers/scsi/Kconfig +2 -0
index 403ecad..c91e840 100644
@@ -352,6 +352,8 @@ config ISCSI_TCP
 
 	 http://open-iscsi.org
 
+source "drivers/scsi/cxgb3i/Kconfig"
+
 config SGIWD93_SCSI
 	tristate "SGI WD93C93 SCSI Driver"
 	depends on SGI_HAS_WD93 && SCSI
drivers/scsi/Makefile +1 -0
index b89aedf..3ef7664 100644
@@ -124,6 +124,7 @@ obj-$(CONFIG_SCSI_HPTIOP)	+= hptiop.o
 obj-$(CONFIG_SCSI_STEX)		+= stex.o
 obj-$(CONFIG_SCSI_MVSAS)	+= mvsas.o
 obj-$(CONFIG_PS3_ROM)		+= ps3rom.o
+obj-$(CONFIG_SCSI_CXGB3_ISCSI)	+= libiscsi.o libiscsi_tcp.o cxgb3i/
 
 obj-$(CONFIG_ARM)		+= arm/
 
drivers/scsi/cxgb3i/Kbuild new file +4 -0
new file mode 100644
index 0000000..ee7d6d2
@@ -0,0 +1,4 @@
+EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3
+
+cxgb3i-y := cxgb3i_init.o cxgb3i_iscsi.o cxgb3i_pdu.o cxgb3i_offload.o
+obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i_ddp.o cxgb3i.o
drivers/scsi/cxgb3i/Kconfig new file +6 -0
new file mode 100644
index 0000000..2762814
@@ -0,0 +1,6 @@
+config SCSI_CXGB3_ISCSI
+	tristate "Chelsio S3xx iSCSI support"
+	select CHELSIO_T3
+	select SCSI_ISCSI_ATTRS
+	---help---
+	This driver supports iSCSI offload for the Chelsio S3 series devices.
drivers/scsi/cxgb3i/cxgb3i.h new file +139 -0

139 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_ddp.c new file +770 -0

770 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_ddp.h new file +306 -0

306 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_init.c new file +107 -0

107 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_iscsi.c new file +951 -0

951 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_offload.c new file +1810 -0

617 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_offload.h new file +231 -0

231 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_pdu.c new file +402 -0

402 lines not on this page · raw message

drivers/scsi/cxgb3i/cxgb3i_pdu.h new file +59 -0

59 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

Acked-by on v2 2/2
#1 lore raw
Quoted 6 lines · Karen Xie

[PATCH v2 2/2 2.6.29] cxgb3i - accelerating open-iscsi initiator

From: Karen Xie <[email protected]>

Add cxgb3i iSCSI driver.

Quoted 8 lines

This patch implements the cxgb3i iscsi connection acceleration for the open-iscsi initiator.

The cxgb3i driver offers the iscsi PDU based offload:
- digest insertion and verification
- payload direct-placement into host memory buffer.

Thanks for fixing up those network macro/function usage issues on the resend.