1130f4520SKenneth D. Merry/* $FreeBSD$ */ 2130f4520SKenneth D. Merry 3130f4520SKenneth D. MerryCTL - CAM Target Layer Description 4130f4520SKenneth D. Merry 5130f4520SKenneth D. MerryRevision 1.4 (December 29th, 2011) 6130f4520SKenneth D. MerryKen Merry <ken@FreeBSD.org> 7130f4520SKenneth D. Merry 8130f4520SKenneth D. MerryTable of Contents: 9130f4520SKenneth D. Merry================= 10130f4520SKenneth D. Merry 11130f4520SKenneth D. MerryIntroduction 12130f4520SKenneth D. MerryFeatures 13130f4520SKenneth D. MerryConfiguring and Running CTL 14130f4520SKenneth D. MerryRevision 1.N Changes 15130f4520SKenneth D. MerryTo Do List 16130f4520SKenneth D. MerryCode Roadmap 17130f4520SKenneth D. MerryUserland Commands 18130f4520SKenneth D. Merry 19130f4520SKenneth D. MerryIntroduction: 20130f4520SKenneth D. Merry============ 21130f4520SKenneth D. Merry 2291be33dcSAlexander MotinCTL is a disk, processor and cdrom device emulation subsystem originally 2391be33dcSAlexander Motinwritten for Copan Systems under Linux starting in 2003. It has been 2491be33dcSAlexander Motinshipping in Copan (now SGI) products since 2005. 25130f4520SKenneth D. Merry 26130f4520SKenneth D. MerryIt was ported to FreeBSD in 2008, and thanks to an agreement between SGI 27130f4520SKenneth D. Merry(who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is 28130f4520SKenneth D. Merryavailable under a BSD-style license. The intent behind the agreement was 29130f4520SKenneth D. Merrythat Spectra would work to get CTL into the FreeBSD tree. 30130f4520SKenneth D. Merry 31130f4520SKenneth D. MerryFeatures: 32130f4520SKenneth D. Merry======== 33130f4520SKenneth D. Merry 3491be33dcSAlexander Motin - Disk, processor and cdrom device emulation. 35130f4520SKenneth D. Merry - Tagged queueing 36130f4520SKenneth D. Merry - SCSI task attribute support (ordered, head of queue, simple tags) 37130f4520SKenneth D. Merry - SCSI implicit command ordering support. (e.g. if a read follows a mode 38130f4520SKenneth D. Merry select, the read will be blocked until the mode select completes.) 39130f4520SKenneth D. Merry - Full task management support (abort, LUN reset, target reset, etc.) 40130f4520SKenneth D. Merry - Support for multiple ports 41130f4520SKenneth D. Merry - Support for multiple simultaneous initiators 42130f4520SKenneth D. Merry - Support for multiple simultaneous backing stores 43d36c6176SAlexander Motin - Support for VMWare VAAI: COMPARE AND WRITE, XCOPY, WRITE SAME and 44d36c6176SAlexander Motin UNMAP commands 45d36c6176SAlexander Motin - Support for Microsoft ODX: POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME 46d36c6176SAlexander Motin and UNMAP commands 47130f4520SKenneth D. Merry - Persistent reservation support 48130f4520SKenneth D. Merry - Mode sense/select support 49130f4520SKenneth D. Merry - Error injection support 50d36c6176SAlexander Motin - High Availability clustering support with ALUA 51130f4520SKenneth D. Merry - All I/O handled in-kernel, no userland context switch overhead. 52130f4520SKenneth D. Merry 53130f4520SKenneth D. MerryConfiguring and Running CTL: 54130f4520SKenneth D. Merry=========================== 55130f4520SKenneth D. Merry 56d36c6176SAlexander Motin - Add 'device ctl' to your kernel configuration file or load the module. 57130f4520SKenneth D. Merry 58130f4520SKenneth D. Merry - If you're running with a 8Gb or 4Gb Qlogic FC board, add 59d36c6176SAlexander Motin 'options ISP_TARGET_MODE' to your kernel config file. 'device ispfw' or 60d36c6176SAlexander Motin loading the ispfw module is also recommended. 61130f4520SKenneth D. Merry 62130f4520SKenneth D. Merry - Rebuild and install a new kernel. 63130f4520SKenneth D. Merry 64130f4520SKenneth D. Merry - Reboot with the new kernel. 65130f4520SKenneth D. Merry 66130f4520SKenneth D. Merry - To add a LUN with the RAM disk backend: 67130f4520SKenneth D. Merry 68130f4520SKenneth D. Merry ctladm create -b ramdisk -s 10485760000000000000 69130f4520SKenneth D. Merry ctladm port -o on 70130f4520SKenneth D. Merry 71130f4520SKenneth D. Merry - You should now see the CTL disk LUN through camcontrol devlist: 72130f4520SKenneth D. Merry 73130f4520SKenneth D. Merryscbus6 on ctl2cam0 bus 0: 74130f4520SKenneth D. Merry<FREEBSD CTLDISK 0001> at scbus6 target 1 lun 0 (da24,pass32) 75130f4520SKenneth D. Merry<> at scbus6 target -1 lun -1 () 76130f4520SKenneth D. Merry 77130f4520SKenneth D. Merry This is visible through the CTL CAM SIM. This allows using CTL without 78130f4520SKenneth D. Merry any physical hardware. You should be able to issue any normal SCSI 79130f4520SKenneth D. Merry commands to the device via the pass(4)/da(4) devices. 80130f4520SKenneth D. Merry 81130f4520SKenneth D. Merry If any target-capable HBAs are in the system (e.g. isp(4)), and have 82130f4520SKenneth D. Merry target mode enabled, you should now also be able to see the CTL LUNs via 83130f4520SKenneth D. Merry that target interface. 84130f4520SKenneth D. Merry 85130f4520SKenneth D. Merry Note that all CTL LUNs are presented to all frontends. There is no 86130f4520SKenneth D. Merry LUN masking, or separate, per-port configuration. 87130f4520SKenneth D. Merry 88130f4520SKenneth D. Merry - Note that the ramdisk backend is a "fake" ramdisk. That is, it is 89130f4520SKenneth D. Merry backed by a small amount of RAM that is used for all I/O requests. This 90130f4520SKenneth D. Merry is useful for performance testing, but not for any data integrity tests. 91130f4520SKenneth D. Merry 92130f4520SKenneth D. Merry - To add a LUN with the block/file backend: 93130f4520SKenneth D. Merry 94130f4520SKenneth D. Merry truncate -s +1T myfile 95130f4520SKenneth D. Merry ctladm create -b block -o file=myfile 96130f4520SKenneth D. Merry ctladm port -o on 97130f4520SKenneth D. Merry 98130f4520SKenneth D. Merry - You can also see a list of LUNs and their backends like this: 99130f4520SKenneth D. Merry 100130f4520SKenneth D. Merry# ctladm devlist 101130f4520SKenneth D. MerryLUN Backend Size (Blocks) BS Serial Number Device ID 102130f4520SKenneth D. Merry 0 block 2147483648 512 MYSERIAL 0 MYDEVID 0 103130f4520SKenneth D. Merry 1 block 2147483648 512 MYSERIAL 1 MYDEVID 1 104130f4520SKenneth D. Merry 2 block 2147483648 512 MYSERIAL 2 MYDEVID 2 105130f4520SKenneth D. Merry 3 block 2147483648 512 MYSERIAL 3 MYDEVID 3 106130f4520SKenneth D. Merry 4 block 2147483648 512 MYSERIAL 4 MYDEVID 4 107130f4520SKenneth D. Merry 5 block 2147483648 512 MYSERIAL 5 MYDEVID 5 108130f4520SKenneth D. Merry 6 block 2147483648 512 MYSERIAL 6 MYDEVID 6 109130f4520SKenneth D. Merry 7 block 2147483648 512 MYSERIAL 7 MYDEVID 7 110130f4520SKenneth D. Merry 8 block 2147483648 512 MYSERIAL 8 MYDEVID 8 111130f4520SKenneth D. Merry 9 block 2147483648 512 MYSERIAL 9 MYDEVID 9 112130f4520SKenneth D. Merry 10 block 2147483648 512 MYSERIAL 10 MYDEVID 10 113130f4520SKenneth D. Merry 11 block 2147483648 512 MYSERIAL 11 MYDEVID 11 114130f4520SKenneth D. Merry 115130f4520SKenneth D. Merry - You can see the LUN type and backing store for block/file backend LUNs 116130f4520SKenneth D. Merry like this: 117130f4520SKenneth D. Merry 118130f4520SKenneth D. Merry# ctladm devlist -v 119130f4520SKenneth D. MerryLUN Backend Size (Blocks) BS Serial Number Device ID 120130f4520SKenneth D. Merry 0 block 2147483648 512 MYSERIAL 0 MYDEVID 0 121130f4520SKenneth D. Merry lun_type=0 122130f4520SKenneth D. Merry num_threads=14 123130f4520SKenneth D. Merry file=testdisk0 124130f4520SKenneth D. Merry 1 block 2147483648 512 MYSERIAL 1 MYDEVID 1 125130f4520SKenneth D. Merry lun_type=0 126130f4520SKenneth D. Merry num_threads=14 127130f4520SKenneth D. Merry file=testdisk1 128130f4520SKenneth D. Merry 2 block 2147483648 512 MYSERIAL 2 MYDEVID 2 129130f4520SKenneth D. Merry lun_type=0 130130f4520SKenneth D. Merry num_threads=14 131130f4520SKenneth D. Merry file=testdisk2 132130f4520SKenneth D. Merry 3 block 2147483648 512 MYSERIAL 3 MYDEVID 3 133130f4520SKenneth D. Merry lun_type=0 134130f4520SKenneth D. Merry num_threads=14 135130f4520SKenneth D. Merry file=testdisk3 136130f4520SKenneth D. Merry 4 block 2147483648 512 MYSERIAL 4 MYDEVID 4 137130f4520SKenneth D. Merry lun_type=0 138130f4520SKenneth D. Merry num_threads=14 139130f4520SKenneth D. Merry file=testdisk4 140130f4520SKenneth D. Merry 5 block 2147483648 512 MYSERIAL 5 MYDEVID 5 141130f4520SKenneth D. Merry lun_type=0 142130f4520SKenneth D. Merry num_threads=14 143130f4520SKenneth D. Merry file=testdisk5 144130f4520SKenneth D. Merry 6 block 2147483648 512 MYSERIAL 6 MYDEVID 6 145130f4520SKenneth D. Merry lun_type=0 146130f4520SKenneth D. Merry num_threads=14 147130f4520SKenneth D. Merry file=testdisk6 148130f4520SKenneth D. Merry 7 block 2147483648 512 MYSERIAL 7 MYDEVID 7 149130f4520SKenneth D. Merry lun_type=0 150130f4520SKenneth D. Merry num_threads=14 151130f4520SKenneth D. Merry file=testdisk7 152130f4520SKenneth D. Merry 8 block 2147483648 512 MYSERIAL 8 MYDEVID 8 153130f4520SKenneth D. Merry lun_type=0 154130f4520SKenneth D. Merry num_threads=14 155130f4520SKenneth D. Merry file=testdisk8 156130f4520SKenneth D. Merry 9 block 2147483648 512 MYSERIAL 9 MYDEVID 9 157130f4520SKenneth D. Merry lun_type=0 158130f4520SKenneth D. Merry num_threads=14 159130f4520SKenneth D. Merry file=testdisk9 160130f4520SKenneth D. Merry 10 ramdisk 0 0 MYSERIAL 0 MYDEVID 0 161130f4520SKenneth D. Merry lun_type=3 162130f4520SKenneth D. Merry 11 ramdisk 204800000000000 512 MYSERIAL 1 MYDEVID 1 163130f4520SKenneth D. Merry lun_type=0 164130f4520SKenneth D. Merry 165130f4520SKenneth D. MerryRevision 1.4 Changes 166130f4520SKenneth D. Merry==================== 167130f4520SKenneth D. Merry - Added in the second HA mode (where CTL does the data transfers instead 168130f4520SKenneth D. Merry of having data transfers done below CTL), and abstracted out the Copan 169130f4520SKenneth D. Merry HA API. 170130f4520SKenneth D. Merry 171130f4520SKenneth D. Merry - Fixed the phantom device problem in the CTL CAM SIM and improved the 172130f4520SKenneth D. Merry CAM SIM to automatically trigger a rescan when the port is enabled and 173130f4520SKenneth D. Merry disabled. 174130f4520SKenneth D. Merry 175130f4520SKenneth D. Merry - Made the number of threads in the block backend configurable via sysctl, 176130f4520SKenneth D. Merry loader tunable and the ctladm command line. (You can now specify 177130f4520SKenneth D. Merry -o num_threads=4 when creating a LUN with ctladm create.) 178130f4520SKenneth D. Merry 179130f4520SKenneth D. Merry - Fixed some LUN selection issues in ctlstat(8) and allowed for selection 180130f4520SKenneth D. Merry of LUN numbers up to 1023. 181130f4520SKenneth D. Merry 182130f4520SKenneth D. Merry - General cleanup. 183130f4520SKenneth D. Merry 184130f4520SKenneth D. Merry - This version intended for public release. 185130f4520SKenneth D. Merry 186130f4520SKenneth D. MerryRevision 1.3 Changes 187130f4520SKenneth D. Merry==================== 188130f4520SKenneth D. Merry - Added descriptor sense support to CTL. It can be enabled through the 189130f4520SKenneth D. Merry control mode page (10), but is disabled by default. 190130f4520SKenneth D. Merry 191130f4520SKenneth D. Merry - Improved error injection support. The number of errors that can be 192130f4520SKenneth D. Merry injected with 'ctladm inject' has been increased, and any arbitrary 193130f4520SKenneth D. Merry sense data may now be injected as well. 194130f4520SKenneth D. Merry 195130f4520SKenneth D. Merry - The port infrastructure has been revamped. Individual ports and types 196130f4520SKenneth D. Merry of ports may now be enabled and disabled from the command line. ctladm 197130f4520SKenneth D. Merry now has the ability to set the WWNN and WWPN for each port. 198130f4520SKenneth D. Merry 199130f4520SKenneth D. Merry - The block backend can now send multiple I/Os to backing files. Multiple 200130f4520SKenneth D. Merry writes are only allowed for ZFS, but multiple readers are allowed for 201130f4520SKenneth D. Merry any filesystem. 202130f4520SKenneth D. Merry 203130f4520SKenneth D. Merry - The block and ramdisk backends now support setting the LUN blocksize. 204130f4520SKenneth D. Merry There are some restrictions when the backing device is a block device, 205130f4520SKenneth D. Merry but otherwise the blocksize may be set to anything. 206130f4520SKenneth D. Merry 207130f4520SKenneth D. MerryRevision 1.2 Changes 208130f4520SKenneth D. Merry==================== 209130f4520SKenneth D. Merry 210130f4520SKenneth D. Merry - CTL initialization process has been revamped. Instead of using an 211130f4520SKenneth D. Merry ad-hoc method, it is now sequenced through SYSINIT() calls. 212130f4520SKenneth D. Merry 213130f4520SKenneth D. Merry - A block/file backend has been added. This allows using arbitrary files 214130f4520SKenneth D. Merry or block devices as a backing store. 215130f4520SKenneth D. Merry 216130f4520SKenneth D. Merry - The userland LUN configuration interface has been completely rewritten. 217130f4520SKenneth D. Merry Configuration is now done out of band. 218130f4520SKenneth D. Merry 219130f4520SKenneth D. Merry - The ctladm(8) command line interface has been revamped, and is now 220130f4520SKenneth D. Merry similar to camcontrol(8). 221130f4520SKenneth D. Merry 222130f4520SKenneth D. MerryTo Do List: 223130f4520SKenneth D. Merry========== 224130f4520SKenneth D. Merry 225130f4520SKenneth D. Merry - Use devstat(9) for CTL's statistics collection. CTL uses a home-grown 226130f4520SKenneth D. Merry statistics collection system that is similar to devstat(9). ctlstat 227130f4520SKenneth D. Merry should be retired in favor of iostat, etc., once aggregation modes are 228130f4520SKenneth D. Merry available in iostat to match the behavior of ctlstat -t and dump modes 229130f4520SKenneth D. Merry are available to match the behavior of ctlstat -d/ctlstat -J. 230130f4520SKenneth D. Merry 231130f4520SKenneth D. Merry - ZFS ARC backend for CTL. Since ZFS copies all I/O into the ARC 232130f4520SKenneth D. Merry (Adaptive Replacement Cache), running the block/file backend on top of a 233130f4520SKenneth D. Merry ZFS-backed zdev or file will involve an extra set of copies. The 234130f4520SKenneth D. Merry optimal solution for backing targets served by CTL with ZFS would be to 235130f4520SKenneth D. Merry allocate buffers out of the ARC directly, and DMA to/from them directly. 236130f4520SKenneth D. Merry That would eliminate an extra data buffer allocation and copy. 237130f4520SKenneth D. Merry 238130f4520SKenneth D. Merry - Switch CTL over to using CAM CCBs instead of its own union ctl_io. This 239130f4520SKenneth D. Merry will likely require a significant amount of work, but will eliminate 240130f4520SKenneth D. Merry another data structure in the stack, more memory allocations, etc. This 241130f4520SKenneth D. Merry will also require changes to the CAM CCB structure to support CTL. 242130f4520SKenneth D. Merry 243130f4520SKenneth D. MerryCode Roadmap: 244130f4520SKenneth D. Merry============ 245130f4520SKenneth D. Merry 246130f4520SKenneth D. MerryCTL has the concept of pluggable frontend ports and backends. All 247130f4520SKenneth D. Merryfrontends and backends can be active at the same time. You can have a 248130f4520SKenneth D. Merryramdisk-backed LUN present along side a file backed LUN. 249130f4520SKenneth D. Merry 250130f4520SKenneth D. Merryctl.c: 251130f4520SKenneth D. Merry----- 252130f4520SKenneth D. Merry 253130f4520SKenneth D. MerryThis is the core of CTL, where all of the command handlers and a lot of 254130f4520SKenneth D. Merryother things live. Yes, it is large. It started off small and grew to its 255130f4520SKenneth D. Merrycurrent size over time. Perhaps it can be split into more files at some 256130f4520SKenneth D. Merrypoint. 257130f4520SKenneth D. Merry 258130f4520SKenneth D. MerryHere is a roadmap of some of the primary functions in ctl.c. Starting here 259130f4520SKenneth D. Merryand following the various leaf functions will show the command flow. 260130f4520SKenneth D. Merry 261*812c9f48SAlexander Motinctl_queue() / ctl_run() This is where commands from the frontend ports come 262130f4520SKenneth D. Merry in. 263130f4520SKenneth D. Merry 264130f4520SKenneth D. Merryctl_queue_sense() This is only used for non-packetized SCSI. i.e. 265130f4520SKenneth D. Merry parallel SCSI prior to U320 and perhaps U160. 266130f4520SKenneth D. Merry 267130f4520SKenneth D. Merryctl_work_thread() This is the primary work thread, and everything gets 268130f4520SKenneth D. Merry executed from there. 269130f4520SKenneth D. Merry 270130f4520SKenneth D. Merryctl_scsiio_precheck() This where all of the initial checks are done, and I/O 271130f4520SKenneth D. Merry is either queued for execution or blocked. 272130f4520SKenneth D. Merry 273130f4520SKenneth D. Merryctl_scsiio() This is where the command handler is actually 274130f4520SKenneth D. Merry executed. (See ctl_cmd_table.c for the mapping of 275130f4520SKenneth D. Merry SCSI opcode to command handler function.) 276130f4520SKenneth D. Merry 277130f4520SKenneth D. Merryctl_done() This is the routine called (or ctl_done_lock()) to 278130f4520SKenneth D. Merry initiate the command completion process. 279130f4520SKenneth D. Merry 280130f4520SKenneth D. Merryctl_process_done() This is where command completion actually happens. 281130f4520SKenneth D. Merry 282130f4520SKenneth D. Merryctl.h: 283130f4520SKenneth D. Merry----- 284130f4520SKenneth D. Merry 285130f4520SKenneth D. MerryBasic function declarations and data structures. 286130f4520SKenneth D. Merry 287130f4520SKenneth D. Merryctl_backend.c, 288130f4520SKenneth D. Merryctl_backend.h: 289130f4520SKenneth D. Merry------------- 290130f4520SKenneth D. Merry 291130f4520SKenneth D. MerryThese files define the basic CTL backend API. The comments in the header 292130f4520SKenneth D. Merryexplain the API. 293130f4520SKenneth D. Merry 294130f4520SKenneth D. Merryctl_backend_block.c 295130f4520SKenneth D. Merry------------------- 296130f4520SKenneth D. Merry 297130f4520SKenneth D. MerryThe block and file backend. This allows for using a disk or a file as the 298130f4520SKenneth D. Merrybacking store for a LUN. Multiple threads are started to do I/O to the 299130f4520SKenneth D. Merrybacking device, primarily because the VFS API requires that to get any 300130f4520SKenneth D. Merryconcurrency. 301130f4520SKenneth D. Merry 302130f4520SKenneth D. Merryctl_backend_ramdisk.c: 303130f4520SKenneth D. Merry--------------------- 304130f4520SKenneth D. Merry 305130f4520SKenneth D. MerryA "fake" ramdisk backend. It only allocates a small amount of memory to 306130f4520SKenneth D. Merryact as a source and sink for reads and writes from an initiator. Therefore 307130f4520SKenneth D. Merryit cannot be used for any real data, but it can be used to test for 308130f4520SKenneth D. Merrythroughput. It can also be used to test initiators' support for extremely 309130f4520SKenneth D. Merrylarge LUNs. 310130f4520SKenneth D. Merry 311130f4520SKenneth D. Merryctl_cmd_table.c: 312130f4520SKenneth D. Merry--------------- 313130f4520SKenneth D. Merry 314130f4520SKenneth D. MerryThis is a table with all 256 possible SCSI opcodes, and command handler 315130f4520SKenneth D. Merryfunctions defined for supported opcodes. It is included in ctl.c. 316130f4520SKenneth D. Merry 317130f4520SKenneth D. Merryctl_debug.h: 318130f4520SKenneth D. Merry----------- 319130f4520SKenneth D. Merry 320130f4520SKenneth D. MerrySimplistic debugging support. 321130f4520SKenneth D. Merry 322130f4520SKenneth D. Merryctl_error.c, 323130f4520SKenneth D. Merryctl_error.h: 324130f4520SKenneth D. Merry----------- 325130f4520SKenneth D. Merry 326130f4520SKenneth D. MerryCTL-specific wrappers around the CAM sense building functions. 327130f4520SKenneth D. Merry 328130f4520SKenneth D. Merryctl_frontend.c, 329130f4520SKenneth D. Merryctl_frontend.h: 330130f4520SKenneth D. Merry-------------- 331130f4520SKenneth D. Merry 332130f4520SKenneth D. MerryThese files define the basic CTL frontend port API. The comments in the 333130f4520SKenneth D. Merryheader explain the API. 334130f4520SKenneth D. Merry 335130f4520SKenneth D. Merryctl_frontend_cam_sim.c: 336130f4520SKenneth D. Merry---------------------- 337130f4520SKenneth D. Merry 338130f4520SKenneth D. MerryThis is a CTL frontend port that is also a CAM SIM. The idea is that this 339130f4520SKenneth D. Merryfrontend allows for using CTL without any target-capable hardware. So any 340130f4520SKenneth D. MerryLUNs you create in CTL are visible via this port. 341130f4520SKenneth D. Merry 3427ac58230SAlexander Motinctl_ha.c: 343130f4520SKenneth D. Merryctl_ha.h: 344130f4520SKenneth D. Merry-------- 345130f4520SKenneth D. Merry 3467ac58230SAlexander MotinThis is a High Availability API and TCP-based interlink implementation. 347130f4520SKenneth D. Merry 348130f4520SKenneth D. Merryctl_io.h: 349130f4520SKenneth D. Merry-------- 350130f4520SKenneth D. Merry 351130f4520SKenneth D. MerryThis defines most of the core CTL I/O structures. union ctl_io is 352130f4520SKenneth D. Merryconceptually very similar to CAM's union ccb. 353130f4520SKenneth D. Merry 354130f4520SKenneth D. Merryctl_ioctl.h: 355130f4520SKenneth D. Merry----------- 356130f4520SKenneth D. Merry 357130f4520SKenneth D. MerryThis defines all ioctls available through the CTL character device, and 358130f4520SKenneth D. Merrythe data structures needed for those ioctls. 359130f4520SKenneth D. Merry 360130f4520SKenneth D. Merryctl_private.h: 361130f4520SKenneth D. Merry------------- 362130f4520SKenneth D. Merry 363130f4520SKenneth D. MerryPrivate data structres (e.g. CTL softc) and function prototypes. This also 364130f4520SKenneth D. Merryincludes the SCSI vendor and product names used by CTL. 365130f4520SKenneth D. Merry 366130f4520SKenneth D. Merryctl_scsi_all.c 367130f4520SKenneth D. Merryctl_scsi_all.h: 368130f4520SKenneth D. Merry-------------- 369130f4520SKenneth D. Merry 370130f4520SKenneth D. MerryCTL wrappers around CAM sense printing functions. 371130f4520SKenneth D. Merry 372130f4520SKenneth D. Merryctl_ser_table.c: 373130f4520SKenneth D. Merry--------------- 374130f4520SKenneth D. Merry 375130f4520SKenneth D. MerryCommand serialization table. This defines what happens when one type of 376130f4520SKenneth D. Merrycommand is followed by another type of command. e.g., what do you do when 377130f4520SKenneth D. Merryyou have a mode select followed by a write? You block the write until the 378130f4520SKenneth D. Merrymode select is complete. That is defined in this table. 379130f4520SKenneth D. Merry 380130f4520SKenneth D. Merryctl_util.c 381130f4520SKenneth D. Merryctl_util.h: 382130f4520SKenneth D. Merry---------- 383130f4520SKenneth D. Merry 384130f4520SKenneth D. MerryCTL utility functions, primarily designed to be used from userland. See 385130f4520SKenneth D. Merryctladm for the primary consumer of these functions. These include CDB 386130f4520SKenneth D. Merrybuilding functions. 387130f4520SKenneth D. Merry 388130f4520SKenneth D. Merryscsi_ctl.c: 389130f4520SKenneth D. Merry---------- 390130f4520SKenneth D. Merry 391130f4520SKenneth D. MerryCAM target peripheral driver and CTL frontend port. This is the path into 392130f4520SKenneth D. MerryCTL for commands from target-capable hardware/SIMs. 393130f4520SKenneth D. Merry 394130f4520SKenneth D. MerryUserland Commands: 395130f4520SKenneth D. Merry================= 396130f4520SKenneth D. Merry 397130f4520SKenneth D. Merryctladm(8) fills a role similar to camcontrol(8). It allow configuring LUNs, 398130f4520SKenneth D. Merryissuing commands, injecting errors and various other control functions. 399130f4520SKenneth D. Merry 400130f4520SKenneth D. Merryctlstat(8) fills a role similar to iostat(8). It reports I/O statistics 401130f4520SKenneth D. Merryfor CTL. 402