summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* iscsiadm: Add support to set CHAP entry using host chap modeAdheer Chandravanshi2013-12-221-1/+18
| | | | | | | | | | Provide support to add and update CHAP entry using chap submode of iscsiadm host mode. Both, new and update, iscsiadm operations perform the same function. Currently only one entry can be added or updated at a time. Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
* [PATCH v5 1/3] ISCSISTART: Saved ibft boot info to the sessionMike Christie2013-09-112-0/+4
| | | | | | | | | | | | | | | Patch and description from Eddie Wai: Three new session sysfs parameters are introduced: boot_root - holds the ibft boot root folder name boot_nic - holds the ibft boot ethernetN name boot_target - holds the ibft boot targetN name This patch copies over the /sys/firmware/<boot_root>/ethernetN/targetN info from the boot context to the node_rec. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
* iscsi tools: sync iscsi_if.h with kernel spaceMike Christie2013-09-111-131/+73
| | | | | | | | | | | This patches syncs iscsi_if.h with upstream commit commit ae542edb11c79706cd74d7bd54ebd7702965a7f3 Author: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com> Date: Mon Jul 1 05:54:11 2013 -0400 [SCSI] scsi_transport_iscsi: Exporting new attrs for iscsi session and conne
* Fix discovery error return without return valueLee Duncan2013-06-261-0/+2
| | | | | | | | openSUSE Build Service compiler noticed that one discovery error path did not have a return value, so an appropriate error is now being returned. Signed-of-by: Lee Duncan <lduncan@suse.com>
* From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>Mike Christie2013-05-281-1/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This support lets the user manage the target entries in adapter flash and perform various operations like add, delete, login, logout, and update the target information. The sysfs entries will look as cited below: /sys/bus/iscsi_flashnode/devices/flashnode_sess-<host_no>:<flashnode_id>/<session attrs> /sys/bus/iscsi_flashnode/devices/flashnode_conn-<host_no>:<flashnode_id>:<conn_id>/<conn attrs> Operations using iscsiadm: ========================= List all target nodes stored in the FLASH of the adapter \# iscsiadm -m host -H hostno -C flashnode -o show View all parameters of one particular flash node \# iscsiadm -m host -H hostno -C flashnode -x <flashnode_idx> -o show Update an entry and commit to adapter FLASH \# iscsiadm -m host -H hostno -C flashnode -x <flashnode_idx> -n <name> -v <value> -o update Multiple name, value pairs can be specified in a single command for update operation Delete an entry \# iscsiadm -m host -H hostno -C flashnode -x <flashnode_idx> -o delete Create a new entry \# iscsiadm -m host -H hostno -C flashnode -o new -A <ipv4/ipv6> \# iscsiadm -m host -H hostno -C flashnode -x <flashnode_idx> -n <name> -v <value> -o update Example, create new entry: \#iscsiadm -m host -H 7 -C flashnode -o new -A ipv4 Flashnode index: 2 New flashnode for host7 added \#iscsiadm -m host -H 7 -C flashnode -o show qla4xxx: [0] 192.168.1.12:3260,2 iqn.2002-03.com.compellent:5000d310004b0716 qla4xxx: [1] 192.168.1.12:3260,2 qla4xxx: [2] Here - The newly created entry is at flashnode_idx 2, use it to update the entry \# iscsiadm -m host -H 7 -C flashnode -x 2 -o update flashnode.conn[0].ipaddress -v 192.168.1.13 \#iscsiadm -m host -H 7 -C flashnode -o show qla4xxx: [0] 192.168.1.12:3260,2 iqn.2002-03.com.compellent:5000d310004b0716 qla4xxx: [1] 192.168.1.12:3260,2 qla4xxx: [2] 192.168.1.13:3260,0 Login \# iscsiadm -m host -H hostno -C flashnode -x <flashnode_idx> -o login Logout \# iscsiadm -m host -H hostno -C flashnode -x <flashnode_idx> -o logout \# iscsiadm -m session -r sid -u Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com> Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
* ISCSID: Added socket communication hooks for uipMike Christie2013-05-281-0/+2
| | | | | | | | | | | | | From Eddie Wai: This patch adds the communication path between iscsid->iscsiuio. It utilizes the set_net_config func ptr in the iscsi_transport_template to initiate the callbacks. Two new files are introduced: uip_mgmt_ipc.h and uip_mgmt_ipc.c Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
* iscsi tools: have iscsi tools bring up offload net ifaceMike Christie2012-03-221-0/+1
| | | | | | | bnx2i and cxgb*i need the network interface that the offload engine attaches to brought up before we can connect. This patch has the iscsi tools do this before trying to create a tcp/ip connection.
* iscsiadm: print ping status stringMike Christie2012-03-061-1/+16
| | | | When a ping fails print more useful info.
* iscsi tools: Add support to display a host's CHAP list and deleteMike Christie2012-03-062-1/+33
| | | | | | | | | | | | Drivers like qla4xxx store the CHAP info in a table that is managed at the host level. This patch allows you to see and delete the CHAP entries on the host. Patch from: Nilesh Javali <nilesh.javali@qlogic.com> [lots of bug fixes by Mike Christie] Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
* iscsi tools: added ping supportMike Christie2012-03-062-2/+21
| | | | | | | | | From: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Added ping support for network connection diagnostics. [cleaned up output by Mike Christie] Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
* iscsi tools: update iscsi_if.h for host eventMike Christie2012-03-061-1/+14
| | | | | | | Patch from: Vikas Chaudhary <vikas.chaudhary@qlogic.com> [added code to print link up/down message by Mike Christie] Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
* iscsi tools: fix ipv6 ibft/firmware bootMike Christie2011-10-121-7/+8
| | | | | | | The address buffers are too short for many ipv6 addresses and if ibft/firmware gives us a hostname. As a result iscsistart and iscsiadm were printing/getting a truncated address which would cause login and network startup to fail.
* iscsi tools: fix up vlan supportMike Christie2011-10-061-4/+5
| | | | | | | | | | | This syncs userspace up with what has been sent to linux-scsi by fixing: 1. link_local_autocfg sysfs file naming. 2. init vlan, port and mtu sysfs handling so that they are initialized to 0 on failure to read them. 3. Change ISCSI_NET_PARAM_VLAN_ID to ISCSI_NET_PARAM_VLAN_TAG because we are setting the tag and not just the id.
* iscsi tools: manage qla4xxx iscsi sessions with iscsiadmLalit Chandivade2011-08-141-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is based on initial work done by Mike Christie here, http://groups.google.com/group/open-iscsi/browse_thread/thread/193fe9037f3127da# This patch modifies iscsiadm so it can control sessions that are accessed through qla4xxx. To do discovery using the qla4xxx iscsi class interface first check the available qla4xxx iface ./iscsiadm -m iface -P 0 will display the different ifaces like this: qla4xxx.00:0e:1e:04:87:fa qla4xxx,00:0e:1e:04:87:fa,192.168.1.112,\ <empty>,<empty> qla4xxx.00:0e:1e:04:87:fe qla4xxx,00:0e:1e:04:87:fe,<empty>,<empty>,<empty> Issue discovery command ./iscsiadm -m discovery -t sendtargets -I qla4xxx.00:0e:1e:04:87:fa \ -p 192.168.1.10:3260 192.168.1.10:3260,1 iqn.2001-05.com.target:0-7d76ca2b7d54b541-disk2 192.168.1.10:3260,1 iqn.2001-05.com.target:0-46f6ca2b7d84b541-disk3 192.168.1.10:3260,1 iqn.2001-05.com.target:0-4c76ca2b7db4b541-disk4 192.168.1.10:3260,1 iqn.2001-05.com.target:0-7346ca2b6d04b6bb-disk1 To view discovered nodes do ./iscsiadm -m node To login ./iscsiadm -m node -T iqn.2001-05.com.target:0-7346ca2b6d04b6bb-disk1 \ -I qla4xxx.00:0e:1e:04:87:fa -p 192.168.1.10:3260 -l An error or ok message is displayed to indicate login failure or success. To see the sessions use ./iscsiadm -m session And then to logout do ./iscsiadm -m node -T iqn.2001-05.com.target:0-7346ca2b6d04b6bb-disk1 \ -I qla4xxx.00:0e:1e:04:87:fa -p 192.168.1.10:3260 -u An error or a ok message is displayed to indicate logout failure or success. Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com> Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* iscsiadm: add netconfig supportLalit Chandivade2011-08-141-3/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Current status: Using iscsiadm one cannot do any network configuration for qla4xxx adapters. However an iface is created for the qla4xxx ports using the hwaddress. \# ls /etc/iscsi/ifaces/ iface.example iface0 qla4xxx.00:0e:1e:04:8b:2a qla4xxx.00:0e:1e:04:8b:2e This allows user to issue sendtargets via the qla4xxx iscsi offload. 2. Current Proposal: Current proposal is to allow iscsiadm to configure the network settings for qla4xxx ports. This implementation is based on discussions at - http://marc.info/?l=linux-scsi&m=127066184916180&w=2 - http://groups.google.com/group/open-iscsi/browse_thread/thread/d8e8c2df71c95d69/8f731d95d46141a0?lnk=gst&q=iscsi+hba# 2.1 Changes in iscsiadm/iscsid 2.1.1 Add a new event: ISCSI_UEVENT_SET_IFACE_PARAMS 2.1.2 New structure/enum to represent a single network parameter - enum iscsi_net_param; - struct iscsi_iface_param_info; 2.1.3 Added new parameters in iface 2.1.4 Change in operations Add two new operations to iscsiadm apply: Apply the single iface settings applyall: Apply the iface settings of all iface having the same MAC address 2.2 Changes in sysfs network representation The new sysfs directory would look like this:- /sys/class/iscsi_iface/-| _______________________| | |- ipv4-iface-<host_no>-<iface_no>/ <-- for ipv4 |- bootproto |- enabled |- ipaddress |- subnet |- gateway |- mtu |- port |- vlan |- vlan_enabled |- vlan_priority |- ipv6-iface-<host_no>-<iface_no>/ <-- for ipv6 |- enabled |- ipaddr_autocfg |- ipaddress |- link_local_addr |- linklocal_autocfg |- mtu |- port |- router_addr |- vlan |- vlan_enabled |- vlan_priority 3. Flow: 3.1 User space code: - If user specify --op=update, then just update the iface config file - If use specify --op=applyall then ifaces for the host passed in. and build up the net config buffer. - Note: If --op is "apply" then only settings for single iface is read, the iface provided with -I option is only read. - The net config buffer will look like this. ----------------------------------------------------------------| | iscsi_net_param { | | iface_num = 0; | | len = 4; | | param = ISCSI_NET_PARAM_IPV4_ADDR; | | iface_type = ISCSI_IFACE_TYPE_IPV4; | | param_type = ISCSI_NET_PARAM; | | value[0] = ipaddress[0]; | | value[1] = ipaddress[1]; | | value[2] = ipaddress[2]; | | value[3] = ipaddress[3]; | | } | ----------------------------------------------------------------| | iscsi_net_param { | | iface_num = 0; | | len = 4; | | param = ISCSI_NET_PARAM_IPV4_GW; | | iface_type = ISCSI_IFACE_TYPE_IPV4; | | param_type = ISCSI_NET_PARAM; | | value[0] = ipgateway[0]; | | value[1] = ipgateway[1]; | | value[2] = ipgateway[2]; | | value[3] = ipgateway[3]; | | } | ----------------------------------------------------------------- | | | iscsi_net_param { | | iface_num = 1; | | len = 4; | | param = ISCSI_NET_PARAM_IPV4_ADDR; | | iface_type = ISCSI_IFACE_TYPE_IPV4; | | param_type = ISCSI_NET_PARAM; | | value[0] = ipaddress[0]; | | value[1] = ipaddress[1]; | | value[2] = ipaddress[2]; | | value[3] = ipaddress[3]; | | } | ----------------------------------------------------------------- ----------------------------------------------------------------- | iscsi_net_param { | | iface_num = 0; | | len = 4; | | param = ISCSI_NET_PARAM_IPV4_GW; | | iface_type = ISCSI_IFACE_TYPE_IPV4; | | param_type = ISCSI_NET_PARAM; | | value[0] = ipgateway[0]; | | value[1] = ipgateway[1]; | | value[2] = ipgateway[2]; | | value[3] = ipgateway[3]; | | } | ----------------------------------------------------------------- | iscsi_net_param { | | iface_num = 1; | | len = 1; | | param = ISCSI_NET_PARAM_IFACE_ENABLED; | | iface_type = ISCSI_IFACE_TYPE_IPV4; | | param_type = ISCSI_NET_PARAM; | | offset = 0; | | value[0] = 0; /* 0 = disable, default = 1 = enable */ | | } | ----------------------------------------------------------------- Each netconfig parameter has different size requirement for value field. e.g.: IPv4 address requires 4 bytes, IPv6 address requires 16 bytes etc. The memory allocated for each netconfig parameter is size of iscsi_net_param + length required for that parameter. The multiple IO Vector mechanism is used to send netconfig parameter from user space to kernel using Netlink interface. IO Vector 0 is used for Netlink message header. IO Vector 1 is used for iSCSI User Event (ev). - The ev will be sent down with event type = ISCSI_UEVENT_SET_NET_CONFIG IO Vector 2 onwards, each vector consists of the struct iscsi_net_param with parameter name followed by its value. The total size will be addition of all the IO vector sizes. 3.2 Kernel space code: - Once event is received, the buffer will look like struct iscsi_net_param with parameter name followed by its value, then next parameter and its value and so on. - the scsi_transport_iscsi would call the adapter's transport->set_net_config - In set_net_config each individual param can be decoded and set into the hardware. 4. qla4xxx configuration: iscsid, creates the iface for qla4xxx, based on the hwaddress. To display the iface related to qla4xxx execute following \# iscsiadm -m iface qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty> qla4xxx.00:0e:1e:04:8b:2e.ipv6 qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<e mpty> qla4xxx.00:0e:1e:04:8b:2a qla4xxx,00:0e:1e:04:8b:2a,20.15.0.66,<empty>,<emp ty> qla4xxx.00:0e:1e:04:8b:2a.ipv6 qla4xxx,00:0e:1e:04:8b:2a,2001:DB8:1111:2222::8888,<empty>,<empty> qla4xxx.00:0e:1e:04:8b:2a.ipv6.1 qla4xxx,00:0e:1e:04:8b:2a,2001:DB8:4444:5555::9999,<empty>,<empty> To setup network configuration there can be two methods 4. 1. User can manually modify the iface file, and issue an "apply" command. --------------------------------------------------------------------------- \#cat /etc/iscsi/ifaces/ iface.example iface0 qla4xxx.00:0e:1e:04:8b:2a qla4xxx.00:0e:1e:04:8b:2e Example: \# cat qla4xxx.00:0e:1e:04:8b:2a iface.iscsi_ifacename = qla4xxx.00:0e:1e:04:8b:2a iface.transport_name = qla4xxx iface.hwaddress = 00:0e:1e:04:8b:2a iface.state = enable iface.iface_num = 0 (default) iface.bootproto = static iface.ipaddress = 192.168.2.2 (decimal) iface.subnetmask = 255.255.255.0 (decimal) \# vi qla4xxx.00:0e:1e:04:8b:2a.ipv6 (If file does not exist, the one can create it) iface.iscsi_ifacename = qla4xxx.00:0e:1e:04:8b:2a.ipv6 iface.transport_name = qla4xxx iface.hwaddress = 00:0e:1e:04:8b:2a iface.ipaddress = 1111:2222::7777:8888 (hex) iface.iface_num = 0 \# iscsiadm -m iface -H 00:0e:1e:04:8b:2a --op=applyall This will find the ifaces on the host with MAC address 00:0e:1e:04:8b:2a and apply the settings to the hardware.. Note, this will read all the iface belonging to the same MAC address. Note2, Instead of a MAC address the host number can be passed in. 4.2. User can use iscsiadm to specify the values and then apply -------------------------------------------------------------- \# ls /etc/iscsi/ifaces/ iface.example iface0 qla4xxx.00:0e:1e:04:8b:2a qla4xxx.00:0e:1e:04:8b:2e \# iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \ -n iface.ipaddress -v 192.168.1.2 \# iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \ -n iface.gateway -v 192.168.1.1 \# iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \ -n iface.subnet_mask -v 255.255.255.0 \# iscsiadm -m iface -H 00:0e:1e:04:8b:2a -o applyall Setting up multiple IP: First interface (default, no need to set iface_num, it is 0 by default) \# iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \ -n iface.ipaddress -v 192.168.1.2 Create the second one if it does not exist \# iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a.1 -op=new \# iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \ -n iface.iface_num -v 1 (Mandatory) \# iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \ -n iface.ipaddress -v 192.168.1.3 \# iscsiadm -m iface -H 00:0e:1e:04:8b:2a --op=applyall Note: If there are common settings for multiple interfaces then the settings from 0th iface would be considered valid. Note: To apply settings for a single iface, just say --op=apply Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com> [formatting fixes and addition of host param for applyall] Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
* iscsi tools: convert discovery code to iscsi error codesMike Christie2011-01-311-0/+4
| | | | | This just converts the iscsi discovery code to the iscsi_err.h error codes.
* iscsid: add new auth error codeMike Christie2011-01-311-0/+2
| | | | | | Add a new auth error code to make it easier for users to tell if it failed due to a auth error vs other target login error.
* iscsi tools: fix iscsiadm exit codesMike Christie2011-01-311-0/+63
| | | | | | | | | iscsiadm/iscsistart return a mix of type of returns codes. Sometimes -1 and sometimes a EXYZ type of error code. This patch has them return a ISCSI_ERR value. See iscsiadm man page EXIT STATUS section for error code definitions.
* Use pass through interface for sendtargets (take4) Currenly offload cards ↵Mike Christie2011-01-311-1/+5
| | | | | | | | | | | | | | | | | | like bnx2i, be2iscsi, cxgb3i must use a normal eth for discovery. This patch allows us to do discovery using the iscsi class passthrough interface. Note1 that the dirver must set the CAP_TEXT_NEGO setting, which might requires scsi-misc. Limitations of patch: - MaxRecvDataSegmentLength is limited to 8K for discovery sessions when offload is used. V3: - bug fixes from Eddie Wai to call start conn after we have logged in. Fixed set param not setting all settings. Misc cleanups. V4: - fix iscsistart segfault due to missing initialization.
* iscsi boot: add support for iscsi boot sysfs moduleMike Christie2010-07-101-0/+2
| | | | | | This patch modifies the ibft sysfs code to support the iscsi boot sysfs module which is used by be2iscsi to export be2iscsi boot info.
* iscsid: support discovery daemon auto logoutMike Christie2010-03-221-0/+12
| | | | | | With this patch, if the sendtargets or isns daemon detects that a target is no longer sent it will logout the session.
* iscsi tools: use open-isns servicesMike Christie2010-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the native isns code with open-isns's libisns. I included the open-isns code in the open-iscsi tarball to make distribution easier since some distros use different isns clients and may not want to carry open-isns. This is based on open-isns commit 5e09f36d3446e41de0b8361601ffec4cd140d513. Changes in iSNS behavior/use: - To do discovery you must pass the ip and optionally the port to iscsiadm: iscsiadm -m discovery -t st -p 10.15.0.9 This command accepts the same ops as sendtargets so you can add/remove/update the node records that are created. It also supports ifaces properly now. - isns.address and isns.port in iscsid.conf are no longer used. - ESI is temporarily not supported. This will be fixed in the next patch when SCNs support is added. - The iscsiadm isns discovery command is not marked as stable. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* iscsi tools: nic setup cleanupMike Christie2010-01-151-2/+4
| | | | | | This just breaks up the network part of the nic setup code to a new function that lives in the net utils code, so it can be used by other callers one day.
* ibft boot: do not setup nic if offload can be usedMike Christie2010-01-151-0/+1
| | | | | | If the nic has a iscsi offload function then do not set up the nic with the ibft net settings. We will use those values for the iscsi net settings.
* iscsi tools: merge functions to get net iface name from mac addressMike Christie2010-01-151-0/+8
| | | | | | There are 3 functions to get the net iface name from the mac address. This merges them into one function and moves it to a new file.
* ibft boot: mv setup nics to fw_entry.c so iscsiadm can use itMike Christie2010-01-131-0/+1
| | | | This just mvs setup_nics to fw_entry.c so iscsiadm can use it.
* iscsi mod: sync to linux-2.6-iscsi tree's 2.6.33 feature window patchesMike Christie2009-11-062-0/+53
| | | | | Sync kernel modules with what is being sent for the 2.6.33 feature window.
* iscsid: fix bound ep connect event numberMike Christie2009-05-131-3/+2
| | | | | | Fix bad merge. The bound ep connect event number should be 19. When transferring patches from the offload tree to head this got set to the wrong value.
* bind offloaded connection to portMike Christie2009-05-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | If we are using a offload card, then iface_set_param will match the iface info to a scsi_host and pass that info down to setup the net settings of the port (currently we just set the ip address). When we create the tcp/ip connection by calling ep_connect, we currently just go by the routing table info. I think there are two problems with this. 1. Some drivers do not have access to a routing table. Some drivers like qla4xxx do not even know about other ports. 2. If you have two initiator ports on the same subnet, the user may have set things up so that session1 was supposed to be run through port1. and session2 was supposed to be run through port2. It looks like we could end with both sessions going through one of the ports. Also how do you edit the routing table for the offload cards? You cannot use normal net tools like route can you? 3. If we set up hostA in the iface_set_param step, but then the routing info leads us to hostB, we are stuck. I did the attached patches to fix this. Basically we just pass down the scsi host we want to go through.
* iscsi tools: convert from strncat to strlcatMike Christie2009-02-071-0/+27
| | | | | We messed up strncat in so many different ways that strlat could fix. This patch converts the userspace uses of strncat to strlcat.
* iscsi mod: sync up kernel modules with 2.6.29Mike Christie2009-01-211-2/+5
| | | | | This takes the iscsi modules that are planned for 2.6.29 and adds them to the kernel dir.
* iscsi modules: fix compilationMike Christie2008-11-271-0/+2
| | | | | | | | I added a stdint include so that it would be easier to compile userspace apps including iscsi_proto.h, but that breaks the kernel compilation. Since this iscsi_proto.h is only used in open-iscsi releases I am just adding a ifdef __KERNEL__.
* fwparam: rm unused filepath argumentMike Christie2008-11-261-1/+1
| | | | fw_get_entry's filepath is always NULL, so this patch removes it.
* ibft: add support to use iscsi_ibft module and log into all portals found in ↵Mike Christie2008-11-263-9/+121
| | | | | | | | | | | | | | | | | | | | | firmware This adds the ibft sysfs module (iscsi_ibft) parsing support. It was original done by Konard, but I have ported it to use the sysfs.c helpers (add new ones and ported iscsi_sysfs.c too). This patch also modifies iscsistart and iscsiadm to print/log into all the portals found in firmware. It also changes the behavior of iscsiadm -m discovery -t fw so that we create db records for what is found. It is not fully hooked into the iface code, so it will use the different inititor name, but it will not create a iface for it (this means that if you have a record for the same portal that is bound to a iface with a iname you can run into problems).
* iscsi_tcp: return a descriptive error value during connection errorsMike Christie2008-09-251-0/+1
| | | | | | | | The segment->done functions return a iscsi error value which gives a lot more info than conn failed, so this patch has us return that value. I also add a new one for xmit failures. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* handle ISCSI_ERR_INVALID_HOSTMike Christie2008-09-251-0/+1
| | | | | | | | | | If the kernel throws ISCSI_ERR_INVALID_HOST then the host is no longer able to support iscsi. iscsid should then kill the session. There is no need to logout or do the sync cache from the ubind path, because at this point the transport is dead. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Mike Christie <mchristi@redhat.com>
* Sync kernel modules to scsi-misc for 2.6.27.Mike Christie2008-06-132-9/+6
| | | | Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* pass ep to session creationMike Christie2008-05-191-0/+7
| | | | | | | | | | bnx2i allocates a host per session and iser accesses the device so we need to pass them a the leading connection so they can find the hardware that is it bound to. This also has us call ep_disconnect before calling the stop conn callout, so these driver do not have to worry about stopping the receiving path.
* Revert Release-transport-entry-when-the-transport-is-unload.patchMike Christie2008-05-191-1/+0
| | | | | | | | | We do not need a new event to figure out that a transport is missing. We can just check before accessing the transport. This reverts the original patch. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* Release transport entry when the transport is unloadedMike Christie2008-04-261-0/+1
| | | | | | | | | | When iscsid detects a new transport (e.g. iscsi_tcp, ib_iser), it allocates an entry for it in the transport list. If the transport is unloaded and then reloaded, iscsid would still use the old transport entry. Therefore, the transport entry must be deleted when the transport is unloaded. Signed-off-by: Erez Zilber <erezz@voltaire.com>
* iscsi class/if kernel: add ifacename attrMike Christie2008-04-201-36/+41
| | | | | | | | This adds a attr that userspace can use to set a id for the session similar to setting a network inteface's name. It is used for binding hba and port attrs to a session. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* The session age mask is only 4 bits, but session->age is 32. WhenMike Christie2008-02-211-2/+2
| | | | | | | | it gets larger then 15 and we try to or the bits some bits get dropped and the check for session age in iscsi_verify_itt is useless. The ISCSI_CID_MASK related bits are also useless since cid is always one.
* sync with upstreamMike Christie2007-09-292-2/+13
| | | | Recv and xmit rewrite.
* mv nop handling to kernelMike Christie2007-08-271-0/+11
| | | | | | | During root boot and shutdown the target could send us nops. At this time iscsid cannot be running, so the target will drop the session and the boot or shutdown will hang. This patch moves the nop handling to the kernel.
* fix shutdownMike Christie2007-08-271-0/+7
| | | | | | | | | | | | | We were using the device delete sysfs file to remove each device then logout. Now in 2.6.21 and .22 this will not work because the sysfs delete file returns immediately and does not wait for the device removal to complete. This causes a hang if a cache sync is needed during shutdown. This patch fixes the shutdown code so that we remove the target and unbind the session before logging out and shuttdown the session. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* add device reset support and fix some scsi eh bugs.Mike Christie2007-08-141-0/+2
| | | | | | | This patch adds logical unit reset support. It also fixes a bug where when the session lock is dropped so we can grab the recv lock, the iscsi eh thread could grab completely clean up the session. The recv lock would then be a null ptr.
* fix DefaultTime2Wait handling and fix libiscsi null ptr ref.Mike Christie2007-08-131-0/+2
| | | | | | | We were not using the DefaultTime2Wait value we negotiated for. We could hit a null ptr in libiscsi if we called stop and the connection had not been setup.
* Finish hooking into toolMike Christie2007-07-251-6/+6
| | | | | | | | | | | Instead of having each parser print its output, make it common in fw_entry.c and make that use the same format and fields as the rest of the tools. Kept the ibft dump code, because it may be use for compat tools for suse. Let me know and I can help on that if you need it. With the hook in though the format for ibft is the same as normal iscsiadm node info so you can just reuse your parsing login for that.
* hook fw programs into iscsi toolsMike Christie2007-07-251-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch hooks ibft into iscsiadm and iscsistart. Why do this? It seems easier to be able to just run the same tool we use for normal login. For example in the installer or initramfs we can do this: // This will check for fw crap and if found // log into targets that are found // returns 0 on success and non zero if // there was no fw crap or we could not log // in or some other error. // This will _not_ store any record (text files // with data in it) in /var/lib/iscsi. // It is completely dynamic in that regard. ret = iscsiadm -m discovery -t fwboot -l (fwboot - is a new discovery type I added which is for this fw crap). // For normal iscsi install we can then do: ret = iscsiadm -m discovery -t st -p ip:port -l // This will do discovery to the portal at // ip:port, and now the code supports the -l on discovery, // so it will also log into all the targets found // automagically for the caller. // This will store records (text files with target data in it) // like usual to /var/lib/iscsi. To setup the initramfs then, we just need some variable that tells us if we are doing the fw boot or the pxe net iscsi boot. This could be done by checking iscsiadm or iscsistart like so: ret = iscsiadm -m discovery -t fwboot // no login/-l command this time if ret indicates success, then setup initramfs for dynamic fwboot else do the normal pxe static iscsi root stuff we did. In the initrams fs if using iscsistart we would just do (if this got setup for fw dynamic boot) or it would end up as And if using iscsiadm in the initramfs you can just do iscsiadm -m discovery -t fwboot -l The patch was made using Prasana and Doug's code. I have not tested it. I do not have the hardware handy (no intel card and I got stuck looking for a ppc box with it).
* Support bind by hw address or netdev (ip address is temp disabled because ↵mnc2007-05-301-0/+3
| | | | | | targets are not handling it well) and use the iface argument instead of the actual values git-svn-id: svn://svn.berlios.de/open-iscsi@845 d7303112-9cec-0310-bdd2-e83a94d6c2b6