]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - share/man/man4/ctl.4
MFC r315561:
[FreeBSD/stable/10.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 19, 2017
28 .Dt CTL 4
29 .Os
30 .Sh NAME
31 .Nm ctl
32 .Nd CAM Target Layer / iSCSI target subsystem
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 iscsi"
39 .Cd "device ctl"
40 .Ed
41 .Pp
42 Alternatively, to load the driver as a
43 module at boot time, place the following line in
44 .Xr loader.conf 5 :
45 .Bd -literal -offset indent
46 ctl_load="YES"
47 .Ed
48 .Sh DESCRIPTION
49 The
50 .Nm
51 subsystem provides SCSI target devices emulation.
52 It supports features such as:
53 .Pp
54 .Bl -bullet -compact
55 .It
56 Disk, CD-ROM and processor device emulation
57 .It
58 Tagged queueing
59 .It
60 SCSI task attribute support (ordered, head of queue, simple tags)
61 .It
62 SCSI implicit command ordering support
63 .It
64 Full task management support (abort, query, reset, etc.)
65 .It
66 Support for multiple ports, initiators, targets and backing stores
67 .It
68 Support for VMWare VAAI and Microsoft ODX offload (COMPARE AND WRITE,
69 XCOPY, POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME and UNMAP)
70 .It
71 Persistent reservation support
72 .It
73 Extensive VPD/mode/log pages support
74 .It
75 Featured error reporting, error injection and basic SMART support
76 .It
77 High Availability clustering support with ALUA
78 .It
79 All I/O handled in-kernel, no userland context switch overhead
80 .El
81 .Pp
82 The
83 .Nm
84 subsystem includes multiple frontends to provide access using different
85 transport protocols and implementations:
86 .Bl -tag -width cfumass
87 .It camsim
88 Provides access for local system via virtual initiator mode
89 .Xr CAM 4
90 SIM.
91 .It camtgt
92 Provides access for remote systems via target mode
93 .Xr CAM 4
94 SIMs, such as Fibre Channel
95 .Xr isp 4
96 and
97 .Xr mpt 4 .
98 .It cfumass
99 Provides access for remote systems via USB Mass Storage Class
100 Bulk Only (BBB) Transport.
101 .It ha
102 Internal frontend used to receive requests from other node ports in
103 High Availability cluster.
104 .It ioctl
105 Provides access for local user-level applications via
106 .Xr ioctl 2
107 based API.
108 .It iscsi
109 Combined with
110 .Xr iscsi 4
111 and
112 .Xr ctld 8 ,
113 provides access for remote systems via iSCSI protocol.
114 .It tpc
115 Internal frontend used to receive requests from Third Party Copy engine,
116 implementing copy offload operations.
117 .El
118 .Pp
119 The
120 .Nm
121 subsystem includes two backends to create logical units using different
122 kinds of backing stores:
123 .Bl -tag -width ramdisk
124 .It block
125 Stores data in ZFS ZVOLs, files or raw block devices.
126 .It ramdisk
127 Stores data in RAM, that makes it mostly useful for performance testing.
128 Depending on configured capacity can work as black hole, thin or thick
129 provisioned disk.
130 .El
131 .Sh SYSCTL VARIABLES
132 The following variables are available as both
133 .Xr sysctl 8
134 variables and
135 .Xr loader 8
136 tunables:
137 .Bl -tag -width indent
138 .It Va kern.cam.ctl.debug
139 Bit mask of enabled CTL log levels:
140 .Bl -tag -offset indent -compact
141 .It 1
142 log commands with errors;
143 .It 2
144 log all commands;
145 .It 4
146 log data for commands other then READ/WRITE.
147 .El
148 Defaults to 0.
149 .It Va kern.cam.ctl.ha_id
150 Specifies unique position of this node within High Availability cluster.
151 Default is 0 -- no HA, 1 and 2 -- HA enabled at specified position.
152 .It Va kern.cam.ctl.ha_mode
153 Specifies High Availability cluster operation mode:
154 .Bl -tag -offset indent -compact
155 .It 0
156 Active/Standby -- primary node has backend access and processes requests,
157 while secondary can only do basic LUN discovery and reservation;
158 .It 1
159 Active/Active -- both nodes have backend access and process requests,
160 while secondary node synchronizes processing with primary one;
161 .It 2
162 Active/Active -- primary node has backend access and processes requests,
163 while secondary node forwards all requests and data to primary one;
164 .El
165 All above modes require established connection between HA cluster nodes.
166 If connection is not configured, secondary node will report Unavailable
167 state; if configured but not established -- Transitioning state.
168 Defaults to 0.
169 .It Va kern.cam.ctl.ha_peer
170 String value, specifying method to establish connection to peer HA node.
171 Can be "listen IP:port", "connect IP:port" or empty.
172 .It Va kern.cam.ctl.ha_link
173 Reports present state of connection between HA cluster nodes:
174 .Bl -tag -offset indent -compact
175 .It 0
176 not configured;
177 .It 1
178 configured but not established;
179 .It 2
180 established.
181 .El
182 .It Va kern.cam.ctl.ha_role
183 Specifies default role of this node:
184 .Bl -tag -offset indent -compact
185 .It 0
186 primary;
187 .It 1
188 secondary.
189 .El
190 This role can be overridden on per-LUN basis using "ha_role" LUN option,
191 so that for one LUN one node is primary, while for another -- another.
192 Role change from primary to secondary for HA modes 0 and 2 closes backends,
193 the opposite change -- opens.
194 If there is no primary node (both nodes are secondary, or secondary node has
195 no connection to primary one), secondary node(s) report Transitioning state.
196 State with two primary nodes is illegal (split brain condition).
197 .It Va kern.cam.ctl.iscsi.debug
198 Verbosity level for log messages from the kernel part of iSCSI target.
199 Set to 0 to disable logging or 1 to warn about potential problems.
200 Larger values enable debugging output.
201 Defaults to 1.
202 .It Va kern.cam.ctl.iscsi.maxcmdsn_delta
203 The number of outstanding commands to advertise to the iSCSI initiator.
204 Technically, it is the difference between ExpCmdSN and MaxCmdSN fields
205 in the iSCSI PDU.
206 Defaults to 256.
207 .It Va kern.cam.ctl.iscsi.ping_timeout
208 The number of seconds to wait for the iSCSI initiator to respond to a NOP-In
209 PDU.
210 In the event that there is no response within that time the session gets
211 forcibly terminated.
212 Set to 0 to disable sending NOP-In PDUs.
213 Defaults to 5.
214 .Sh SEE ALSO
215 .Xr ctladm 8 ,
216 .Xr ctld 8 ,
217 .Xr ctlstat 8
218 .Sh HISTORY
219 The
220 .Nm
221 subsystem first appeared in
222 .Fx 9.1 .
223 .Sh AUTHORS
224 The
225 .Nm
226 subsystem was originally written by
227 .An Kenneth Merry Aq Mt ken@FreeBSD.org .
228 Later work was done by
229 .An Alexander Motin Aq Mt mav@FreeBSD.org .