1 .\" Copyright (c) 2015 EMC / Isilon Storage Division
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd Intel I/O Acceleration Technology
34 To compile this driver into your kernel,
35 place the following line in your kernel configuration file:
36 .Bd -ragged -offset indent
40 Or, to load the driver as a module at boot, place the following line in
42 .Bd -literal -offset indent
49 .Cd hw.ioat.force_legacy_interrupts=0
55 .Cd hw.ioat.enable_ioat_test=0
56 .Cd hw.ioat.debug_level=0
57 (only critical errors; maximum of 3)
60 .Fn (*bus_dmaengine_callback_t) "void *arg" "int error"
63 .Fn ioat_get_dmaengine "uint32_t channel_index"
65 .Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine"
67 .Fn ioat_get_hwversion "bus_dmaengine_t dmaengine"
69 .Fn ioat_set_interrupt_coalesce "bus_dmaengine_t dmaengine" "uint16_t delay"
71 .Fn ioat_get_max_coalesce_period "bus_dmaengine_t dmaengine"
73 .Fn ioat_acquire "bus_dmaengine_t dmaengine"
75 .Fn ioat_release "bus_dmaengine_t dmaengine"
76 .Ft struct bus_dmadesc *
78 .Fa "bus_dmaengine_t dmaengine"
82 .Fa "bus_dmaengine_callback_t callback_fn"
83 .Fa "void *callback_arg"
86 .Ft struct bus_dmadesc *
87 .Fo ioat_copy_8k_aligned
88 .Fa "bus_dmaengine_t dmaengine"
93 .Fa "bus_dmaengine_callback_t callback_fn"
94 .Fa "void *callback_arg"
97 .Ft struct bus_dmadesc *
99 .Fa "bus_dmaengine_t dmaengine"
101 .Fa "uint64_t fillpattern"
103 .Fa "bus_dmaengine_callback_t callback_fn"
104 .Fa "void *callback_arg"
107 .Ft struct bus_dmadesc *
109 .Fa "bus_dmaengine_t dmaengine"
110 .Fa "bus_dmaengine_callback_t callback_fn"
111 .Fa "void *callback_arg"
117 driver provides a kernel API to a variety of DMA engines on some Intel server
120 There is a number of DMA channels per CPU package.
122 Each may be used independently.
123 Operations on a single channel proceed sequentially.
125 Blockfill operations can be used to write a 64-bit pattern to memory.
127 Copy operations can be used to offload memory copies to the DMA engines.
129 Null operations do nothing, but may be used to test the interrupt and callback
132 All operations can optionally trigger an interrupt at completion with the
135 For example, a user might submit multiple operations to the same channel and
136 only enable an interrupt and callback for the last operation.
138 The hardware can delay and coalesce interrupts on a given channel for a
139 configurable period of time, in microseconds.
140 This may be desired to reduce the processing and interrupt overhead per
141 descriptor, especially for workflows consisting of many small operations.
142 Software can control this on a per-channel basis with the
143 .Fn ioat_set_interrupt_coalesce
146 .Fn ioat_get_max_coalesce_period
147 API can be used to determine the maximum coalescing period supported by the
148 hardware, in microseconds.
149 Current platforms support up to a 16.383 millisecond coalescing period.
150 Optimal configuration will vary by workflow and desired operation latency.
152 All operations are safe to use in a non-blocking context with the
155 (Of course, allocations may fail and operations requested with
159 All operations, as well as
160 .Fn ioat_get_dmaengine ,
161 can return NULL in special circumstances.
164 driver is being unloaded, or the administrator has induced a hardware reset, or
165 a usage error has resulted in a hardware error state that needs to be recovered
168 It is invalid to attempt to submit new DMA operations in a
169 .Fa bus_dmaengine_callback_t
172 A typical user will lookup the DMA engine object for a given channel with
173 .Fn ioat_get_dmaengine .
174 When the user wants to offload a copy, they will first
178 object for exclusive access to enqueue operations on that channel.
179 Then, they will submit one or more operations using
184 After queuing one or more individual DMA operations, they will
188 to drop their exclusive access to the channel.
189 The routine they provided for the
191 argument will be invoked with the provided
193 when the operation is complete.
194 When they are finished with the
195 .Ar bus_dmaengine_t ,
197 .Fn ioat_put_dmaengine .
199 Users MUST NOT block between
203 Users SHOULD NOT hold
205 references for a very long time to enable fault recovery and kernel module
208 For an example of usage, see
209 .Pa src/sys/dev/ioat/ioat_test.c .
212 .It Pa /dev/ioat_test
221 driver first appeared in
226 driver was developed by
227 .An \&Jim Harris Aq Mt jimharris@FreeBSD.org ,
228 .An \&Carl Delsey Aq Mt carl.r.delsey@intel.com ,
230 .An \&Conrad Meyer Aq Mt cem@FreeBSD.org .
231 This manual page was written by
232 .An \&Conrad Meyer Aq Mt cem@FreeBSD.org .
234 Copy operation takes bus addresses as parameters, not virtual addresses.
236 Buffers for individual copy operations must be physically contiguous.
238 Copies larger than max transfer size (1MB, but may vary by hardware) are not
240 Future versions will likely support this by breaking up the transfer into
245 driver only supports blockfill, copy, and null operations at this time.
246 The driver does not yet support advanced DMA modes, such as XOR, that some
247 I/OAT devices support.