Loading...
Searching...
No Matches
accel.h File Reference

Acceleration Framework. More...

Data Structures

struct  spdk_accel_crypto_key_create_param
 
struct  spdk_accel_opts
 
struct  spdk_accel_opcode_stats
 
struct  spdk_accel_operation_exec_ctx
 Context for the spdk_accel_get_buf_align() function. More...
 

Macros

#define SPDK_ACCEL_AES_XTS_128_KEY_SIZE   16
 
#define SPDK_ACCEL_AES_XTS_256_KEY_SIZE   32
 

Typedefs

typedef void(* spdk_accel_completion_cb) (void *cb_arg, int status)
 Acceleration operation callback.
 
typedef void(* spdk_accel_fini_cb) (void *cb_arg)
 Acceleration framework finish callback.
 
typedef void(* spdk_accel_step_cb) (void *cb_arg)
 Completion callback of a single operation within a sequence.
 

Enumerations

enum  spdk_accel_comp_algo { SPDK_ACCEL_COMP_ALGO_DEFLATE = 0 , SPDK_ACCEL_COMP_ALGO_LZ4 }
 
enum  spdk_accel_opcode {
  SPDK_ACCEL_OPC_COPY = 0 , SPDK_ACCEL_OPC_FILL = 1 , SPDK_ACCEL_OPC_DUALCAST = 2 , SPDK_ACCEL_OPC_COMPARE = 3 ,
  SPDK_ACCEL_OPC_CRC32C = 4 , SPDK_ACCEL_OPC_COPY_CRC32C = 5 , SPDK_ACCEL_OPC_COMPRESS = 6 , SPDK_ACCEL_OPC_DECOMPRESS = 7 ,
  SPDK_ACCEL_OPC_ENCRYPT = 8 , SPDK_ACCEL_OPC_DECRYPT = 9 , SPDK_ACCEL_OPC_XOR = 10 , SPDK_ACCEL_OPC_DIF_VERIFY = 11 ,
  SPDK_ACCEL_OPC_DIF_VERIFY_COPY = 12 , SPDK_ACCEL_OPC_DIF_GENERATE = 13 , SPDK_ACCEL_OPC_DIF_GENERATE_COPY = 14 , SPDK_ACCEL_OPC_DIX_GENERATE = 15 ,
  SPDK_ACCEL_OPC_DIX_VERIFY = 16 , SPDK_ACCEL_OPC_LAST = 17
}
 
enum  spdk_accel_cipher { SPDK_ACCEL_CIPHER_AES_CBC , SPDK_ACCEL_CIPHER_AES_XTS }
 

Functions

int spdk_accel_initialize (void)
 Initialize the acceleration framework.
 
void spdk_accel_finish (spdk_accel_fini_cb cb_fn, void *cb_arg)
 Close the acceleration framework.
 
struct spdk_io_channel * spdk_accel_get_io_channel (void)
 Get an I/O channel for the acceleration framework.
 
int spdk_accel_crypto_key_create (const struct spdk_accel_crypto_key_create_param *param)
 Create a crypto key with given parameters.
 
int spdk_accel_crypto_key_destroy (struct spdk_accel_crypto_key *key)
 Destroy a crypto key.
 
struct spdk_accel_crypto_keyspdk_accel_crypto_key_get (const char *name)
 Find a crypto key structure by name.
 
