Getting To Know The SAN Stack
Getting To Know The SAN Stack
The big picture (SAN driver stack) Switches and attached devices HBA, multipathing, target and layered drivers fp, fctl, fcsm, fcp, fcip Userland libraries Userland utilities Debugging features - mdb
Debugging features Solaris CAT Some useful data structures Putting it all together The NWS consolidation Source code location and structure References for further reading
fp fctl (Fibre Channel Transport Layer) HBAs: QLogic, Emulex, JNI Switches: Brocade, McData, QLogic Physical devices: disks, tapes, ....
fcp fcsm
fcip iSCSI
Sun Storage (group/division/...)'s Solaris Datapath Engineering has the source for each of these drivers for reference purposes, but.... HBA manufacturers do bugfixes and sustaining
The PCI vid/did combinations are the same as appear on linux or MS-Windows
HBA
SG-XPCI1FC-QLC X6799A SG-XPCI1FC-QF2 or x6767A SG-XPCI2FC-QF2 or x6768A X6727A SG-XPCI1FC-QF4 SG-XPCI2FC-QF4 SG-XPCIE1FC-QF4 SG-XPCIE2FC-QF4 QCP2340 QCP2342 QLA200 QLA210 QLA2310 QLA2310F/QLA2310FL QLA2340/QLA2340L QLA2342/QLA2342L QLA2344/QLA2344-P QLA2440 QLA2460 QLA2462 QLE2360 QLE2362 QLE2440 QLE2460 QLE2462 QSB2340 QSB2342
SAN 4.4.8
Not Supported
Not Supported S10 update 1 or S10 + 119130-13 Not Supported S10 update 1 or S10 + 119130-13
SummitE SG-XPCIE2FCSun EM4 10df fc20 10df fc22 LPe11002-S Sun SG-XPCI1FC-EM4 10df Fc10 10df Fc11 LP11000-S TBD PyramidE Sun SG-XPCI2FC-EM4 10df Fc10 10df Fc12 LP11002-S Emulex LP10000 10df fa00 10df fa00 LP10000 Emulex LP10000DC 10df fa00 10df fa00 LP10000DC Emulex LP10000ExDC 10df fa00 10df fa00 LP10000ExDC Emulex LPe11000 10df fe00 10df fe00 LPe11000 Emulex LPe11002 10df fe00 10df fe00 LPe11002 S10 update 1 S10 update 1 Emulex LP11000 10df fd00 10df fd00 LP11000 SAN 4.4.7 or S10 + or S10 + N/A 120223-04 120222-04 Emulex LP11002 10df fd00 10df fd00 LP11002 Emulex LP9802 10df f980 10df f980 LP9802 Emulex LP9002DC 10df f900 10df f900 LP9002DC Emulex LP9002L 10df f900 10df f900 LP9002L Emulex LP9002S 10df f095 10df f095 LP9002S Notes: Model numbers ending in -S are Sun HBAs, Model numbers with no - extension are Emulex HBAs, Model numbers ending with -E are EMC HBAs. All will enumerate under the emlxs driver.
SG-XPCI1FC-QLC X6799A SG-XPCI1FC-QF2 or x6767A SG-XPCI2FC-QF2 or x6768A X6727A SG-XPCI1FC-QF4 SG-XPCI2FC-QF4 SG-XPCIE1FC-QF4 SG-XPCIE2FC-QF4 SG-XPCI1FC-EM2 SG-XPCI2FC-EM2 SG-XPCIE1FC-EM4 SG-XPCIE2FC-EM4 SG-XPCI1FC-EM4 SG-XPCI2FC-EM4
Performs the login to and logout of switches PLOGI+PLOGO (point-to-point), LOGI+LOGO (fabric) Handles basic accept and reject BA_ACC, BA_RJT Handles the Extended Link Services accept and reject ELS_ACC, ELS_RJT Logs in and out of, and queries the fabric name service Creates the per-port loop map as required Passes information about changes (new, old, disconnected) luns to fcp and thence to devfsadmd threads
Implements the FC Management Server (Fabric) configuration commands Provides relatively-direct access to switch Management Server operations via the ioctl(2) interface You're unlikely to use this directly
Handles orphan ports Maintains the list of WWNs attached to this port (both local and remote) Doles out the SFK work through job_requests Provides utility functions for the rest of the SFK stack
Does the work of encapsulating SCSI commands inside FC frame structures When your thread needs SCSA access, fcp does the job Handles scsi target device discovery Talks to the NDI (bus nexus) and MDI (multipath driver interface) frameworks for device discovery Generically, fcp routes SCSI packets to and from targets
Does the work of encapsulating IP and ARP packets inside FC frame structures Maintains the routing table for fcip instances
Userland Libraries
libg_fc and liba5k are used mainly for luxadm (libg_fc and liba5k are sparc only) libHBAAPI and libsun_fc are used for cfgadm_fp libima and libsun_ima are the Multipath Management API libHBAAPI and libima are SNIA source code libsun_fc and libsun_ima are the vendor-specific plugins that Sun provides for libHBAAPI and libima
Userland Utilities
We've got four: luxadm (supposed to go away... not soon enough!)
luxadm(1M)
Userland Utilities
# fcinfo hba-port HBA Port WWN: 210000e08b954220 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: QLE2462 Type: N-port State: online Supported Speeds: 1Gb 2Gb 4Gb Current Speed: 4Gb Node WWN: 200000e08b954220 HBA Port WWN: 210100e08bb54220 OS Device Name: /dev/cfg/c3 Manufacturer: QLogic Corp. Model: QLE2462 Type: N-port State: online Supported Speeds: 1Gb 2Gb 4Gb Current Speed: 2Gb Node WWN: 200100e08bb54220
Userland Utilities
# fcinfo remote-port -p 210000e08b110125 Remote Port WWN: 256000c0ffc7ecd2 Active FC4 Types: SCSI SCSI Target: yes Node WWN: 206000c0ff07ecd2
# fcinfo remote-port -l -p 210000e08b110125 Remote Port WWN: 256000c0ffc7ecd2 Active FC4 Types: SCSI SCSI Target: yes Node WWN: 206000c0ff07ecd2 Link Error Statistics: Link Failure Count: 0 Loss of Sync Count: 0 Loss of Signal Count: 0 Primitive Seq Protocol Error Count: 0 Invalid Tx Word Count: 0 Invalid CRC Count: 0
Userland Utilities
# fcinfo remote-port -s -p 210000e08b110125 Remote Port WWN: 256000c0ffc7ecd2 Active FC4 Types: SCSI SCSI Target: yes Node WWN: 206000c0ff07ecd2 LUN: 0 Vendor: SUN Product: StorEdge 3511 OS Device Name: /dev/rdsk/c0t600C0FF00000000007ECD20CD4BBE500d0s2 LUN: 1 Vendor: SUN Product: StorEdge 3511 OS Device Name: /dev/rdsk/c0t600C0FF00000000007ECD20CD4BBE501d0s2 LUN: 2 Vendor: SUN Product: StorEdge 3511 OS Device Name: /dev/rdsk/c0t600C0FF00000000007ECD20CD4BBE502d0s2 ....
Userland Utilities
# cfgadm -la -o show_SCSI_LUN Ap_Id c1 c1::200400a0b81770cf,0 c1::200400a0b81770cf,1 c1::200400a0b81770cf,31 c2 c2::210100e08b275cb5 c2::210100e08b27abb5 c2::50020f2300000cf0,0 c2::50020f2300000cf0,1 c2::50020f2300000cf0,2 c2::50020f2300000cf0,3 c2::50020f2300004bf0,0 c2::50020f2300004bf0,1 c2::50020f2300004bf0,2 ... Type fc-private disk disk disk fc-fabric unknown unknown disk disk disk disk disk disk disk Receptacle connected connected connected connected connected connected connected connected connected connected connected connected connected connected Occupant configured configured configured configured configured Condition unknown unknown unknown unknown unknown
unconfigured unknown unconfigured unknown configured configured configured configured configured configured configured unknown unknown unknown unknown unknown unknown unknown
HBAs visible from this port, in the same zone as this port
Userland Utilities
# cfgadm -la -o show_FCP_dev Ap_Id c1 c1::200400a0b81770cf,0 c1::200400a0b81770cf,1 c1::200400a0b81770cf,31 c2 c2::210100e08b275cb5 c2::210100e08b27abb5 c2::50020f2300000cf0,0 c2::50020f2300000cf0,1 c2::50020f2300000cf0,2 c2::50020f2300000cf0,3 c2::50020f2300004bf0,0 c2::50020f2300004bf0,1 c2::50020f2300004bf0,2 .... Type fc-private disk disk disk fc-fabric unknown unknown disk disk disk disk disk disk disk Receptacle connected connected connected connected connected connected connected connected connected connected connected connected connected connected Occupant configured configured configured configured configured Condition unknown unknown unknown unknown unknown
unconfigured unknown unconfigured unknown configured configured configured configured configured configured configured unknown unknown unknown unknown unknown unknown unknown
Of the above, the fcptrace and fptrace buffers are probably the most useful to get started with debugging an issue
Dec 20 14:38:49 2005] 20=>ssfcp(2)::ssfcp_handle_reportlun: port=2, tgt D_ID=0x80200 Dec 20 14:38:49 2005] 21=>ssfcp(2)::!Dynamically discovered 18 LUNs for D_ID=80200
Each entry has a timestamp, a monotonically-increasing sequence number, the fcp or fp instance (ssfcp prior to Nevada) making the entry, and the actual message itself
Note that we've got the same format as for the FCP trace buffer....
The fields have types as follows: Port: fc_local_port (snv) or fc_port_t (s10 and earlier) I#: instance number State: port speed (msb) and actual state (lsb) Soft: soft_state defined in fc_portif.h FCA Handle: opaque pointer for the local port device Port DIP: port dip (dev_info_t) FCA Port Dip: fca dip (dev_info_t)
cmds fcp fcpX_cache fcsm_job_cache fctl_cache fpX_cache luns pd_by_did pd_by_pwwn ports targets ulpmods ulps qlcstates
- walk list of SCSI commands in fcp's per-lun queue - walk list of Leadville fcp instances - walk the fcpX_cache cache - walk the fcsm_job_cache cache - walk the fctl_cache cache - walk the fpX_cache cache - walk list of LUNs in an fcp target - walk list of fc_remote_port structures hashed by D_ID - walk list of fc_remote_port structures hashed by PWWN - walk list of Leadville port structures - walk list of fcp targets attached to the local port - walk list of Leadville ULP module structures - walk list of Leadville ULP structures - walk list of qlc ql_state_t structures
which gives you a struct ssfcp_lun which you can mdb-pipe to ::print like this:
*ssfcp_port_head::walk fcp|::walk targets|::walk luns|::print -t struct ssfcp_lun
targets [WWN|port#] shows targets, with WWN shows targets attached to that WWN or port instance only luns {WWN|port#} shows luns attached to WWN or port instance
Title
Fibre Channel Physical Interface Fibre Channel Physical Interface, gen 2 Fibre Channel Physical Interface, gen 3 Arbitrated Loop Arbitrated Loop, gen 2 Generic Fabric Switched Fabric Generic Services Generic Services, gen 2 Link Encapsulation Single-Byte command set mapping Private Loop Direct Attach 10-bit Interface Fabric Loop Attachment SCSI-3 encapsulation in FC Generic Packetized Protocol
www.t11.org for FC
Code Pointers
The NWS consolidation is available at http://cvs.opensolaris.org/source/xref/nwsc You can search and browse the source using OpenGrok You can download snapshots of the NWS consolidation from http://www.opensolaris.org/os/downloads http://mp-mgmt-api.sourceforge.net MPAPI http://www.snia.org/apps/org/workgroup/os-attach
Blogs
blogs.sun.com/roller/page/jmcp James McPherson blogs.sun.com/roller/page/torrey Torrey McMahon blogs.sun.com/roller/page/AaronDailey Aaron Dailey blogs.sun.com/roller/page/dweibel David Weibel blogs.sun.com/roller/page/hbainsights Sumit Gupta