1*e974f91cSConrad Meyer.\" Copyright (c) 2015 EMC / Isilon Storage Division 2*e974f91cSConrad Meyer.\" All rights reserved. 3*e974f91cSConrad Meyer.\" 4*e974f91cSConrad Meyer.\" Redistribution and use in source and binary forms, with or without 5*e974f91cSConrad Meyer.\" modification, are permitted provided that the following conditions 6*e974f91cSConrad Meyer.\" are met: 7*e974f91cSConrad Meyer.\" 1. Redistributions of source code must retain the above copyright 8*e974f91cSConrad Meyer.\" notice, this list of conditions and the following disclaimer. 9*e974f91cSConrad Meyer.\" 2. Redistributions in binary form must reproduce the above copyright 10*e974f91cSConrad Meyer.\" notice, this list of conditions and the following disclaimer in the 11*e974f91cSConrad Meyer.\" documentation and/or other materials provided with the distribution. 12*e974f91cSConrad Meyer.\" 13*e974f91cSConrad Meyer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 14*e974f91cSConrad Meyer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15*e974f91cSConrad Meyer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16*e974f91cSConrad Meyer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 17*e974f91cSConrad Meyer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18*e974f91cSConrad Meyer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19*e974f91cSConrad Meyer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20*e974f91cSConrad Meyer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21*e974f91cSConrad Meyer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22*e974f91cSConrad Meyer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23*e974f91cSConrad Meyer.\" SUCH DAMAGE. 24*e974f91cSConrad Meyer.\" 25*e974f91cSConrad Meyer.\" $FreeBSD$ 26*e974f91cSConrad Meyer.\" 27*e974f91cSConrad Meyer.Dd August 24, 2015 28*e974f91cSConrad Meyer.Dt IOAT 4 29*e974f91cSConrad Meyer.Os 30*e974f91cSConrad Meyer.Sh NAME 31*e974f91cSConrad Meyer.Nm I/OAT 32*e974f91cSConrad Meyer.Nd Intel I/O Acceleration Technology 33*e974f91cSConrad Meyer.Sh SYNOPSIS 34*e974f91cSConrad Meyer.Cd "device ioat" 35*e974f91cSConrad MeyerIn 36*e974f91cSConrad Meyer.Xr loader.conf 5 : 37*e974f91cSConrad Meyer.Pp 38*e974f91cSConrad Meyer.Cd hw.ioat.force_legacy_interrupts=0 39*e974f91cSConrad Meyer.Pp 40*e974f91cSConrad MeyerIn 41*e974f91cSConrad Meyer.Xr loader.conf 5 or 42*e974f91cSConrad Meyer.Xr sysctl.conf 5 : 43*e974f91cSConrad Meyer.Pp 44*e974f91cSConrad Meyer.Cd hw.ioat.enable_ioat_test=0 45*e974f91cSConrad Meyer.Cd hw.ioat.debug_level=0 46*e974f91cSConrad Meyer(only critical errors; maximum of 3) 47*e974f91cSConrad Meyer.Pp 48*e974f91cSConrad Meyer.Ft typedef void 49*e974f91cSConrad Meyer.Fn (*bus_dmaengine_callback_t) "void *arg" 50*e974f91cSConrad Meyer.Pp 51*e974f91cSConrad Meyer.Ft bus_dmaengine_t 52*e974f91cSConrad Meyer.Fn ioat_get_dmaengine "uint32_t channel_index" 53*e974f91cSConrad Meyer.Ft void 54*e974f91cSConrad Meyer.Fn ioat_acquire "bus_dmaengine_t dmaengine" 55*e974f91cSConrad Meyer.Ft void 56*e974f91cSConrad Meyer.Fn ioat_release "bus_dmaengine_t dmaengine" 57*e974f91cSConrad Meyer.Ft struct bus_dmadesc * 58*e974f91cSConrad Meyer.Fo ioat_copy 59*e974f91cSConrad Meyer.Fa "bus_dmaengine_t dmaengine" 60*e974f91cSConrad Meyer.Fa "bus_addr_t dst" 61*e974f91cSConrad Meyer.Fa "bus_addr_t src" 62*e974f91cSConrad Meyer.Fa "bus_size_t len" 63*e974f91cSConrad Meyer.Fa "bus_dmaengine_callback_t callback_fn" 64*e974f91cSConrad Meyer.Fa "void *callback_arg" 65*e974f91cSConrad Meyer.Fa "uint32_t flags" 66*e974f91cSConrad Meyer.Fc 67*e974f91cSConrad Meyer.Ft struct bus_dmadesc * 68*e974f91cSConrad Meyer.Fo ioat_null 69*e974f91cSConrad Meyer.Fa "bus_dmaengine_t dmaengine" 70*e974f91cSConrad Meyer.Fa "bus_dmaengine_callback_t callback_fn" 71*e974f91cSConrad Meyer.Fa "void *callback_arg" 72*e974f91cSConrad Meyer.Fa "uint32_t flags" 73*e974f91cSConrad Meyer.Fc 74*e974f91cSConrad Meyer.Sh DESCRIPTION 75*e974f91cSConrad MeyerThe 76*e974f91cSConrad Meyer.Nm 77*e974f91cSConrad Meyerdriver provides a kernel API to a variety of DMA engines on some Intel server 78*e974f91cSConrad Meyerplatforms. 79*e974f91cSConrad Meyer.Pp 80*e974f91cSConrad MeyerThere is a number of DMA channels per CPU package. 81*e974f91cSConrad Meyer(Typically 4 or 8.) 82*e974f91cSConrad MeyerEach may be used independently. 83*e974f91cSConrad MeyerOperations on a single channel proceed sequentially. 84*e974f91cSConrad Meyer.Pp 85*e974f91cSConrad MeyerCopy operations may be used to offload memory copies to the DMA engines. 86*e974f91cSConrad Meyer.Pp 87*e974f91cSConrad MeyerNull operations do nothing, but may be used to test the interrupt and callback 88*e974f91cSConrad Meyermechanism. 89*e974f91cSConrad Meyer.Pp 90*e974f91cSConrad MeyerAll operations can optionally trigger an interrupt at completion with the 91*e974f91cSConrad Meyer.Ar DMA_EN_INT 92*e974f91cSConrad Meyerflag. 93*e974f91cSConrad MeyerFor example, a user might submit multiple operations to the same channel and 94*e974f91cSConrad Meyeronly enable an interrupt and callback for the last operation. 95*e974f91cSConrad Meyer.Sh USAGE 96*e974f91cSConrad MeyerA typical user will lookup the DMA engine object for a given channel with 97*e974f91cSConrad Meyer.Fn ioat_get_dmaengine . 98*e974f91cSConrad MeyerWhen the user wants to offload a copy, they will first 99*e974f91cSConrad Meyer.Fn ioat_acquire 100*e974f91cSConrad Meyerthe 101*e974f91cSConrad Meyer.Ar bus_dmaengine_t 102*e974f91cSConrad Meyerobject for exclusive access to enqueue operations on that channel. 103*e974f91cSConrad MeyerThen, they will submit one or more operations using 104*e974f91cSConrad Meyer.Fn ioat_copy 105*e974f91cSConrad Meyeror 106*e974f91cSConrad Meyer.Fn ioat_null . 107*e974f91cSConrad MeyerFinally, they will 108*e974f91cSConrad Meyer.Fn ioat_release 109*e974f91cSConrad Meyerthe 110*e974f91cSConrad Meyer.Ar bus_dmaengine_t 111*e974f91cSConrad Meyerto drop their exclusive access to the channel. 112*e974f91cSConrad MeyerThe routine they provided for the 113*e974f91cSConrad Meyer.Fa callback_fn 114*e974f91cSConrad Meyerargument will be invoked with the provided 115*e974f91cSConrad Meyer.Fa callback_arg 116*e974f91cSConrad Meyerwhen the operation is complete. 117*e974f91cSConrad Meyer.Pp 118*e974f91cSConrad MeyerFor an example of usage, see 119*e974f91cSConrad Meyer.Pa src/sys/dev/ioat/ioat_test.c . 120*e974f91cSConrad Meyer.Sh FILES 121*e974f91cSConrad Meyer.Bl -tag -compat 122*e974f91cSConrad Meyer.It Pa /dev/ioat_test 123*e974f91cSConrad Meyertest device for 124*e974f91cSConrad Meyer.Xr ioatcontrol 8 125*e974f91cSConrad Meyer.El 126*e974f91cSConrad Meyer.Sh SEE ALSO 127*e974f91cSConrad Meyer.Xr ioatcontrol 8 128*e974f91cSConrad Meyer.Sh HISTORY 129*e974f91cSConrad MeyerThe 130*e974f91cSConrad Meyer.Nm 131*e974f91cSConrad Meyerdriver first appeared in 132*e974f91cSConrad Meyer.Fx 11.0 . 133*e974f91cSConrad Meyer.Sh AUTHORS 134*e974f91cSConrad MeyerThe 135*e974f91cSConrad Meyer.Nm 136*e974f91cSConrad Meyerdriver was developed by 137*e974f91cSConrad Meyer.An \&Jim Harris Aq Mt jimharris@FreeBSD.org , 138*e974f91cSConrad Meyerand 139*e974f91cSConrad Meyer.An \&Carl Delsey Aq Mt carl.r.delsey@intel.com . 140*e974f91cSConrad MeyerThis manual page was written by 141*e974f91cSConrad Meyer.An \&Conrad Meyer Aq Mt cem@FreeBSD.org . 142*e974f91cSConrad Meyer.Sh CAVEATS 143*e974f91cSConrad MeyerCopy operation takes bus addresses as parameters, not virtual addresses. 144*e974f91cSConrad Meyer.Pp 145*e974f91cSConrad MeyerCopies larger than max transfer size (1MB) are not supported. 146*e974f91cSConrad MeyerFuture versions will likely support this by breaking up the transfer into 147*e974f91cSConrad Meyersmaller sizes. 148*e974f91cSConrad Meyer.Sh BUGS 149*e974f91cSConrad MeyerThe 150*e974f91cSConrad Meyer.Nm 151*e974f91cSConrad Meyerdriver only supports copy and null operations at this time. 152*e974f91cSConrad MeyerThe driver does not yet support advanced DMA modes, such as XOR, that some 153*e974f91cSConrad MeyerI/OAT devices support. 154