1 .\" Copyright (c) 2013 Edward Tomasz Napierala
2 .\" Copyright (c) 2015-2017 Alexander Motin <mav@FreeBSD.org>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 To compile this driver into the kernel,
35 place the following line in your
36 kernel configuration file:
37 .Bd -ragged -offset indent
41 Alternatively, to load the driver as a
42 module at boot time, place the following line in
44 .Bd -literal -offset indent
50 subsystem provides SCSI target devices emulation.
51 It supports features such as:
55 Disk, CD-ROM and processor device emulation
59 SCSI task attribute support (ordered, head of queue, simple tags)
61 SCSI implicit command ordering support
63 Full task management support (abort, query, reset, etc.)
65 Support for multiple ports, initiators, targets and backing stores
67 Support for VMWare VAAI and Microsoft ODX offload (COMPARE AND WRITE,
68 XCOPY, POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME and UNMAP)
70 Persistent reservation support
72 Extensive VPD/mode/log pages support
74 Featured error reporting, error injection and basic SMART support
76 High Availability clustering support with ALUA
78 All I/O handled in-kernel, no userland context switch overhead
83 subsystem includes multiple frontends to provide access using different
84 transport protocols and implementations:
85 .Bl -tag -width cfumass
87 Provides access for local system via virtual initiator mode
91 Provides access for remote systems via target mode
93 SIMs, such as Fibre Channel
98 Provides access for remote systems via USB Mass Storage Class
99 Bulk Only (BBB) Transport.
101 Internal frontend used to receive requests from other node ports in
102 High Availability cluster.
104 Provides access for local user-level applications via
108 Provides access for remote systems via the iSCSI protocol using
111 Internal frontend used to receive requests from Third Party Copy engine,
112 implementing copy offload operations.
117 subsystem includes two backends to create logical units using different
118 kinds of backing stores:
119 .Bl -tag -width ramdisk
121 Stores data in ZFS ZVOLs, files or raw block devices.
123 Stores data in RAM, that makes it mostly useful for performance testing.
124 Depending on configured capacity can work as black hole, thin or thick
128 The following variables are available as both
133 .Bl -tag -width indent
134 .It Va kern.cam.ctl.debug
135 Bit mask of enabled CTL log levels:
136 .Bl -tag -offset indent -compact
138 log commands with errors;
142 log data for commands other then READ/WRITE.
145 .It Va kern.cam.ctl.ha_id
146 Specifies unique position of this node within High Availability cluster.
147 Default is 0 -- no HA, 1 and 2 -- HA enabled at specified position.
148 .It Va kern.cam.ctl.ha_mode
149 Specifies High Availability cluster operation mode:
150 .Bl -tag -offset indent -compact
152 Active/Standby -- primary node has backend access and processes requests,
153 while secondary can only do basic LUN discovery and reservation;
155 Active/Active -- both nodes have backend access and process requests,
156 while secondary node synchronizes processing with primary one;
158 Active/Active -- primary node has backend access and processes requests,
159 while secondary node forwards all requests and data to primary one;
161 All above modes require established connection between HA cluster nodes.
162 If connection is not configured, secondary node will report Unavailable
163 state; if configured but not established -- Transitioning state.
165 .It Va kern.cam.ctl.ha_peer
166 String value, specifying method to establish connection to peer HA node.
167 Can be "listen IP:port", "connect IP:port" or empty.
168 .It Va kern.cam.ctl.ha_link
169 Reports present state of connection between HA cluster nodes:
170 .Bl -tag -offset indent -compact
174 configured but not established;
178 .It Va kern.cam.ctl.ha_role
179 Specifies default role of this node:
180 .Bl -tag -offset indent -compact
186 This role can be overridden on per-LUN basis using "ha_role" LUN option,
187 so that for one LUN one node is primary, while for another -- another.
188 Role change from primary to secondary for HA modes 0 and 2 closes backends,
189 the opposite change -- opens.
190 If there is no primary node (both nodes are secondary, or secondary node has
191 no connection to primary one), secondary node(s) report Transitioning state.
192 State with two primary nodes is illegal (split brain condition).
194 .Sh TUNABLE VARIABLES
195 The following variables are available as
198 .Bl -tag -width indent
199 .It Va kern.cam.ctl.max_luns
200 Specifies the maximum number of LUNs we support, must be a power of 2.
201 The default value is 1024.
202 .It Va kern.cam.ctl.max_ports
203 Specifies the maximum number of ports we support, must be a power of 2.
204 The default value is 1024.
215 subsystem first appeared in
220 subsystem was originally written by
221 .An Kenneth Merry Aq Mt ken@FreeBSD.org .
222 Later work was done by
223 .An Alexander Motin Aq Mt mav@FreeBSD.org .