summaryrefslogtreecommitdiff
path: root/usr/iscsi_sysfs.h
Commit message (Collapse)AuthorAgeFilesLines
* From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>Mike Christie2013-05-281-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* iscsi tools: check for loaded module before loadingMike Christie2012-03-221-0/+1
| | | | No need to run modprobe if the module is already loaded.
* iscsi tools: remove class version checkMike Christie2012-03-221-1/+0
| | | | | | This patch removes the check for the transport class version. We have not used it, and instead have checked for kernel functionality on a per operation basis.
* iscsid: don't sync qla4xxx flash sessionsMike Christie2011-11-011-0/+1
| | | | | | | | We do not want to sync iscsid with qla4xxx's flash/fw sessions, because the kernel/fw controls recovery. This uses the creator sysfs file to figure out if the session is ours or not.
* iscsi tools: manage qla4xxx iscsi sessions with iscsiadmLalit Chandivade2011-08-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: print kernel iface infoMike Christie2011-08-141-0/+4
| | | | | | | | | | | | This patch prints the kernel's iface info. iscsiadm -m host -P 2 iscsiadm -m host -H $N -P 2 will print out the kernel's iface info for the ifaces under all hosts or for specific hosts. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* iscsi tools: fix bnx2i boot due to MAC mismatchMike Christie2011-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The problem is current bnx2i boot firmware has 2 modes. 1. hba mode - Will export the iscsi MAC in ibft. 2. non hba mode - Will export the network MAC in ibft. [In both modes there should be a sysfs link to the network netdev from the ibft ethernet dir] For #1 we want to create a session using bnx2i. For #2 we want to use software iscsi (we can only use software iscsi since we do not know the MAC for the offload card). This patch fixes a bug where we would create a iscsi session using the offload card if the netdev that is found through the ibft sysfs tree was managed by a net driver that has a iscsi offload driver. With this patch we now determine if we use the offload card during boot based on if the /sys/class/iscsi_host/hostX/hwaddres matches the one in iBFT. If it does, then we know the iBFT MAC is the iscsi one and use the offload driver. Note that cxgb*i always uses 1 MAC for both iscsi and offload. So for that driver we always use offload. To get the netdev we follow the sysfs ethernet link to the netdev like is done with bnx2i.
* iscsiadm: add host modeMike Christie2009-05-101-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prints out the info for iSCSI hosts in the system. EXAMPLE ------- iscsiadm -m host cxgb3i: [9] 10.10.15.50,[00:07:43:05:97:07],eth3 <empty> $TRANSPORT: [$HOST_NO] $HOST_IP,[$MAC},$NETDEV $INITIATORNAME EXAMPLE --------- iscsiadm -m host -P 2 Host Number: 9 State: running Transport: cxgb3i Initiatorname: <empty> IPaddress: 10.10.15.50 HWaddress: 00:07:43:05:97:07 Netdev: eth3 ********* Sessions: ********* Target: iqn.2001-04.com.home:meanminna Current Portal: 10.10.15.10:3260,1 Persistent Portal: 10.10.15.10:3260,1 ********** Interface: ********** Iface Name: cxgb3i Iface Transport: cxgb3i Iface Initiatorname: iqn.2005-06.com.redhat:noisymax Iface IPaddress: 10.10.15.50 Iface HWaddress: 00:07:43:05:97:07 Iface Netdev: eth3 SID: 8 iSCSI Connection State: LOGGED IN iSCSI Session State: LOGGED_IN Internal iscsid Session State: NO CHANGE ********** Interface: ********** Iface Name: cxgb3i.def Iface Transport: cxgb3i Iface Initiatorname: iqn.2005-06.com.redhat:madmax Iface IPaddress: 10.10.15.50 Iface HWaddress: 00:07:43:05:97:07 Iface Netdev: eth3 SID: 9 iSCSI Connection State: LOGGED IN iSCSI Session State: LOGGED_IN Internal iscsid Session State: NO CHANGE
* iscsid: set queue depthMike Christie2009-04-121-0/+2
| | | | This sets node.session.queue_depth for the session's devices.
* iscsiadm: print session and session info running through ifaces in iface modeMike Christie2008-12-051-21/+10
| | | | | | | | | | | | | | | | | If you run iscsiadm -m iface -P 1 or iscsiadm -m iface -I $my_iface -P 1 we print the iface info and if possible the host number and state (only for offload hbas). The P2 level will print the session running through a iface. The P3 level will print the negotiated iscsi params for each session. The P4 level will print the scsi devices accessed through each session.
* iscsiadm: fix output orderingMike Christie2008-11-261-1/+0
| | | | | | | | Commands that printed out records were mixing up the ordering. This just has us use alphasort since it is safe for things like uclibc and we do not really care about the alphabetical ordering and are more concerned with targets/portals that are alike being grouped together.
* ibft: add support to use iscsi_ibft module and log into all portals found in ↵Mike Christie2008-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | 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).
* Fix sysfs handling of block:sdX and scsi bus changesMike Christie2008-05-311-30/+34
| | | | | | | | This has us use the udev_sysfs code instead of hacking our own. There are two items that need future proofing: 1. handling of iscsi_session class device symlinks 2. scanning opens /sys/class/iscsi_* dir instead of doing a proper search like udev_sysfs.
* 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>
* break up iface code and add default iser, tcp/default and bnx2i ifacesMike Christie2008-04-201-0/+4
| | | | | | | | | | This patch moves the iface code to iface.c/.h. It also adds some default ifaces for iser and bnx2i. Currently if those modules are loaded then we will bind to them along with default/tcp when discovery is run. The user can then set the startup flag or delete the record. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* rm num_transports from sysfs header.Mike Christie2008-04-201-1/+0
| | | | | | rm num_transports from sysfs header. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* add ifacename support toolsMike Christie2008-04-201-1/+0
| | | | Set ifacename so we can look it back up on iscsid restart.
* Fix connection cleanup when iscsid is restarted.Mike Christie2008-02-211-0/+1
| | | | | | | | | If iscsid is restarted while a session is running, then the session is logged out we are leaving the iscsi connection in the kernel. The reason for this is because conn->ksetup is not set during the sync up. Instead of that hacky bool we can just check the kernel if there is a connection setup by looking in sysfs.
* uclibc supportMike Christie2008-02-201-0/+1
| | | | | | | | | | | Bug report and Patch from From Natanael Copa: I'm trying to compile open-iscsi on uclibc to be able to use it on embedded linux. I found out that there are 3 functions that are used that are not implemented in uclibc: getifaddrs, freeifaddrs and versionsort. None of those are in POSIX afaik.
* iscsid: fix log closing on startup errorsMike Christie2007-12-201-1/+1
| | | | During start if we exited we did not close the logging proc.
* print kernel session stateMike Christie2007-12-121-0/+1
| | | | | | | | drivers like qla4xxx do not use iscsid's state machine (there sm is in hw), so iscsid cannot print the state of the session or connection. In the kernel we export the session state, so this patch has iscsiadm print it with the other state values when running iscsiadm -session -P 1.
* mv session and host info to iscsi_sysfs.hMike Christie2007-08-271-0/+21
| | | | | | session_info and host_info are the structs used by iscsi_sysfs.c to return data and make more sense being defined in iscsi_sysfs.h
* Have iscsiadm --rescan pick up device size changes.Mike Christie2007-07-301-0/+1
| | | | | | iscsiadm --rescan was only picking up new devices. This has it now also pick up whatever /sys/block/sdX/device/rescan can pick up along with new devices.
* use list instead of queueMike Christie2007-06-221-1/+0
| | | | | | rm last queue item user with list Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
* Support bind by hw address or netdev (ip address is temp disabled because ↵mnc2007-05-301-2/+1
| | | | | | 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
* print local addressmnc2007-05-051-1/+1
| | | | git-svn-id: svn://svn.berlios.de/open-iscsi@831 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* print both current and original portal addrmnc2007-05-051-5/+3
| | | | git-svn-id: svn://svn.berlios.de/open-iscsi@830 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* fix lots of leaksmnc2007-05-051-0/+1
| | | | git-svn-id: svn://svn.berlios.de/open-iscsi@827 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* add host mode which only prints host info in a flat layout. TODO: print ↵mnc2007-04-241-3/+6
| | | | | | sessions running through each host and other info. THIS OUTPUT FORMAT WILL CHANGE git-svn-id: svn://svn.berlios.de/open-iscsi@817 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* Rename iface.name to iface.hwaddress and make transport name part of the ↵mnc2007-04-241-2/+2
| | | | | | iface (driver and hardware are bound). Also merge the -D and -I arguments so they are now -I driver,hwaddress. Also add some basic qla4xxx support. We can rescan/scan it and perform sendtargets through it but it stores the targets it finds in Flash and then logs into all of them autmatically (when we do discovery and later when reload the driver). So qla4xxx support is mostly to make sure we have the --interfae argument right. We will have to decide how to set other params, manage nodes, and if we should move scanning to the kernel and then also move some error recovery code to the kernel (today qla4xxx is calling block directly and is not able to export it iscsi state yet (the beginnings to fix that is in the git tree but we still need to reduce some code duplcation)). qla4xxx behavior and functionality is going to change as we learn more about the hw (what format the flash data is supposed to be in for example). git-svn-id: svn://svn.berlios.de/open-iscsi@816 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* use kernel list functions in almost all places (not queue.c yet), and fix ↵mnc2007-04-241-7/+6
| | | | | | some print output git-svn-id: svn://svn.berlios.de/open-iscsi@815 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* With qla4xxx and braodcom we will want to be able to match the the drivers ↵mnc2007-04-241-3/+5
| | | | | | as well as the other params, so add a -D param git-svn-id: svn://svn.berlios.de/open-iscsi@814 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* again with the root boot stuff :) For root boot, the user may not be using a ↵mnc2007-04-241-0/+2
| | | | | | node db record, and may be using chap so we store the values in sysfs in the kernel and then read them out again when iscsid starts up. This is also really more useful for qla4xxx which needs to export this stuff since it stores/sets it in flash git-svn-id: svn://svn.berlios.de/open-iscsi@788 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* for BIOS/OF or partial offload root boot we will want to be able to manage a ↵mnc2007-04-241-0/+6
| | | | | | session that does not have a node db record. Int he nic binding patches we fixed up a lot of places like the logout path. This patch fixes up the iscsid sync up path git-svn-id: svn://svn.berlios.de/open-iscsi@784 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* add the ability to control which hw resources a session or iscsiadm op is ↵mnc2007-04-241-2/+3
| | | | | | bound to. Note that binding a session to a NIC with software iscsi is sometimes difficult and experimental. If you cannot do a ping -I eth0 someadddress, then binding a session through that specific nic will not work :) so please try the ping before reporting a problem. git-svn-id: svn://svn.berlios.de/open-iscsi@782 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* forgot patch to display device and host state when --info patch was mergedmnc2006-11-251-0/+4
| | | | git-svn-id: svn://svn.berlios.de/open-iscsi@738 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* --info fixes and review comments: support qla4xxx with the --info command ↵mnc2006-11-221-3/+4
| | | | | | and print out the sd/sr values. Tape is not supported since I am not sure what link it makes ATM. Will add when I can get someone to test. git-svn-id: svn://svn.berlios.de/open-iscsi@736 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* add -m session --info commandmnc2006-11-221-0/+23
| | | | git-svn-id: svn://svn.berlios.de/open-iscsi@734 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* add -m session --rescan commandmnc2006-11-221-0/+1
| | | | git-svn-id: svn://svn.berlios.de/open-iscsi@733 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* fix shutdown. This fixes the problem where iscsid had 256 hardcoded in the ↵mnc2006-10-311-2/+4
| | | | | | delete device code and it also fixes the problem where we leave zombie delete threads. It does this by just having iscsiadm do the delete since it can block (iscsid cannot). We probably want to fix this in the kernel somehow with the new interface. This patch fixes the logout code, delete code and blocking code for now though. git-svn-id: svn://svn.berlios.de/open-iscsi@717 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* move sysfs access to iscsi_sysfs.c/hmnc2006-09-061-3/+8
| | | | git-svn-id: svn://svn.berlios.de/open-iscsi@693 d7303112-9cec-0310-bdd2-e83a94d6c2b6
* if multiple transports are loaded we try to sync sessions multple times due ↵mnc2006-09-061-0/+26
to a broken loop in iscsid.c git-svn-id: svn://svn.berlios.de/open-iscsi@691 d7303112-9cec-0310-bdd2-e83a94d6c2b6