]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/ctl.4
sys/{x86,amd64}: remove one of doubled ;s
[FreeBSD/FreeBSD.git] / share / man / man4 / ctl.4
1 .\" Copyright (c) 2013 Edward Tomasz Napierala
2 .\" Copyright (c) 2015-2017 Alexander Motin <mav@FreeBSD.org>
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
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.
13 .\"
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
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .Dd March 29, 2017
28 .Dt CTL 4
29 .Os
30 .Sh NAME
31 .Nm ctl
32 .Nd CAM Target Layer
33 .Sh SYNOPSIS
34 To compile this driver into the kernel,
35 place the following line in your
36 kernel configuration file:
37 .Bd -ragged -offset indent
38 .Cd "device ctl"
39 .Ed
40 .Pp
41 Alternatively, to load the driver as a
42 module at boot time, place the following line in
43 .Xr loader.conf 5 :
44 .Bd -literal -offset indent
45 ctl_load="YES"
46 .Ed
47 .Sh DESCRIPTION
48 The
49 .Nm
50 subsystem provides SCSI target devices emulation.
51 It supports features such as:
52 .Pp
53 .Bl -bullet -compact
54 .It
55 Disk, CD-ROM and processor device emulation
56 .It
57 Tagged queueing
58 .It
59 SCSI task attribute support (ordered, head of queue, simple tags)
60 .It
61 SCSI implicit command ordering support
62 .It
63 Full task management support (abort, query, reset, etc.)
64 .It
65 Support for multiple ports, initiators, targets and backing stores
66 .It
67 Support for VMWare VAAI and Microsoft ODX offload (COMPARE AND WRITE,
68 XCOPY, POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME and UNMAP)
69 .It
70 Persistent reservation support
71 .It
72 Extensive VPD/mode/log pages support
73 .It
74 Featured error reporting, error injection and basic SMART support
75 .It
76 High Availability clustering support with ALUA
77 .It
78 All I/O handled in-kernel, no userland context switch overhead
79 .El
80 .Pp
81 The
82 .Nm
83 subsystem includes multiple frontends to provide access using different
84 transport protocols and implementations:
85 .Bl -tag -width cfumass
86 .It camsim
87 Provides access for local system via virtual initiator mode
88 .Xr CAM 4
89 SIM.
90 .It camtgt
91 Provides access for remote systems via target mode
92 .Xr CAM 4
93 SIMs, such as Fibre Channel
94 .Xr isp 4
95 and
96 .Xr mpt 4 .
97 .It cfumass
98 Provides access for remote systems via USB Mass Storage Class
99 Bulk Only (BBB) Transport.
100 .It ha
101 Internal frontend used to receive requests from other node ports in
102 High Availability cluster.
103 .It ioctl
104 Provides access for local user-level applications via
105 .Xr ioctl 2
106 based API.
107 .It iscsi
108 Provides access for remote systems via the iSCSI protocol using
109 .Xr cfiscsi 4 .
110 .It tpc
111 Internal frontend used to receive requests from Third Party Copy engine,
112 implementing copy offload operations.
113 .El
114 .Pp
115 The
116 .Nm
117 subsystem includes two backends to create logical units using different
118 kinds of backing stores:
119 .Bl -tag -width ramdisk
120 .It block
121 Stores data in ZFS ZVOLs, files or raw block devices.
122 .It ramdisk
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
125 provisioned disk.
126 .El
127 .Sh SYSCTL VARIABLES
128 The following variables are available as both
129 .Xr sysctl 8
130 variables and
131 .Xr loader 8
132 tunables:
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
137 .It 1
138 log commands with errors;
139 .It 2
140 log all commands;
141 .It 4
142 log data for commands other then READ/WRITE.
143 .El
144 Defaults to 0.
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
151 .It 0
152 Active/Standby -- primary node has backend access and processes requests,
153 while secondary can only do basic LUN discovery and reservation;
154 .It 1
155 Active/Active -- both nodes have backend access and process requests,
156 while secondary node synchronizes processing with primary one;
157 .It 2
158 Active/Active -- primary node has backend access and processes requests,
159 while secondary node forwards all requests and data to primary one;
160 .El
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.
164 Defaults to 0.
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
171 .It 0
172 not configured;
173 .It 1
174 configured but not established;
175 .It 2
176 established.
177 .El
178 .It Va kern.cam.ctl.ha_role
179 Specifies default role of this node:
180 .Bl -tag -offset indent -compact
181 .It 0
182 primary;
183 .It 1
184 secondary.
185 .El
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).
193 .El
194 .Sh TUNABLE VARIABLES
195 The following variables are available as
196 .Xr loader 8
197 tunables:
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 256.
205 .El
206 .Sh SEE ALSO
207 .Xr cfiscsi 4 ,
208 .Xr cfumass 4 ,
209 .Xr ctladm 8 ,
210 .Xr ctld 8 ,
211 .Xr ctlstat 8
212 .Sh HISTORY
213 The
214 .Nm
215 subsystem first appeared in
216 .Fx 9.1 .
217 .Sh AUTHORS
218 The
219 .Nm
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 .