summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/ctl.4 3.html
blob: 33136be2baeb1c6f33fdc14855dee4acc6b01720 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<table class="head">
  <tr>
    <td class="head-ltitle">CTL(4)</td>
    <td class="head-vol">Device Drivers Manual</td>
    <td class="head-rtitle">CTL(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">ctl</code> &#x2014; <span class="Nd">CAM Target
    Layer</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp">To compile this driver into the kernel, place the following line
    in your kernel configuration file:</p>
<div class="Bd Pp Bd-indent"><code class="Cd">device ctl</code></div>
<p class="Pp">Alternatively, to load the driver as a module at boot time, place
    the following line in <a class="Xr">loader.conf(5)</a>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>ctl_load=&quot;YES&quot;</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">ctl</code> subsystem provides SCSI target
    devices emulation. It supports features such as:</p>
<p class="Pp"></p>
<ul class="Bl-bullet Bl-compact">
  <li>Disk, CD-ROM and processor device emulation</li>
  <li>Tagged queueing</li>
  <li>SCSI task attribute support (ordered, head of queue, simple tags)</li>
  <li>SCSI implicit command ordering support</li>
  <li>Full task management support (abort, query, reset, etc.)</li>
  <li>Support for multiple ports, initiators, targets and backing stores</li>
  <li>Support for VMWare VAAI and Microsoft ODX offload (COMPARE AND WRITE,
      XCOPY, POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME and UNMAP)</li>
  <li>Persistent reservation support</li>
  <li>Extensive VPD/mode/log pages support</li>
  <li>Featured error reporting, error injection and basic SMART support</li>
  <li>High Availability clustering support with ALUA</li>
  <li>All I/O handled in-kernel, no userland context switch overhead</li>
</ul>
<p class="Pp">The <code class="Nm">ctl</code> subsystem includes multiple
    frontends to provide access using different transport protocols and
    implementations:</p>
<dl class="Bl-tag">
  <dt>camsim</dt>
  <dd>Provides access for local system via virtual initiator mode
      <a class="Xr">CAM(4)</a> SIM.</dd>
  <dt>camtgt</dt>
  <dd>Provides access for remote systems via target mode
      <a class="Xr">CAM(4)</a> SIMs, such as Fibre Channel
      <a class="Xr">isp(4)</a> and <a class="Xr">mpt(4)</a>.</dd>
  <dt>cfumass</dt>
  <dd>Provides access for remote systems via USB Mass Storage Class Bulk Only
      (BBB) Transport.</dd>
  <dt>ha</dt>
  <dd>Internal frontend used to receive requests from other node ports in High
      Availability cluster.</dd>
  <dt>ioctl</dt>
  <dd>Provides access for local user-level applications via
      <a class="Xr">ioctl(2)</a> based API.</dd>
  <dt>iscsi</dt>
  <dd>Provides access for remote systems via the iSCSI protocol using
      <a class="Xr">cfiscsi(4)</a>.</dd>
  <dt>tpc</dt>
  <dd>Internal frontend used to receive requests from Third Party Copy engine,
      implementing copy offload operations.</dd>
</dl>
<p class="Pp">The <code class="Nm">ctl</code> subsystem includes two backends to
    create logical units using different kinds of backing stores:</p>
<dl class="Bl-tag">
  <dt>block</dt>
  <dd>Stores data in ZFS ZVOLs, files or raw block devices.</dd>
  <dt>ramdisk</dt>
  <dd>Stores data in RAM, that makes it mostly useful for performance testing.
      Depending on configured capacity can work as black hole, thin or thick
      provisioned disk.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SYSCTL_VARIABLES"><a class="permalink" href="#SYSCTL_VARIABLES">SYSCTL
  VARIABLES</a></h1>
<p class="Pp">The following variables are available as both
    <a class="Xr">sysctl(8)</a> variables and <a class="Xr">loader(8)</a>
    tunables:</p>
<dl class="Bl-tag">
  <dt id="kern.cam.ctl.debug"><var class="Va">kern.cam.ctl.debug</var></dt>
  <dd>Bit mask of enabled CTL log levels:
    <div class="Bd-indent">
    <dl class="Bl-tag Bl-compact">
      <dt>1</dt>
      <dd>log commands with errors;</dd>
      <dt>2</dt>
      <dd>log all commands;</dd>
      <dt>4</dt>
      <dd>log data for commands other then READ/WRITE.</dd>
    </dl>
    </div>
    Defaults to 0.</dd>
  <dt id="kern.cam.ctl.ha_id"><var class="Va">kern.cam.ctl.ha_id</var></dt>
  <dd>Specifies unique position of this node within High Availability cluster.
      Default is 0 -- no HA, 1 and 2 -- HA enabled at specified position.</dd>
  <dt id="kern.cam.ctl.ha_mode"><var class="Va">kern.cam.ctl.ha_mode</var></dt>
  <dd>Specifies High Availability cluster operation mode:
    <div class="Bd-indent">
    <dl class="Bl-tag Bl-compact">
      <dt>0</dt>
      <dd>Active/Standby -- primary node has backend access and processes
          requests, while secondary can only do basic LUN discovery and
          reservation;</dd>
      <dt>1</dt>
      <dd>Active/Active -- both nodes have backend access and process requests,
          while secondary node synchronizes processing with primary one;</dd>
      <dt>2</dt>
      <dd>Active/Active -- primary node has backend access and processes
          requests, while secondary node forwards all requests and data to
          primary one;</dd>
    </dl>
    </div>
    All above modes require established connection between HA cluster nodes. If
      connection is not configured, secondary node will report Unavailable
      state; if configured but not established -- Transitioning state. Defaults
      to 0.</dd>
  <dt id="kern.cam.ctl.ha_peer"><var class="Va">kern.cam.ctl.ha_peer</var></dt>
  <dd>String value, specifying method to establish connection to peer HA node.
      Can be &quot;listen IP:port&quot;, &quot;connect IP:port&quot; or
    empty.</dd>
  <dt id="kern.cam.ctl.ha_link"><var class="Va">kern.cam.ctl.ha_link</var></dt>
  <dd>Reports present state of connection between HA cluster nodes:
    <div class="Bd-indent">
    <dl class="Bl-tag Bl-compact">
      <dt>0</dt>
      <dd>not configured;</dd>
      <dt>1</dt>
      <dd>configured but not established;</dd>
      <dt>2</dt>
      <dd>established.</dd>
    </dl>
    </div>
  </dd>
  <dt id="kern.cam.ctl.ha_role"><var class="Va">kern.cam.ctl.ha_role</var></dt>
  <dd>Specifies default role of this node:
    <div class="Bd-indent">
    <dl class="Bl-tag Bl-compact">
      <dt>0</dt>
      <dd>primary;</dd>
      <dt>1</dt>
      <dd>secondary.</dd>
    </dl>
    </div>
    This role can be overridden on per-LUN basis using &quot;ha_role&quot; LUN
      option, so that for one LUN one node is primary, while for another --
      another. Role change from primary to secondary for HA modes 0 and 2 closes
      backends, the opposite change -- opens. If there is no primary node (both
      nodes are secondary, or secondary node has no connection to primary one),
      secondary node(s) report Transitioning state. State with two primary nodes
      is illegal (split brain condition).</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="TUNABLE_VARIABLES"><a class="permalink" href="#TUNABLE_VARIABLES">TUNABLE
  VARIABLES</a></h1>
<p class="Pp">The following variables are available as
    <a class="Xr">loader(8)</a> tunables:</p>
<dl class="Bl-tag">
  <dt id="kern.cam.ctl.max_luns"><var class="Va">kern.cam.ctl.max_luns</var></dt>
  <dd>Specifies the maximum number of LUNs we support, must be a power of 2. The
      default value is 1024.</dd>
  <dt id="kern.cam.ctl.max_ports"><var class="Va">kern.cam.ctl.max_ports</var></dt>
  <dd>Specifies the maximum number of ports we support, must be a power of 2.
      The default value is 1024.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">cfiscsi(4)</a>, <a class="Xr">cfumass(4)</a>,
    <a class="Xr">ctladm(8)</a>, <a class="Xr">ctld(8)</a>,
    <a class="Xr">ctlstat(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">ctl</code> subsystem first appeared in
    <span class="Ux">FreeBSD 9.1</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">The <code class="Nm">ctl</code> subsystem was originally written
    by <span class="An">Kenneth Merry</span>
    &lt;<a class="Mt" href="mailto:ken@FreeBSD.org">ken@FreeBSD.org</a>&gt;.
    Later work was done by
  <br/>
  <span class="An">Alexander Motin</span>
    &lt;<a class="Mt" href="mailto:mav@FreeBSD.org">mav@FreeBSD.org</a>&gt;.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">March 29, 2017</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>