int spdk_accel_submit_copy (struct spdk_io_channel *ch, void *dst, void *src, uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a copy request.
 
int spdk_accel_submit_dualcast (struct spdk_io_channel *ch, void *dst1, void *dst2, void *src, uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a dual cast copy request.
 
int spdk_accel_submit_compare (struct spdk_io_channel *ch, void *src1, void *src2, uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a compare request.
 
int spdk_accel_submit_fill (struct spdk_io_channel *ch, void *dst, uint8_t fill, uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a fill request.
 
int spdk_accel_submit_crc32c (struct spdk_io_channel *ch, uint32_t *crc_dst, void *src, uint32_t seed, uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a CRC-32C calculation request.
 
int spdk_accel_submit_crc32cv (struct spdk_io_channel *ch, uint32_t *crc_dst, struct iovec *iovs, uint32_t iovcnt, uint32_t seed, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a chained CRC-32C calculation request.
 
int spdk_accel_submit_copy_crc32c (struct spdk_io_channel *ch, void *dst, void *src, uint32_t *crc_dst, uint32_t seed, uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a copy with CRC-32C calculation request.
 
int spdk_accel_submit_copy_crc32cv (struct spdk_io_channel *ch, void *dst, struct iovec *src_iovs, uint32_t iovcnt, uint32_t *crc_dst, uint32_t seed, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a chained copy + CRC-32C calculation request.
 
int spdk_accel_submit_compress (struct spdk_io_channel *ch, void *dst, uint64_t nbytes, struct iovec *src_iovs, size_t src_iovcnt, uint32_t *output_size, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Build and submit a memory compress request using the deflate algorithm.
 
int spdk_accel_submit_decompress (struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct iovec *src_iovs, size_t src_iovcnt, uint32_t *output_size, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Build and submit a memory decompress request using the deflate algorithm.
 
int spdk_accel_submit_compress_ext (struct spdk_io_channel *ch, void *dst, uint64_t nbytes, struct iovec *src_iovs, size_t src_iovcnt, enum spdk_accel_comp_algo comp_algo, uint32_t comp_level, uint32_t *output_size, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Build and submit a memory compress request using the specified algorithm.
 
int spdk_accel_submit_decompress_ext (struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct iovec *src_iovs, size_t src_iovcnt, enum spdk_accel_comp_algo decomp_algo, uint32_t *output_size, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Build and submit a memory decompress request using the specified algorithm.
 
int spdk_accel_get_compress_level_range (enum spdk_accel_comp_algo comp_algo, uint32_t *min_level, uint32_t *max_level)
 Gets the level range of the specified algorithm.
 
int spdk_accel_submit_xor (struct spdk_io_channel *ch, void *dst, void **sources, uint32_t nsrcs, uint64_t nbytes, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit an xor request.
 
int spdk_accel_submit_encrypt (struct spdk_io_channel *ch, struct spdk_accel_crypto_key *key, struct iovec *dst_iovs, uint32_t dst_iovcnt, struct iovec *src_iovs, uint32_t src_iovcnt, uint64_t iv, uint32_t block_size, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Build and submit a data encryption request.
 
int spdk_accel_submit_decrypt (struct spdk_io_channel *ch, struct spdk_accel_crypto_key *key, struct iovec *dst_iovs, uint32_t dst_iovcnt, struct iovec *src_iovs, uint32_t src_iovcnt, uint64_t iv, uint32_t block_size, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Build and submit a data decryption request.
 
int spdk_accel_submit_dif_verify (struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, struct spdk_dif_error *err, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a Data Integrity Field (DIF) verify request.
 
int spdk_accel_submit_dif_verify_copy (struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct iovec *src_iovs, size_t src_iovcnt, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, struct spdk_dif_error *err, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a Data Integrity Field (DIF) copy and verify request.
 
int spdk_accel_submit_dif_generate (struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a Data Integrity Field (DIF) generate request.
 
int spdk_accel_submit_dif_generate_copy (struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct iovec *src_iovs, size_t src_iovcnt, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a Data Integrity Field (DIF) copy and generate request.
 
int spdk_accel_submit_dix_generate (struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, struct iovec *md_iov, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a Data Integrity Extension (DIX) generate operation.
 
int spdk_accel_submit_dix_verify (struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, struct iovec *md_iov, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, struct spdk_dif_error *err, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Submit a Data Integrity Extension (DIX) verify request.
 
int spdk_accel_append_copy (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *dst_iovs, uint32_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx, struct iovec *src_iovs, uint32_t src_iovcnt, struct spdk_memory_domain *src_domain, void *src_domain_ctx, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a copy operation to a sequence.
 
int spdk_accel_append_fill (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, void *buf, uint64_t len, struct spdk_memory_domain *domain, void *domain_ctx, uint8_t pattern, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a fill operation to a sequence.
 
int spdk_accel_append_decompress_ext (struct spdk_accel_sequence **pseq, struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx, struct iovec *src_iovs, size_t src_iovcnt, struct spdk_memory_domain *src_domain, void *src_domain_ctx, enum spdk_accel_comp_algo decomp_algo, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a decompression operation using the specified algorithm to a sequence.
 
int spdk_accel_append_decompress (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx, struct iovec *src_iovs, size_t src_iovcnt, struct spdk_memory_domain *src_domain, void *src_domain_ctx, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a decompression operation using the deflate algorithm to a sequence.
 
int spdk_accel_append_encrypt (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct spdk_accel_crypto_key *key, struct iovec *dst_iovs, uint32_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx, struct iovec *src_iovs, uint32_t src_iovcnt, struct spdk_memory_domain *src_domain, void *src_domain_ctx, uint64_t iv, uint32_t block_size, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append an encrypt operation to a sequence.
 
int spdk_accel_append_decrypt (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct spdk_accel_crypto_key *key, struct iovec *dst_iovs, uint32_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx, struct iovec *src_iovs, uint32_t src_iovcnt, struct spdk_memory_domain *src_domain, void *src_domain_ctx, uint64_t iv, uint32_t block_size, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a decrypt operation to a sequence.
 
int spdk_accel_append_crc32c (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, uint32_t *dst, struct iovec *iovs, uint32_t iovcnt, struct spdk_memory_domain *domain, void *domain_ctx, uint32_t seed, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a crc32c operation to a sequence.
 
int spdk_accel_append_dif_verify (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, struct spdk_memory_domain *domain, void *domain_ctx, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, struct spdk_dif_error *err, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a Data Integrity Field (DIF) verify operation to a sequence.
 
int spdk_accel_append_dif_verify_copy (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx, struct iovec *src_iovs, size_t src_iovcnt, struct spdk_memory_domain *src_domain, void *src_domain_ctx, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, struct spdk_dif_error *err, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a Data Integrity Field (DIF) copy and verify operation to a sequence.
 
int spdk_accel_append_dif_generate (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, struct spdk_memory_domain *domain, void *domain_ctx, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append a Data Integrity Field (DIF) generate operation to a sequence.
 
int spdk_accel_append_dif_generate_copy (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *dst_iovs, size_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx, struct iovec *src_iovs, size_t src_iovcnt, struct spdk_memory_domain *src_domain, void *src_domain_ctx, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, spdk_accel_step_cb cb_fn, void *cb_arg)
 Submit a Data Integrity Field (DIF) copy and generate request.
 
int spdk_accel_append_dix_generate (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, struct spdk_memory_domain *domain, void *domain_ctx, struct iovec *md_iov, struct spdk_memory_domain *md_domain, void *md_domain_ctx, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append DIX generate operation to a sequence.
 
int spdk_accel_append_dix_verify (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *iovs, size_t iovcnt, struct spdk_memory_domain *domain, void *domain_ctx, struct iovec *md_iov, struct spdk_memory_domain *md_domain, void *md_domain_ctx, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, struct spdk_dif_error *err, spdk_accel_step_cb cb_fn, void *cb_arg)
 Append DIX verify operation to a sequence.
 
void spdk_accel_sequence_finish (struct spdk_accel_sequence *seq, spdk_accel_completion_cb cb_fn, void *cb_arg)
 Finish a sequence and execute all its operations.
 
void spdk_accel_sequence_reverse (struct spdk_accel_sequence *seq)
 Reverse a sequence, so that the last operation becomes the first and vice versa.
 
void spdk_accel_sequence_abort (struct spdk_accel_sequence *seq)
 Abort a sequence.
 
int spdk_accel_get_buf (struct spdk_io_channel *ch, uint64_t len, void **buf, struct spdk_memory_domain **domain, void **domain_ctx)
 Allocate a buffer from accel domain.
 
void spdk_accel_put_buf (struct spdk_io_channel *ch, void *buf, struct spdk_memory_domain *domain, void *domain_ctx)
 Release a buffer allocated via spdk_accel_get_buf().
 
int spdk_accel_get_opc_module_name (enum spdk_accel_opcode opcode, const char **module_name)
 Return the name of the module assigned to a specific opcode.
 
int spdk_accel_assign_opc (enum spdk_accel_opcode opcode, const char *name)
 Override the assignment of an opcode to an module.
 
void spdk_accel_write_config_json (struct spdk_json_write_ctx *w)
 Write Acceleration subsystem configuration into provided JSON context.
 
int spdk_accel_set_driver (const char *name)
 Select platform driver to execute operation chains.
 
const char * spdk_accel_get_driver_name (void)
 Get platform driver name.
 
struct spdk_memory_domain * spdk_accel_get_memory_domain (void)
 Retrieves accel memory domain.
 
int spdk_accel_set_opts (const struct spdk_accel_opts *opts)
 Set the options for the accel framework.
 
void spdk_accel_get_opts (struct spdk_accel_opts *opts, size_t opts_size)
 Get the options for the accel framework.
 
void spdk_accel_get_opcode_stats (struct spdk_io_channel *ch, enum spdk_accel_opcode opcode, struct spdk_accel_opcode_stats *stats, size_t size)
 Retrieve opcode statistics for a given IO channel.
 
uint8_t spdk_accel_get_buf_align (enum spdk_accel_opcode opcode, const struct spdk_accel_operation_exec_ctx *ctx)
 Get minimum buffer alignment to execute a given operation.
 
int spdk_accel_get_opc_memory_domains (enum spdk_accel_opcode opcode, struct spdk_memory_domain **domains, int array_size)
 Return memory domains used by specific opcode.
 
const char * spdk_accel_get_opcode_name (enum spdk_accel_opcode opcode)
 Return the name of an operation based on the opcode.
 

Detailed Description

Acceleration Framework.

Typedef Documentation

◆ spdk_accel_completion_cb

typedef void(* spdk_accel_completion_cb) (void *cb_arg, int status)

Acceleration operation callback.

Parameters
cb_argCallback argument specified in the spdk_accel_submit* call.
status0 if it completed successfully, or negative errno if it failed.

◆ spdk_accel_fini_cb

typedef void(* spdk_accel_fini_cb) (void *cb_arg)

Acceleration framework finish callback.

Parameters
cb_argCallback argument.

◆ spdk_accel_step_cb

typedef void(* spdk_accel_step_cb) (void *cb_arg)

Completion callback of a single operation within a sequence.

After it's executed, the sequence object might be freed, so users should not touch it.

Function Documentation

◆ spdk_accel_append_copy()

int spdk_accel_append_copy ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * dst_iovs,
uint32_t dst_iovcnt,
struct spdk_memory_domain * dst_domain,
void * dst_domain_ctx,
struct iovec * src_iovs,
uint32_t src_iovcnt,
struct spdk_memory_domain * src_domain,
void * src_domain_ctx,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a copy operation to a sequence.

Copy operation in a sequence is special, as it is not guaranteed that the data will be actually copied. If it's possible, it will only change source / destination buffers of some of the operations in a sequence.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
dst_iovsDestination I/O vector array.
dst_iovcntSize of the dst_iovs array.
dst_domainMemory domain to which the destination buffers belong.
dst_domain_ctxDestination buffer domain context.
src_iovsSource I/O vector array.
src_iovcntSize of the src_iovs array.
src_domainMemory domain to which the source buffers belong.
src_domain_ctxSource buffer domain context.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno otherwise.

◆ spdk_accel_append_crc32c()

int spdk_accel_append_crc32c ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
uint32_t * dst,
struct iovec * iovs,
uint32_t iovcnt,
struct spdk_memory_domain * domain,
void * domain_ctx,
uint32_t seed,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a crc32c operation to a sequence.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
dstDestination to write the calculated value.
iovsSource I/O vector array.
iovcntSize of the iovs array.
domainMemory domain to which the source buffers belong.
domain_ctxSource buffer domain context.
seedInitial value.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno otherwise.

◆ spdk_accel_append_decompress()

int spdk_accel_append_decompress ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct spdk_memory_domain * dst_domain,
void * dst_domain_ctx,
struct iovec * src_iovs,
size_t src_iovcnt,
struct spdk_memory_domain * src_domain,
void * src_domain_ctx,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a decompression operation using the deflate algorithm to a sequence.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
dst_iovsDestination I/O vector array.
dst_iovcntSize of the dst_iovs array.
dst_domainMemory domain to which the destination buffers belong.
dst_domain_ctxDestination buffer domain context.
src_iovsSource I/O vector array.
src_iovcntSize of the src_iovs array.
src_domainMemory domain to which the source buffers belong.
src_domain_ctxSource buffer domain context.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno otherwise.

◆ spdk_accel_append_decompress_ext()

int spdk_accel_append_decompress_ext ( struct spdk_accel_sequence ** pseq,
struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct spdk_memory_domain * dst_domain,
void * dst_domain_ctx,
struct iovec * src_iovs,
size_t src_iovcnt,
struct spdk_memory_domain * src_domain,
void * src_domain_ctx,
enum spdk_accel_comp_algo decomp_algo,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a decompression operation using the specified algorithm to a sequence.

Parameters
pseqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
dst_iovsDestination I/O vector array.
dst_iovcntSize of the dst_iovs array.
dst_domainMemory domain to which the destination buffers belong.
dst_domain_ctxDestination buffer domain context.
src_iovsSource I/O vector array.
src_iovcntSize of the src_iovs array.
src_domainMemory domain to which the source buffers belong.
src_domain_ctxSource buffer domain context.
decomp_algoThe decompression algorithm, enum spdk_accel_comp_algo value.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno otherwise.

◆ spdk_accel_append_decrypt()

int spdk_accel_append_decrypt ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct spdk_accel_crypto_key * key,
struct iovec * dst_iovs,
uint32_t dst_iovcnt,
struct spdk_memory_domain * dst_domain,
void * dst_domain_ctx,
struct iovec * src_iovs,
uint32_t src_iovcnt,
struct spdk_memory_domain * src_domain,
void * src_domain_ctx,
uint64_t iv,
uint32_t block_size,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a decrypt operation to a sequence.

nbytes must be multiple of block_size. iv is used to decrypt the first logical block of size block_size. If src_iovs describes more than one logical block then iv will be incremented for each next logical block. Data Encryption Key identifier should be created before calling this function using methods specific to the accel module being used.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
keyData Encryption Key identifier
dst_iovsDestination I/O vector array.
dst_iovcntSize of the dst_iovs array.
dst_domainMemory domain to which the destination buffers belong.
dst_domain_ctxDestination buffer domain context.
src_iovsSource I/O vector array.
src_iovcntSize of the src_iovs array.
src_domainMemory domain to which the source buffers belong.
src_domain_ctxSource buffer domain context.
ivInitialization vector (tweak) used for decryption. Should be the same as iv used for encryption of a data block.
block_sizeLogical block size, if src contains more than 1 logical block, subsequent logical blocks will be decrypted with incremented iv.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno otherwise.

◆ spdk_accel_append_dif_generate()

int spdk_accel_append_dif_generate ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
struct spdk_memory_domain * domain,
void * domain_ctx,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a Data Integrity Field (DIF) generate operation to a sequence.

This operation compute the DIF on the source data and inserting the DIF in place into the source data.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel associated with this call.
iovsThe io vector array. The total allocated memory size needs to be at least: num_blocks * block_size (including metadata)
iovcntThe size of the io vectors array.
domainMemory domain to which the data buffers belong.
domain_ctxData buffer domain context.
num_blocksNumber of data blocks.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_append_dif_generate_copy()

int spdk_accel_append_dif_generate_copy ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct spdk_memory_domain * dst_domain,
void * dst_domain_ctx,
struct iovec * src_iovs,
size_t src_iovcnt,
struct spdk_memory_domain * src_domain,
void * src_domain_ctx,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Submit a Data Integrity Field (DIF) copy and generate request.

This operation copies memory from the source to the destination address, while computing the DIF on the source data and inserting the DIF into the output data.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel associated with this call.
dst_iovsThe destination io vector array. The total allocated memory size needs to be at least: num_blocks * block_size (provided to spdk_dif_ctx_init())
dst_iovcntThe size of the destination io vectors array.
dst_domainMemory domain to which the destination buffers belong.
dst_domain_ctxDestination buffer domain context.
src_iovsThe source io vector array. The total allocated memory size needs to be at least: num_blocks * data_block_size.
src_iovcntThe size of the source io vectors array.
src_domainMemory domain to which the source buffers belong.
src_domain_ctxSource buffer domain context.
num_blocksNumber of data blocks to process.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_append_dif_verify()

int spdk_accel_append_dif_verify ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
struct spdk_memory_domain * domain,
void * domain_ctx,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
struct spdk_dif_error * err,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a Data Integrity Field (DIF) verify operation to a sequence.

This operation computes the DIF on the data and compares it against the DIF contained in the metadata.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
iovsThe io vector array. The total allocated memory size needs to be at least: num_blocks * block_size (including metadata)
iovcntThe size of the io vectors array.
domainMemory domain to which the data buffers belong.
domain_ctxData buffer domain context.
num_blocksNumber of data blocks to check.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to check Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
errDIF error detailed information. Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno on failure.

◆ spdk_accel_append_dif_verify_copy()

int spdk_accel_append_dif_verify_copy ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct spdk_memory_domain * dst_domain,
void * dst_domain_ctx,
struct iovec * src_iovs,
size_t src_iovcnt,
struct spdk_memory_domain * src_domain,
void * src_domain_ctx,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
struct spdk_dif_error * err,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a Data Integrity Field (DIF) copy and verify operation to a sequence.

This operation copies memory from the source to the destination address and removes the DIF data with its verification according to the flags provided in the context.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
dst_iovsThe destination I/O vector array. The total allocated memory size needs to be at least: num_blocks * data_block_size
dst_iovcntThe size of the destination I/O vectors array.
dst_domainMemory domain to which the destination buffers belong.
dst_domain_ctxDestination buffer domain context.
src_iovsThe source I/O vector array. The total allocated memory size needs to be at least: num_blocks * block_size (including metadata)
src_iovcntThe size of the source I/O vectors array.
src_domainMemory domain to which the source buffers belong.
src_domain_ctxSource buffer domain context.
num_blocksNumber of data blocks to process.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert.
errDIF error detailed information. Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_append_dix_generate()

int spdk_accel_append_dix_generate ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
struct spdk_memory_domain * domain,
void * domain_ctx,
struct iovec * md_iov,
struct spdk_memory_domain * md_domain,
void * md_domain_ctx,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append DIX generate operation to a sequence.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
iovsSource I/O vector array. The total allocated memory size needs to be at least: num_blocks * block_size_no_md.
iovcntSize of the source I/O vectors' array.
domainMemory domain to which the source buffers belong.
domain_ctxSource buffer domain context.
md_iovMetadata iovec. The total allocated memory size needs to be at least: num_blocks * md_size (8B or 16B, depending on the PI format).
md_domainMemory domain to which the metadata buffers belongs.
md_domain_ctxMetadata buffer domain context.
num_blocksNumber of data blocks to process.
ctxDIX context. Contains the DIX configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert.
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_append_dix_verify()

int spdk_accel_append_dix_verify ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
struct spdk_memory_domain * domain,
void * domain_ctx,
struct iovec * md_iov,
struct spdk_memory_domain * md_domain,
void * md_domain_ctx,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
struct spdk_dif_error * err,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append DIX verify operation to a sequence.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
iovsSource I/O vector array. The total allocated memory size needs to be at least: num_blocks * block_size_no_md.
iovcntSize of the source I/O vectors' array.
domainMemory domain to which the source buffers belong.
domain_ctxSource buffer domain context.
md_iovMetadata iovec. The total allocated memory size needs to be at least: num_blocks * md_size (8B or 16B, depending on the PI format).
md_domainMemory domain to which the metadata buffers belongs.
md_domain_ctxMetadata buffer domain context.
num_blocksNumber of data blocks to process.
ctxDIX context. Contains the DIX configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert.
errDIX error detailed information. Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_append_encrypt()

int spdk_accel_append_encrypt ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
struct spdk_accel_crypto_key * key,
struct iovec * dst_iovs,
uint32_t dst_iovcnt,
struct spdk_memory_domain * dst_domain,
void * dst_domain_ctx,
struct iovec * src_iovs,
uint32_t src_iovcnt,
struct spdk_memory_domain * src_domain,
void * src_domain_ctx,
uint64_t iv,
uint32_t block_size,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append an encrypt operation to a sequence.

nbytes must be multiple of block_size. iv is used to encrypt the first logical block of size block_size. If src_iovs describes more than one logical block then iv will be incremented for each next logical block. Data Encryption Key identifier should be created before calling this function using methods specific to the accel module being used.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
keyData Encryption Key identifier
dst_iovsDestination I/O vector array.
dst_iovcntSize of the dst_iovs array.
dst_domainMemory domain to which the destination buffers belong.
dst_domain_ctxDestination buffer domain context.
src_iovsSource I/O vector array.
src_iovcntSize of the src_iovs array.
src_domainMemory domain to which the source buffers belong.
src_domain_ctxSource buffer domain context.
ivInitialization vector (tweak) used for encryption
block_sizeLogical block size, if src contains more than 1 logical block, subsequent logical blocks will be encrypted with incremented iv.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno otherwise.

◆ spdk_accel_append_fill()

int spdk_accel_append_fill ( struct spdk_accel_sequence ** seq,
struct spdk_io_channel * ch,
void * buf,
uint64_t len,
struct spdk_memory_domain * domain,
void * domain_ctx,
uint8_t pattern,
spdk_accel_step_cb cb_fn,
void * cb_arg )

Append a fill operation to a sequence.

Parameters
seqSequence object. If NULL, a new sequence object will be created.
chI/O channel.
bufData buffer.
lenLength of the data buffer.
domainMemory domain to which the data buffer belongs.
domain_ctxBuffer domain context.
patternPattern to fill the buffer with.
cb_fnCallback to be executed once this operation is completed.
cb_argArgument to be passed to cb_fn.
Returns
0 if operation was successfully added to the sequence, negative errno otherwise.

◆ spdk_accel_assign_opc()

int spdk_accel_assign_opc ( enum spdk_accel_opcode opcode,
const char * name )

Override the assignment of an opcode to an module.

Parameters
opcodeAccel Framework Opcode enum value. Valid codes can be retrieved using accel_get_opc_assignments or spdk_accel_get_opcode_name.
nameName of the module to assign. Valid module names may be retrieved with spdk_accel_get_opc_module_name
Returns
0 if a valid opcode name was provided. -EINVAL for invalid opcode or if the framework has started (cannot change modules after startup)

◆ spdk_accel_crypto_key_create()

int spdk_accel_crypto_key_create ( const struct spdk_accel_crypto_key_create_param * param)

Create a crypto key with given parameters.

Accel module copies content of param structure

Parameters
paramKey parameters
Returns
0 on success, negated errno on error

◆ spdk_accel_crypto_key_destroy()

int spdk_accel_crypto_key_destroy ( struct spdk_accel_crypto_key * key)

Destroy a crypto key.

Parameters
keyKey to destroy
Returns
0 on success, negated errno on error

◆ spdk_accel_crypto_key_get()

struct spdk_accel_crypto_key * spdk_accel_crypto_key_get ( const char * name)

Find a crypto key structure by name.

Parameters
nameKey name
Returns
Crypto key structure or NULL

◆ spdk_accel_finish()

void spdk_accel_finish ( spdk_accel_fini_cb cb_fn,
void * cb_arg )

Close the acceleration framework.

Parameters
cb_fnCalled when the close operation completes.
cb_argArgument passed to the callback function.

◆ spdk_accel_get_buf()

int spdk_accel_get_buf ( struct spdk_io_channel * ch,
uint64_t len,
void ** buf,
struct spdk_memory_domain ** domain,
void ** domain_ctx )

Allocate a buffer from accel domain.

These buffers can be only used with operations appended to a sequence. The actual data buffer won't be allocated immediately, but only when it's necessary to execute a given operation. In some cases, this might even mean that a data buffer won't be allocated at all, if a sequence can be executed without it.

A buffer can only be a part of one sequence, but it can be used by multiple operations within that sequence.

Parameters
chI/O channel.
lenLength of the buffer to allocate.
bufPointer to the allocated buffer.
domainMemory domain in which the buffer is allocated.
domain_ctxMemory domain context related to the allocated buffer.
Returns
0 if a buffer was successfully allocated, negative errno otherwise.

◆ spdk_accel_get_buf_align()

uint8_t spdk_accel_get_buf_align ( enum spdk_accel_opcode opcode,
const struct spdk_accel_operation_exec_ctx * ctx )

Get minimum buffer alignment to execute a given operation.

It accounts for constraints of a module assigned to execute a given operation and the driver (if set). The alignment is returned as a power of 2. The value of 0 means that the buffers don't need to be aligned.

Parameters
opcodeOpcode.
ctxContext in which the operation will be executed.
Returns
Minimum alignment.

◆ spdk_accel_get_compress_level_range()

int spdk_accel_get_compress_level_range ( enum spdk_accel_comp_algo comp_algo,
uint32_t * min_level,
uint32_t * max_level )

Gets the level range of the specified algorithm.

Parameters
comp_algoThe compression algorithm.
min_levelThe lowest level supported by the compression algorithm.
max_levelThe highest level supported by the compression algorithm.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_get_driver_name()

const char * spdk_accel_get_driver_name ( void )

Get platform driver name.

Returns
Name of the driver as a null-terminated string or NULL if driver not set.

◆ spdk_accel_get_io_channel()

struct spdk_io_channel * spdk_accel_get_io_channel ( void )

Get an I/O channel for the acceleration framework.

This I/O channel is used to submit requests.

Returns
a pointer to the I/O channel on success, or NULL on failure.

◆ spdk_accel_get_memory_domain()

struct spdk_memory_domain * spdk_accel_get_memory_domain ( void )

Retrieves accel memory domain.

Returns
Accel memory domain.

◆ spdk_accel_get_opc_memory_domains()

int spdk_accel_get_opc_memory_domains ( enum spdk_accel_opcode opcode,
struct spdk_memory_domain ** domains,
int array_size )

Return memory domains used by specific opcode.

The returned memory domains depend on the accel module which is assigned to handle the opcode

Parameters
opcodeAccel Framework Opcode enum value.
domainsPointer to an array of memory domains to be filled by this function. The user should allocate big enough array to keep all memory domains.
array_sizesize of domains array
Returns
the number of entries in domains array or negated errno. If returned value is bigger than array_size passed by the user then the user should increase the size of domains array and call this function again. There is no guarantees that the content of domains array is valid in that case.

◆ spdk_accel_get_opc_module_name()

int spdk_accel_get_opc_module_name ( enum spdk_accel_opcode opcode,
const char ** module_name )

Return the name of the module assigned to a specific opcode.

Parameters
opcodeAccel Framework Opcode enum value. Valid codes can be retrieved using accel_get_opc_assignments or spdk_accel_get_opcode_name.
module_namePointer to update with module name.
Returns
0 if a valid module name was provided. -EINVAL for invalid opcode or -ENOENT no module was found at this time for the provided opcode.

◆ spdk_accel_get_opcode_name()

const char * spdk_accel_get_opcode_name ( enum spdk_accel_opcode opcode)

Return the name of an operation based on the opcode.

Parameters
opcodeOpcode.
Returns
Name of the operation.

◆ spdk_accel_get_opcode_stats()

void spdk_accel_get_opcode_stats ( struct spdk_io_channel * ch,
enum spdk_accel_opcode opcode,
struct spdk_accel_opcode_stats * stats,
size_t size )

Retrieve opcode statistics for a given IO channel.

Parameters
chI/O channel.
opcodeOperation to retrieve statistics.
statsPer-channel statistics.
sizeSize of the stats structure.

◆ spdk_accel_get_opts()

void spdk_accel_get_opts ( struct spdk_accel_opts * opts,
size_t opts_size )

Get the options for the accel framework.

Parameters
optsOutput parameter for options.
opts_sizesizeof(*opts)

◆ spdk_accel_initialize()

int spdk_accel_initialize ( void )

Initialize the acceleration framework.

Returns
0 on success.

◆ spdk_accel_put_buf()

void spdk_accel_put_buf ( struct spdk_io_channel * ch,
void * buf,
struct spdk_memory_domain * domain,
void * domain_ctx )

Release a buffer allocated via spdk_accel_get_buf().

Parameters
chI/O channel.
bufBuffer allocated via spdk_accel_get_buf().
domainMemory domain in which the buffer is allocated.
domain_ctxMemory domain context related to the allocated buffer.

◆ spdk_accel_sequence_abort()

void spdk_accel_sequence_abort ( struct spdk_accel_sequence * seq)

Abort a sequence.

This will execute the completion callbacks of all operations that were added to the sequence and will then free the sequence object. This function can only be used before a sequence is executed, i.e. before calling spdk_accel_sequence_finish().

Parameters
seqSequence to abort.

◆ spdk_accel_sequence_finish()

void spdk_accel_sequence_finish ( struct spdk_accel_sequence * seq,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Finish a sequence and execute all its operations.

After the completion callback is executed, the sequence object is automatically freed.

Parameters
seqSequence to finish.
cb_fnCompletion callback to be executed once all operations are executed.
cb_argArgument to be passed to cb_fn.

◆ spdk_accel_sequence_reverse()

void spdk_accel_sequence_reverse ( struct spdk_accel_sequence * seq)

Reverse a sequence, so that the last operation becomes the first and vice versa.

Parameters
seqSequence to reverse.

◆ spdk_accel_set_driver()

int spdk_accel_set_driver ( const char * name)

Select platform driver to execute operation chains.

Parameters
nameName of the driver. If NULL or empty string, this function will clear the driver that was previously assigned.
Returns
0 on success, negetive errno otherwise.

◆ spdk_accel_set_opts()

int spdk_accel_set_opts ( const struct spdk_accel_opts * opts)

Set the options for the accel framework.

Parameters
optsAccel options.
Returns
0 on success, negative errno otherwise.

◆ spdk_accel_submit_compare()

int spdk_accel_submit_compare ( struct spdk_io_channel * ch,
void * src1,
void * src2,
uint64_t nbytes,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a compare request.

Parameters
chI/O channel associated with this call.
src1First location to perform compare on.
src2Second location to perform compare on.
nbytesLength in bytes to compare.
cb_fnCalled when this compare operation completes.
cb_argCallback argument.
Returns
0 on success, any other value means there was a miscompare.

◆ spdk_accel_submit_compress()

int spdk_accel_submit_compress ( struct spdk_io_channel * ch,
void * dst,
uint64_t nbytes,
struct iovec * src_iovs,
size_t src_iovcnt,
uint32_t * output_size,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Build and submit a memory compress request using the deflate algorithm.

This function will build the compress descriptor and submit it.

Parameters
chI/O channel associated with this call
dstDestination to write the data to.
nbytesLength in bytes.
src_iovsThe io vector array which stores the src data and len.
src_iovcntThe size of the src io vectors.
output_sizeThe size of the compressed data (may be NULL if not desired)
cb_fnCallback function which will be called when the request is complete.
cb_argOpaque value which will be passed back as the arg parameter in the completion callback.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_compress_ext()

int spdk_accel_submit_compress_ext ( struct spdk_io_channel * ch,
void * dst,
uint64_t nbytes,
struct iovec * src_iovs,
size_t src_iovcnt,
enum spdk_accel_comp_algo comp_algo,
uint32_t comp_level,
uint32_t * output_size,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Build and submit a memory compress request using the specified algorithm.

This function will build the compress descriptor and submit it.

Parameters
chI/O channel associated with this call
dstDestination to write the data to.
nbytesLength in bytes.
src_iovsThe io vector array which stores the src data and len.
src_iovcntThe size of the src io vectors.
comp_algoThe compression algorithm, enum spdk_accel_comp_algo value.
comp_levelThe compression algorithm level.
output_sizeThe size of the compressed data (may be NULL if not desired)
cb_fnCallback function which will be called when the request is complete.
cb_argOpaque value which will be passed back as the arg parameter in the completion callback.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_copy()

int spdk_accel_submit_copy ( struct spdk_io_channel * ch,
void * dst,
void * src,
uint64_t nbytes,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a copy request.

Parameters
chI/O channel associated with this call.
dstDestination to copy to.
srcSource to copy from.
nbytesLength in bytes to copy.
cb_fnCalled when this copy operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_copy_crc32c()

int spdk_accel_submit_copy_crc32c ( struct spdk_io_channel * ch,
void * dst,
void * src,
uint32_t * crc_dst,
uint32_t seed,
uint64_t nbytes,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a copy with CRC-32C calculation request.

This operation will copy data and calculate the 4 byte CRC32-C for the given data.

Parameters
chI/O channel associated with this call.
dstDestination to write the data to.
srcThe source address for the data.
crc_dstDestination to write the CRC-32C to.
seedFour byte seed value.
nbytesLength in bytes.
cb_fnCalled when this CRC-32C operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_copy_crc32cv()

int spdk_accel_submit_copy_crc32cv ( struct spdk_io_channel * ch,
void * dst,
struct iovec * src_iovs,
uint32_t iovcnt,
uint32_t * crc_dst,
uint32_t seed,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a chained copy + CRC-32C calculation request.

This operation will calculate the 4 byte CRC32-C for the given data.

Parameters
chI/O channel associated with this call.
dstDestination to write the data to.
src_iovsThe io vector array which stores the src data and len.
iovcntThe size of the io vectors.
crc_dstDestination to write the CRC-32C to.
seedFour byte seed value.
cb_fnCalled when this CRC-32C operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_crc32c()

int spdk_accel_submit_crc32c ( struct spdk_io_channel * ch,
uint32_t * crc_dst,
void * src,
uint32_t seed,
uint64_t nbytes,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a CRC-32C calculation request.

This operation will calculate the 4 byte CRC32-C for the given data.

Parameters
chI/O channel associated with this call.
crc_dstDestination to write the CRC-32C to.
srcThe source address for the data.
seedFour byte seed value.
nbytesLength in bytes.
cb_fnCalled when this CRC-32C operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_crc32cv()

int spdk_accel_submit_crc32cv ( struct spdk_io_channel * ch,
uint32_t * crc_dst,
struct iovec * iovs,
uint32_t iovcnt,
uint32_t seed,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a chained CRC-32C calculation request.

This operation will calculate the 4 byte CRC32-C for the given data.

Parameters
chI/O channel associated with this call.
crc_dstDestination to write the CRC-32C to.
iovsThe io vector array which stores the src data and len.
iovcntThe size of the iov.
seedFour byte seed value.
cb_fnCalled when this CRC-32C operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_decompress()

int spdk_accel_submit_decompress ( struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct iovec * src_iovs,
size_t src_iovcnt,
uint32_t * output_size,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Build and submit a memory decompress request using the deflate algorithm.

This function will build the decompress descriptor and submit it.

Parameters
chI/O channel associated with this call
dst_iovsThe io vector array which stores the dst data and len.
dst_iovcntThe size of the dst io vectors.
src_iovsThe io vector array which stores the src data and len.
src_iovcntThe size of the src io vectors.
output_sizeThe size of the compressed data (may be NULL if not desired)
cb_fnCallback function which will be called when the request is complete.
cb_argOpaque value which will be passed back as the arg parameter in the completion callback.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_decompress_ext()

int spdk_accel_submit_decompress_ext ( struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct iovec * src_iovs,
size_t src_iovcnt,
enum spdk_accel_comp_algo decomp_algo,
uint32_t * output_size,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Build and submit a memory decompress request using the specified algorithm.

This function will build the decompress descriptor and submit it.

Parameters
chI/O channel associated with this call
dst_iovsThe io vector array which stores the dst data and len.
dst_iovcntThe size of the dst io vectors.
src_iovsThe io vector array which stores the src data and len.
src_iovcntThe size of the src io vectors.
decomp_algoThe decompression algorithm, enum spdk_accel_comp_algo value.
output_sizeThe size of the compressed data (may be NULL if not desired)
cb_fnCallback function which will be called when the request is complete.
cb_argOpaque value which will be passed back as the arg parameter in the completion callback.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_decrypt()

int spdk_accel_submit_decrypt ( struct spdk_io_channel * ch,
struct spdk_accel_crypto_key * key,
struct iovec * dst_iovs,
uint32_t dst_iovcnt,
struct iovec * src_iovs,
uint32_t src_iovcnt,
uint64_t iv,
uint32_t block_size,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Build and submit a data decryption request.

This function will build the decryption request and submit it. nbytes must be multiple of block_size. iv is used to decrypt the first logical block of size block_size. If src_iovs describes more than one logical block then iv will be incremented for each next logical block. Data Encryption Key identifier should be created before calling this function using methods specific to the accel module being used.

Parameters
chI/O channel associated with this call
keyData Encryption Key identifier
dst_iovsThe io vector array which stores the dst data and len.
dst_iovcntThe size of the destination io vectors.
src_iovsThe io vector array which stores the src data and len.
src_iovcntThe size of the source io vectors.
ivInitialization vector (tweak) used for decryption. Should be the same as iv used for encryption of a data block
block_sizeLogical block size, if src contains more than 1 logical block, subsequent logical blocks will be decrypted with incremented iv
cb_fnCallback function which will be called when the request is complete.
cb_argOpaque value which will be passed back as the arg parameter in the completion callback.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_dif_generate()

int spdk_accel_submit_dif_generate ( struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a Data Integrity Field (DIF) generate request.

This operation compute the DIF on the source data and inserting the DIF in place into the source data.

Parameters
chI/O channel associated with this call.
iovsThe io vector array. The total allocated memory size needs to be at least: num_blocks * block_size (including metadata)
iovcntThe size of the io vectors array.
num_blocksNumber of data blocks.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_dif_generate_copy()

int spdk_accel_submit_dif_generate_copy ( struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct iovec * src_iovs,
size_t src_iovcnt,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a Data Integrity Field (DIF) copy and generate request.

This operation copies memory from the source to the destination address, while computing the DIF on the source data and inserting the DIF into the output data.

Parameters
chI/O channel associated with this call.
dst_iovsThe destination io vector array. The total allocated memory size needs to be at least: num_blocks * block_size (provided to spdk_dif_ctx_init())
dst_iovcntThe size of the destination io vectors array.
src_iovsThe source io vector array. The total allocated memory size needs to be at least: num_blocks * data_block_size.
src_iovcntThe size of the source io vectors array.
num_blocksNumber of data blocks to process.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_dif_verify()

int spdk_accel_submit_dif_verify ( struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
struct spdk_dif_error * err,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a Data Integrity Field (DIF) verify request.

This operation computes the DIF on the data and compares it against the DIF contained in the metadata.

Parameters
chI/O channel associated with this call.
iovsThe io vector array. The total allocated memory size needs to be at least: num_blocks * block_size (including metadata)
iovcntThe size of the io vectors array.
num_blocksNumber of data blocks to check.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to check Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
errDIF error detailed information. Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_dif_verify_copy()

int spdk_accel_submit_dif_verify_copy ( struct spdk_io_channel * ch,
struct iovec * dst_iovs,
size_t dst_iovcnt,
struct iovec * src_iovs,
size_t src_iovcnt,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
struct spdk_dif_error * err,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a Data Integrity Field (DIF) copy and verify request.

This operation copies memory from the source to the destination address and removes the DIF data with its verification according to the flags provided in the context.

Parameters
chI/O channel associated with this call.
dst_iovsThe destination I/O vector array. The total allocated memory size needs to be at least: num_blocks * data_block_size.
dst_iovcntThe size of the destination I/O vectors array.
src_iovsThe source I/O vector array. The total allocated memory size needs to be at least: num_blocks * block_size (including metadata)
src_iovcntThe size of the source I/O vectors array.
num_blocksNumber of data blocks to process.
ctxDIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert.
errDIF error detailed information. Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_dix_generate()

int spdk_accel_submit_dix_generate ( struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
struct iovec * md_iov,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a Data Integrity Extension (DIX) generate operation.

This operation computes Protection Information (DIX) and inserts it into metadata buffer.

Parameters
chI/O channel associated with this call.
iovsThe source io vector array. The total allocated memory size needs to be at least: num_blocks * block_size_no_md
iovcntThe size of the source io vectors array.
md_iovThe metadata vector array. The total allocated memory size needs to be at least: num_blocks * md_size (8B or 16B, depending on the PI format)
num_blocksNumber of data blocks to process.
ctxDIX context. Contains the DIX configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_dix_verify()

int spdk_accel_submit_dix_verify ( struct spdk_io_channel * ch,
struct iovec * iovs,
size_t iovcnt,
struct iovec * md_iov,
uint32_t num_blocks,
const struct spdk_dif_ctx * ctx,
struct spdk_dif_error * err,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a Data Integrity Extension (DIX) verify request.

This operation computes the Protection Information (DIX) on the data and compares it against the DIX contained in the metadata.

Parameters
chI/O channel associated with this call.
iovsThe io vector array. The total allocated memory size needs to be at least: num_blocks * block_size
iovcntThe size of the io vectors array.
md_iovThe metadata vector array. The total allocated memory size needs to be at least: num_blocks * md_size (8B or 16B, depending on the PI format)
num_blocksNumber of data blocks to check.
ctxDIX context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to check Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
errDIX error detailed information. Note: the user must ensure the validity of this pointer throughout the entire operation because it is not validated along the processing path.
cb_fnCalled when this operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_dualcast()

int spdk_accel_submit_dualcast ( struct spdk_io_channel * ch,
void * dst1,
void * dst2,
void * src,
uint64_t nbytes,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a dual cast copy request.

Parameters
chI/O channel associated with this call.
dst1First destination to copy to (must be 4K aligned).
dst2Second destination to copy to (must be 4K aligned).
srcSource to copy from.
nbytesLength in bytes to copy.
cb_fnCalled when this copy operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_encrypt()

int spdk_accel_submit_encrypt ( struct spdk_io_channel * ch,
struct spdk_accel_crypto_key * key,
struct iovec * dst_iovs,
uint32_t dst_iovcnt,
struct iovec * src_iovs,
uint32_t src_iovcnt,
uint64_t iv,
uint32_t block_size,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Build and submit a data encryption request.

This function will build the encryption request and submit it. nbytes must be multiple of block_size. iv is used to encrypt the first logical block of size block_size. If src_iovs describes more than one logical block then iv will be incremented for each next logical block. Data Encryption Key identifier should be created before calling this function using methods specific to the accel module being used.

Parameters
chI/O channel associated with this call
keyData Encryption Key identifier
dst_iovsThe io vector array which stores the dst data and len.
dst_iovcntThe size of the destination io vectors.
src_iovsThe io vector array which stores the src data and len.
src_iovcntThe size of the source io vectors.
ivInitialization vector (tweak) used for encryption
block_sizeLogical block size, if src contains more than 1 logical block, subsequent logical blocks will be encrypted with incremented iv
cb_fnCallback function which will be called when the request is complete.
cb_argOpaque value which will be passed back as the arg parameter in the completion callback.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_fill()

int spdk_accel_submit_fill ( struct spdk_io_channel * ch,
void * dst,
uint8_t fill,
uint64_t nbytes,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit a fill request.

This operation will fill the destination buffer with the specified value.

Parameters
chI/O channel associated with this call.
dstDestination to fill.
fillConstant byte to fill to the destination.
nbytesLength in bytes to fill.
cb_fnCalled when this fill operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_submit_xor()

int spdk_accel_submit_xor ( struct spdk_io_channel * ch,
void * dst,
void ** sources,
uint32_t nsrcs,
uint64_t nbytes,
spdk_accel_completion_cb cb_fn,
void * cb_arg )

Submit an xor request.

Parameters
chI/O channel associated with this call.
dstDestination to write the data to.
sourcesArray of source buffers.
nsrcsNumber of source buffers in the array.
nbytesLength in bytes.
cb_fnCalled when this copy operation completes.
cb_argCallback argument.
Returns
0 on success, negative errno on failure.

◆ spdk_accel_write_config_json()

void spdk_accel_write_config_json ( struct spdk_json_write_ctx * w)

Write Acceleration subsystem configuration into provided JSON context.

Parameters
wJSON write context