]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/da.4
da.4: Add some sysctl descriptions
[FreeBSD/FreeBSD.git] / share / man / man4 / da.4
1 .\" Copyright (c) 1996
2 .\"     Julian Elischer <julian@FreeBSD.org>.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\"
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 .\"
28 .Dd September 10, 2022
29 .Dt DA 4
30 .Os
31 .Sh NAME
32 .Nm da
33 .Nd SCSI Direct Access device driver
34 .Sh SYNOPSIS
35 .Cd device da
36 .Sh DESCRIPTION
37 The
38 .Nm
39 driver provides support for all
40 .Tn SCSI
41 devices of the direct access class that are attached to the system
42 through a supported
43 .Tn SCSI
44 Host Adapter.
45 The direct access class includes disk, magneto-optical,
46 and solid-state devices.
47 .Pp
48 A
49 .Tn SCSI
50 Host
51 adapter must also be separately configured into the system
52 before a
53 .Tn SCSI
54 direct access device can be configured.
55 .Sh CACHE EFFECTS
56 Many direct access devices are equipped with read and/or write caches.
57 Parameters affecting the device's cache are stored in mode page 8,
58 the caching control page.
59 Mode pages can be examined and modified via the
60 .Xr camcontrol 8
61 utility.
62 .Pp
63 The read cache is used to store data from device-initiated read ahead
64 operations as well as frequently used data.
65 The read cache is transparent
66 to the user and can be enabled without any adverse effect.
67 Most devices
68 with a read cache come from the factory with it enabled.
69 The read cache can be disabled by setting the
70 .Tn RCD
71 (Read Cache Disable) bit in the caching control mode page.
72 .Pp
73 The write cache can greatly decrease the latency of write operations
74 and allows the device to reorganize writes to increase efficiency and
75 performance.
76 This performance gain comes at a price.
77 Should the device
78 lose power while its cache contains uncommitted write operations, these
79 writes will be lost.
80 The effect of a loss of write transactions on
81 a file system is non-deterministic and can cause corruption.
82 Most
83 devices age write transactions to limit vulnerability to a few transactions
84 recently reported as complete, but it is none-the-less recommended that
85 systems with write cache enabled devices reside on an Uninterruptible
86 Power Supply (UPS).
87 The
88 .Nm
89 device driver ensures that the cache and media are synchronized upon
90 final close of the device or an unexpected shutdown (panic) event.
91 This ensures that it is safe to disconnect power once the operating system
92 has reported that it has halted.
93 The write cache can be enabled by setting the
94 .Tn WCE
95 (Write Cache Enable) bit in the caching control mode page.
96 .Sh TAGGED QUEUING
97 The
98 .Nm
99 device driver will take full advantage of the SCSI feature known as tagged
100 queueing.
101 Tagged queueing allows the device to process multiple transactions
102 concurrently, often re-ordering them to reduce the number and length of
103 seeks.
104 To ensure that transactions to distant portions of the media,
105 which may be deferred indefinitely by servicing requests nearer the current
106 head position, are completed in a timely fashion, an ordered tagged
107 transaction is sent every 15 seconds during continuous device operation.
108 .Sh BAD BLOCK RECOVERY
109 Direct Access devices have the capability of mapping out portions of
110 defective media.
111 Media recovery parameters are located in mode page 1,
112 the Read-Write Error Recovery mode page.
113 The most important media
114 remapping features are 'Auto Write Reallocation' and 'Auto Read
115 Reallocation' which can be enabled via the AWRE and ARRE bits,
116 respectively, of the Read-Write Error Recovery page.
117 Many devices do not ship from the factory with these feature enabled.
118 Mode pages can be examined and modified
119 via the
120 .Xr camcontrol 8
121 utility.
122 .Sh KERNEL CONFIGURATION
123 It is only necessary to explicitly configure one
124 .Nm
125 device; data structures are dynamically allocated as disks are found
126 on the
127 .Tn SCSI
128 bus.
129 .Sh SYSCTL VARIABLES
130 The following variables are available as both
131 .Xr sysctl 8
132 variables and
133 .Xr loader 8
134 tunables:
135 .Bl -tag -width 12
136 .It Va kern.cam.da.default_softtimeout
137 Soft I/O timeout (ms). The default is 0.
138 Attempting to set this value to a
139 time span longer than
140 .It kern.cam.da.default_timeout
141 will return
142 .Dv EINVAL .
143 .It Va kern.cam.da.default_timeout
144 This variable determines how long the
145 .Nm
146 driver will wait before timing out an outstanding command.
147 The units for this value are seconds, and the default is currently 60
148 seconds.
149 .It Va kern.cam.da.disable_wp_protection
150 Disable detection of write-protected disks.
151 Default is disabled.
152 .Po
153 detection of write-protected disks is enabled
154 .Pc .
155 .It Va kern.cam.da.enable_biospeedup
156 Enable
157 .Dv BIO_SPEEDUP
158 processing.
159 Default is enabled.
160 .It Va kern.cam.da.enable_uma_ccbs
161 Use UMA for CCBs.
162 Default is enabled.
163 .It Va kern.cam.da.poll_period
164 Media polling period in seconds.
165 Default is 3 seconds.
166 .It Va kern.cam.da.retry_count
167 This variable determines how many times the
168 .Nm
169 driver will retry a READ or WRITE command.
170 This does not affect the number of retries used during probe time or for
171 the
172 .Nm
173 driver dump routine.
174 This value currently defaults to 4.
175 .It Va kern.cam.da.send_ordered
176 Send Ordered Tags.
177 On shutdown, step through all the
178 .Nm
179 peripheral drivers, and if the device is still open,
180 sync the disk to physical media.
181 Default is enabled.
182 .It Va kern.cam.sort_io_queue
183 .It Va kern.cam.da . Ns Ar X Ns Va .sort_io_queue
184 These variables determine whether request queue should be sorted trying
185 to optimize head seeks.
186 Set to 1 to enable sorting, 0 to disable, -1 to leave it as-is.
187 The default is sorting enabled for HDDs and disabled for SSDs.
188 .It Va kern.cam.da . Ns Ar X Ns Va .delete_method
189 This variable specifies method to handle BIO_DELETE requests:
190 .Bl -tag -width "ATA_TRIM"
191 .It ATA_TRIM
192 ATA TRIM via ATA COMMAND PASS THROUGH command,
193 .It UNMAP
194 UNMAP command,
195 .It WS16
196 WRITE SAME(16) command with UNMAP flag,
197 .It WS10
198 WRITE SAME(10) command with UNMAP flag,
199 .It ZERO
200 WRITE SAME(10) command without UNMAP flag,
201 .It DISABLE
202 disable BIO_DELETE support.
203 .El
204 .It Va kern.cam.da . Ns Ar X Ns Va .minimum_cmd_size
205 This variable determines what the minimum READ/WRITE CDB size is for a
206 given
207 .Nm
208 unit.
209 Valid minimum command size values are 6, 10, 12 and 16 bytes.
210 The default is 6 bytes.
211 .Pp
212 The
213 .Nm
214 driver issues a CAM Path Inquiry CCB at probe time to determine whether the
215 protocol the device in question speaks (e.g.\& ATAPI) typically does not allow
216 6 byte commands.
217 If it does not, the
218 .Nm
219 driver will default to using at least 10 byte CDBs.
220 If a 6 byte READ or WRITE fails with an ILLEGAL REQUEST error, the
221 .Nm
222 driver will then increase the default CDB size for the device to 10 bytes and
223 retry the command.
224 CDB size is always
225 chosen as the smallest READ/WRITE CDB that will satisfy the specified minimum
226 command size, and the LBA and length of the READ or WRITE in question.
227 (e.g., a write to an LBA larger than 2^32 will require a 16 byte CDB.)
228 .El
229 .Sh NOTES
230 If a device becomes invalidated (media is removed, device becomes unresponsive)
231 the disklabel and information held within the kernel about the device will
232 be invalidated.
233 To avoid corruption of a newly inserted piece of media or
234 a replacement device, all accesses to the device will be discarded until
235 the last file descriptor referencing the old device is closed.
236 During this period, all new open attempts will be rejected.
237 .Sh FILES
238 .Bl -tag -width ".Pa /dev/da*" -compact
239 .It Pa /dev/da*
240 SCSI disk device nodes
241 .El
242 .Sh DIAGNOSTICS
243 None.
244 .Sh SEE ALSO
245 .Xr ada 4 ,
246 .Xr cam 4 ,
247 .Xr geom 4 ,
248 .Xr nda 4 ,
249 .Xr gpart 8
250 .Sh HISTORY
251 The
252 .Nm
253 driver was written for the
254 .Tn CAM
255 .Tn SCSI
256 subsystem by
257 .An Justin T. Gibbs .
258 Many ideas were gleaned from the
259 .Nm sd
260 device driver written and ported from
261 .Tn Mach
262 2.5
263 by
264 .An Julian Elischer .