[PATCH 1/2] userspace - add new transport cxgb3i

From: Karen Xie <[EMAIL PROTECTED]>

added new transport cxgb3i.

This patch is based on the master branch of the git tree.

Signed-off-by: Karen Xie <[EMAIL PROTECTED]>
---

 doc/iscsiadm.8        |    7 +++----
 etc/iface.example     |    9 +++++++++
 usr/transport.c       |    8 ++++++++
 utils/iscsi_discovery |   17 +++++++++++++----
 4 files changed, 33 insertions(+), 8 deletions(-)


diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index b488ad5..9a26dc6 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -63,10 +63,9 @@ specific hardware resource and instead allow the network or 
infinniband layer
 to decide what to do. There is no need to create a iface config with the 
default
 behavior. If you do not specify a iface, then the default behavior is used.
 
-As mentioned above there is a special iface name default. There are two others
-bnx2i and iser, which does not bind the session to a specific card, but
-will bind the session to either the bnx2i or iser transport. These are
-experimental and the use is not supported as a stable interface yet.
+As mentioned above there is a special iface name default. There are three 
+others -- cxgb3i, bnx2i and iser, which does not bind the session to a 
specific card, but will bind the session to the cxgb3i, bnx2i or iser 
transport. These
+are experimental and the use is not supported as a stable interface yet.
 
 In discovery mode multiple interfaces can be specific by passing in multiple
 -I/--interface instances. For example, 
diff --git a/etc/iface.example b/etc/iface.example
index 7fb7951..82cf21b 100644
--- a/etc/iface.example
+++ b/etc/iface.example
@@ -20,6 +20,7 @@
 # - iser (Software iSCSI over infinniband
 # - qla4xxx (Qlogic QLA4XXX HBAs)
 # - bnx2i (Broadcom bnx iSCSI HBAs);
+# - cxgb3i (Chelsio cxgb S3 iSCSI HBAs);
 #
 #OPTIONAL: iface.initiatorname
 # To use a initiator name other than the one set in
@@ -51,3 +52,11 @@
 
 # Note you can only bind using one value. If you set multiple values
 # the bahavior is not defined.
+
+# For some transport (cxgb3i), a user could to set the private ip address for 
+# the iscsi traffic for an network interface:
+# example:
+#  - set iscsi ip on eth0 to be 102.50.50.101, eth0 needs to be up and be on
+#    the same subnet.
+# iface.net_ifacename = eth0
+# iface.ipaddress = 102.50.50.101
diff --git a/usr/transport.c b/usr/transport.c
index c2edbcc..07b61db 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -41,6 +41,13 @@ struct iscsi_transport_template iscsi_iser = {
        .ep_disconnect  = ktransport_ep_disconnect,
 };
 
+struct iscsi_transport_template cxgb3i = {
+       .name           = "cxgb3i",
+       .ep_connect     = ktransport_ep_connect,
+       .ep_poll        = ktransport_ep_poll,
+       .ep_disconnect  = ktransport_ep_disconnect,
+};
+
 struct iscsi_transport_template bnx2i = {
        .name           = "bnx2i",
        .ep_connect     = ktransport_ep_connect,
@@ -55,6 +62,7 @@ struct iscsi_transport_template qla4xxx = {
 static struct iscsi_transport_template *iscsi_transport_templates[] = {
        &iscsi_tcp,
        &iscsi_iser,
+       &cxgb3i,
        &bnx2i,
        &qla4xxx,
        NULL
diff --git a/utils/iscsi_discovery b/utils/iscsi_discovery
index 9f1e7cf..6f259f6 100755
--- a/utils/iscsi_discovery
+++ b/utils/iscsi_discovery
@@ -147,12 +147,21 @@ try_login()
 set_transport()
 {
        transport=$1
-       if [ "$transport" == "iser" ];then
+       case "$transport" in
+       iser)
+               # iSER does not use digest
                iscsiadm -m node --targetname ${target} --portal ${portal} \
-                               --op update -n node.conn[0].iscsi.HeaderDigest 
-v None
+                       --op update -n node.conn[0].iscsi.HeaderDigest -v None
                iscsiadm -m node --targetname ${target} --portal ${portal} \
-                               --op update -n node.conn[0].iscsi.DataDigest -v 
None
-       fi
+                       --op update -n node.conn[0].iscsi.DataDigest -v None
+               ;;
+       cxgb3i)
+               # cxgb3i supports <= 16K packet (BHS + AHS + pdu payload + 
digests) 
+               iscsiadm -m node --targetname ${target} --portal ${portal} \
+                       --op update -n 
node.conn[0].iscsi.MaxRecvDataSegmentLength \
+                       -v 8192
+               ;;
+       esac
        transport_name=`iscsiadm  -m node -p ${portal} -T ${target} |awk 
'/transport_name/ {print $1}'`
        iscsiadm -m node --targetname ${target} --portal ${portal} \
                        --op update -n ${transport_name} -v ${transport}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to