Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
async_tx.h File Reference
#include <linux/dmaengine.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>

Go to the source code of this file.

Data Structures

struct  dma_chan_ref
 
struct  async_submit_ctl
 
union  addr_conv_t
 

Macros

#define __async_inline   __always_inline
 

Enumerations

enum  async_tx_flags { ASYNC_TX_XOR_ZERO_DST = (1 << 0), ASYNC_TX_XOR_DROP_DST = (1 << 1), ASYNC_TX_ACK = (1 << 2), ASYNC_TX_FENCE = (1 << 3) }
 

Functions

void async_tx_submit (struct dma_chan *chan, struct dma_async_tx_descriptor *tx, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_xor (struct page *dest, struct page **src_list, unsigned int offset, int src_cnt, size_t len, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_xor_val (struct page *dest, struct page **src_list, unsigned int offset, int src_cnt, size_t len, enum sum_check_flags *result, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_memcpy (struct page *dest, struct page *src, unsigned int dest_offset, unsigned int src_offset, size_t len, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_memset (struct page *dest, int val, unsigned int offset, size_t len, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_trigger_callback (struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_gen_syndrome (struct page **blocks, unsigned int offset, int src_cnt, size_t len, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_syndrome_val (struct page **blocks, unsigned int offset, int src_cnt, size_t len, enum sum_check_flags *pqres, struct page *spare, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_raid6_2data_recov (int src_num, size_t bytes, int faila, int failb, struct page **ptrs, struct async_submit_ctl *submit)
 
struct dma_async_tx_descriptorasync_raid6_datap_recov (int src_num, size_t bytes, int faila, struct page **ptrs, struct async_submit_ctl *submit)
 
void async_tx_quiesce (struct dma_async_tx_descriptor **tx)
 

Macro Definition Documentation

#define __async_inline   __always_inline

Definition at line 30 of file async_tx.h.

Enumeration Type Documentation

async_tx_flags - modifiers for the async_* calls : this flag must be used for xor operations where the the destination address is not a source. The asynchronous case handles this implicitly, the synchronous case needs to zero the destination block. : this flag must be used if the destination address is also one of the source addresses. In the synchronous case the destination address is an implied source, whereas the asynchronous case it must be listed as a source. The destination address must be the first address in the source array. : immediately ack the descriptor, precludes setting up a dependency chain : specify that the next operation in the dependency chain uses this operation's result as an input

Enumerator:
ASYNC_TX_XOR_ZERO_DST 
ASYNC_TX_XOR_DROP_DST 
ASYNC_TX_ACK 
ASYNC_TX_FENCE 

Definition at line 64 of file async_tx.h.

Function Documentation

struct dma_async_tx_descriptor* async_gen_syndrome ( struct page **  blocks,
unsigned int  offset,
int  disks,
size_t  len,
struct async_submit_ctl submit 
)
read

async_gen_syndrome - asynchronously calculate a raid6 syndrome : source blocks from idx 0..disks-3, P @ disks-2 and Q @ disks-1 : common offset into each block (src and dest) to start transaction : number of blocks (including missing P or Q, see below) : length of operation in bytes : submission/completion modifiers

General note: This routine assumes a field of GF(2^8) with a primitive polynomial of 0x11d and a generator of {02}.

'disks' note: callers can optionally omit either P or Q (but not both) from the calculation by setting blocks[disks-2] or blocks[disks-1] to NULL. When P or Q is omitted 'len' must be <= PAGE_SIZE as a temporary buffer of this size is used in the synchronous path. 'disks' always accounts for both destination buffers. If any source buffers (blocks[i] where i < disks - 2) are set to NULL those buffers will be replaced with the raid6_zero_page in the synchronous path and omitted in the hardware-asynchronous path.

'blocks' note: if submit->scribble is NULL then the contents of 'blocks' may be overwritten to perform address conversions (dma_map_page() or page_address()).

Definition at line 197 of file async_pq.c.

struct dma_async_tx_descriptor* async_memcpy ( struct page dest,
struct page src,
unsigned int  dest_offset,
unsigned int  src_offset,
size_t  len,
struct async_submit_ctl submit 
)
read

async_memcpy - attempt to copy memory with a dma engine. : destination page : src page : offset into 'dest' to start transaction : offset into 'src' to start transaction : length in bytes : submission / completion modifiers

honored flags: ASYNC_TX_ACK

Definition at line 45 of file async_memcpy.c.

struct dma_async_tx_descriptor* async_memset ( struct page dest,
int  val,
unsigned int  offset,
size_t  len,
struct async_submit_ctl submit 
)
read

async_memset - attempt to fill memory with a dma engine. : destination page : fill value : offset in pages to start transaction : length in bytes

honored flags: ASYNC_TX_ACK

Definition at line 42 of file async_memset.c.

struct dma_async_tx_descriptor* async_raid6_2data_recov ( int  disks,
size_t  bytes,
int  faila,
int  failb,
struct page **  blocks,
struct async_submit_ctl submit 
)
read

async_raid6_2data_recov - asynchronously calculate two missing data blocks : number of disks in the RAID-6 array : block size : first failed drive index : second failed drive index : array of source pointers where the last two entries are p and q : submission/completion modifiers

Definition at line 325 of file async_raid6_recov.c.

struct dma_async_tx_descriptor* async_raid6_datap_recov ( int  disks,
size_t  bytes,
int  faila,
struct page **  blocks,
struct async_submit_ctl submit 
)
read

async_raid6_datap_recov - asynchronously calculate a data and the 'p' block : number of disks in the RAID-6 array : block size : failed drive index : array of source pointers where the last two entries are p and q : submission/completion modifiers

Definition at line 398 of file async_raid6_recov.c.

struct dma_async_tx_descriptor* async_syndrome_val ( struct page **  blocks,
unsigned int  offset,
int  disks,
size_t  len,
enum sum_check_flags pqres,
struct page spare,
struct async_submit_ctl submit 
)
read

async_syndrome_val - asynchronously validate a raid6 syndrome : source blocks from idx 0..disks-3, P @ disks-2 and Q @ disks-1 : common offset into each block (src and dest) to start transaction : number of blocks (including missing P or Q, see below) : length of operation in bytes : on val failure SUM_CHECK_P_RESULT and/or SUM_CHECK_Q_RESULT are set : temporary result buffer for the synchronous case : submission / completion modifiers

The same notes from async_gen_syndrome apply to the 'blocks', and 'disks' parameters of this routine. The synchronous path requires a temporary result buffer and submit->scribble to be specified.

Definition at line 271 of file async_pq.c.

struct dma_async_tx_descriptor* async_trigger_callback ( struct async_submit_ctl submit)
read

async_trigger_callback - schedules the callback function to be run : submission and completion parameters

honored flags: ASYNC_TX_ACK

The callback is run after any dependent operations have completed.

Definition at line 234 of file async_tx.c.

void async_tx_quiesce ( struct dma_async_tx_descriptor **  tx)

async_tx_quiesce - ensure tx is complete and freeable upon return - transaction to quiesce

Definition at line 276 of file async_tx.c.

void async_tx_submit ( struct dma_chan chan,
struct dma_async_tx_descriptor tx,
struct async_submit_ctl submit 
)

Definition at line 156 of file async_tx.c.

struct dma_async_tx_descriptor* async_xor ( struct page dest,
struct page **  src_list,
unsigned int  offset,
int  src_cnt,
size_t  len,
struct async_submit_ctl submit 
)
read

async_xor - attempt to xor a set of blocks with a dma engine. : destination page : array of source pages : common src/dst offset to start transaction : number of source pages : length in bytes : submission / completion modifiers

honored flags: ASYNC_TX_ACK, ASYNC_TX_XOR_ZERO_DST, ASYNC_TX_XOR_DROP_DST

xor_blocks always uses the dest as a source so the ASYNC_TX_XOR_ZERO_DST flag must be set to not include dest data in the calculation. The assumption with dma eninges is that they only use the destination buffer as a source when it is explicity specified in the source list.

src_list note: if the dest is also a source it must be at index zero. The contents of this array will be overwritten if a scribble region is not specified.

Definition at line 186 of file async_xor.c.

struct dma_async_tx_descriptor* async_xor_val ( struct page dest,
struct page **  src_list,
unsigned int  offset,
int  src_cnt,
size_t  len,
enum sum_check_flags result,
struct async_submit_ctl submit 
)
read

async_xor_val - attempt a xor parity check with a dma engine. : destination page used if the xor is performed synchronously : array of source pages : offset in pages to start transaction : number of source pages : length in bytes

Returns
: 0 if sum == 0 else non-zero : submission / completion modifiers

honored flags: ASYNC_TX_ACK

src_list note: if the dest is also a source it must be at index zero. The contents of this array will be overwritten if a scribble region is not specified.

Definition at line 266 of file async_xor.c.