22 #ifndef DOCA_ERASURE_CODING_H_
23 #define DOCA_ERASURE_CODING_H_
52 struct doca_ec_matrix;
64 struct doca_ec_task_galois_mul;
170 const struct doca_ec_matrix *coding_matrix,
171 const struct doca_buf *src_buf,
172 struct doca_buf *dst_buf,
174 struct doca_ec_task_galois_mul **task);
199 const struct doca_ec_matrix *coding_matrix);
284 struct doca_ec_task_create;
389 const struct doca_ec_matrix *coding_matrix,
390 const struct doca_buf *original_data_blocks,
391 struct doca_buf *rdnc_blocks,
393 struct doca_ec_task_create **task);
418 const struct doca_ec_matrix *coding_matrix);
451 const struct doca_buf *original_data_blocks);
511 struct doca_ec_task_update;
619 const struct doca_ec_matrix *update_matrix,
620 const struct doca_buf *original_updated_and_rdnc_blocks,
621 struct doca_buf *updated_rdnc_blocks,
623 struct doca_ec_task_update **task);
648 const struct doca_ec_matrix *update_matrix);
684 const struct doca_buf *original_updated_and_rdnc_blocks);
722 struct doca_buf *updated_rdnc_blocks);
745 struct doca_ec_task_recover;
855 const struct doca_ec_matrix *recover_matrix,
856 const struct doca_buf *available_blocks,
857 struct doca_buf *recovered_data_blocks,
859 struct doca_ec_task_recover **task);
884 const struct doca_ec_matrix *recover_matrix);
921 const struct doca_buf *available_blocks);
960 struct doca_buf *recovered_data_blocks);
1118 size_t data_block_count,
1119 size_t rdnc_block_count,
1120 struct doca_ec_matrix **matrix);
1145 size_t data_block_count,
1146 size_t rdnc_block_count,
1147 struct doca_ec_matrix **matrix);
1172 const struct doca_ec_matrix *coding_matrix,
1173 uint32_t update_indices[],
1175 struct doca_ec_matrix **matrix);
1199 const struct doca_ec_matrix *coding_matrix,
1200 uint32_t missing_indices[],
1202 struct doca_ec_matrix **matrix);
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
DOCA_EXPERIMENTAL doca_error_t doca_ec_cap_task_create_is_supported(const struct doca_devinfo *devinfo)
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_update_allocate_init(struct doca_ec *ec, const struct doca_ec_matrix *update_matrix, const struct doca_buf *original_updated_and_rdnc_blocks, struct doca_buf *updated_rdnc_blocks, union doca_data user_data, struct doca_ec_task_update **task)
This method allocates and initializes an update task.
DOCA_EXPERIMENTAL void doca_ec_task_recover_set_available_blocks(struct doca_ec_task_recover *task, const struct doca_buf *available_blocks)
This method sets the available_blocks buffer of a recover task.
DOCA_EXPERIMENTAL void doca_ec_task_galois_mul_set_dst_buf(struct doca_ec_task_galois_mul *task, struct doca_buf *dst_buf)
This method sets the destination buffer of a Galois multiplication task.
DOCA_EXPERIMENTAL struct doca_buf * doca_ec_task_update_get_updated_rdnc_blocks(const struct doca_ec_task_update *task)
This method gets the updated_rdnc_blocks buffer of an update task. The rdnc_blocks buffer is a destin...
DOCA_EXPERIMENTAL doca_error_t doca_ec_cap_task_update_is_supported(const struct doca_devinfo *devinfo)
void(* doca_ec_task_recover_completion_cb_t)(struct doca_ec_task_recover *task, union doca_data task_user_data, union doca_data ctx_user_data)
Function to execute on completion of a recover task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_create_set_conf(struct doca_ec *ec, doca_ec_task_create_completion_cb_t successful_task_completion_cb, doca_ec_task_create_completion_cb_t error_task_completion_cb, uint32_t num_tasks)
This method sets the create tasks configuration.
DOCA_EXPERIMENTAL const struct doca_ec_matrix * doca_ec_task_update_get_update_matrix(const struct doca_ec_task_update *task)
This method gets the update_matrix of an update task.
DOCA_EXPERIMENTAL const struct doca_buf * doca_ec_task_recover_get_available_blocks(const struct doca_ec_task_recover *task)
This method gets the available_blocks buffer of a recover task. The available_blocks buffer is a sour...
DOCA_EXPERIMENTAL struct doca_buf * doca_ec_task_recover_get_recovered_data(const struct doca_ec_task_recover *task)
This method gets the recovered_data buffer of a recover task. The recovered_data buffer is a destinat...
void(* doca_ec_task_create_completion_cb_t)(struct doca_ec_task_create *task, union doca_data task_user_data, union doca_data ctx_user_data)
Function to execute on completion of a create task.
DOCA_EXPERIMENTAL struct doca_buf * doca_ec_task_galois_mul_get_dst_buf(const struct doca_ec_task_galois_mul *task)
This method gets the destination buffer of a Galois multiplication task.
DOCA_EXPERIMENTAL void doca_ec_task_galois_mul_set_coding_matrix(struct doca_ec_task_galois_mul *task, const struct doca_ec_matrix *coding_matrix)
This method sets the coding_matrix of a Galois multiplication task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_destroy(struct doca_ec *ec)
Destroy a DOCA EC instance.
doca_ec_matrix_type
Types of coding matrix used for erasure codes.
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_create_allocate_init(struct doca_ec *ec, const struct doca_ec_matrix *coding_matrix, const struct doca_buf *original_data_blocks, struct doca_buf *rdnc_blocks, union doca_data user_data, struct doca_ec_task_create **task)
This method allocates and initializes a create task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_galois_mul_set_conf(struct doca_ec *ec, doca_ec_task_galois_mul_completion_cb_t successful_task_completion_cb, doca_ec_task_galois_mul_completion_cb_t error_task_completion_cb, uint32_t num_tasks)
This method sets the Galois multiplication tasks configuration.
DOCA_EXPERIMENTAL doca_error_t doca_ec_matrix_create_from_raw(struct doca_ec *ec, uint8_t *data, size_t data_block_count, size_t rdnc_block_count, struct doca_ec_matrix **matrix)
Create coding matrix for Erasure Code encode i.e. most basic encode matrix from char array....
DOCA_EXPERIMENTAL void doca_ec_task_create_set_coding_matrix(struct doca_ec_task_create *task, const struct doca_ec_matrix *coding_matrix)
This method sets the coding_matrix of a create task.
DOCA_EXPERIMENTAL void doca_ec_task_update_set_original_updated_and_rdnc_blocks(struct doca_ec_task_update *task, const struct doca_buf *original_updated_and_rdnc_blocks)
This method sets the original_updated_and_rdnc_blocks buffer of an update task.
DOCA_EXPERIMENTAL const struct doca_buf * doca_ec_task_update_get_original_updated_and_rdnc_blocks(const struct doca_ec_task_update *task)
This method gets the original_updated_and_rdnc_blocks buffer of an update task. The original_data_blo...
DOCA_EXPERIMENTAL doca_error_t doca_ec_cap_get_max_buf_list_len(const struct doca_devinfo *devinfo, uint32_t *max_buf_list_len)
Get the maximum supported number of elements in DOCA linked-list buffer used for EC tasks.
DOCA_EXPERIMENTAL doca_error_t doca_ec_create(struct doca_dev *dev, struct doca_ec **ec)
Create a DOCA EC instance.
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_recover_allocate_init(struct doca_ec *ec, const struct doca_ec_matrix *recover_matrix, const struct doca_buf *available_blocks, struct doca_buf *recovered_data_blocks, union doca_data user_data, struct doca_ec_task_recover **task)
This method allocates and initializes a recover task.
DOCA_EXPERIMENTAL void doca_ec_task_create_set_rdnc_blocks(struct doca_ec_task_create *task, struct doca_buf *rdnc_blocks)
This method sets the rdnc_blocks buffer of a create task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_galois_mul_allocate_init(struct doca_ec *ec, const struct doca_ec_matrix *coding_matrix, const struct doca_buf *src_buf, struct doca_buf *dst_buf, union doca_data user_data, struct doca_ec_task_galois_mul **task)
This method allocates and initializes a Galois multiplication task.
DOCA_EXPERIMENTAL const struct doca_buf * doca_ec_task_create_get_original_data_blocks(const struct doca_ec_task_create *task)
This method gets the original_data_blocks buffer of a create task. The original_data_blocks buffer is...
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_update_set_conf(struct doca_ec *ec, doca_ec_task_update_completion_cb_t successful_task_completion_cb, doca_ec_task_update_completion_cb_t error_task_completion_cb, uint32_t num_tasks)
This method sets the update tasks configuration.
DOCA_EXPERIMENTAL void doca_ec_task_create_set_original_data_blocks(struct doca_ec_task_create *task, const struct doca_buf *original_data_blocks)
This method sets the original_data_blocks buffer of a create task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_matrix_create_update(struct doca_ec *ec, const struct doca_ec_matrix *coding_matrix, uint32_t update_indices[], size_t n_updates, struct doca_ec_matrix **matrix)
Generate coding matrix for Erasure Code update. To use this function must call doca_ec_matrix_create(...
DOCA_EXPERIMENTAL doca_error_t doca_ec_matrix_destroy(struct doca_ec_matrix *matrix)
Destroy coding matrix.
DOCA_EXPERIMENTAL const struct doca_ec_matrix * doca_ec_task_create_get_coding_matrix(const struct doca_ec_task_create *task)
This method gets the coding matrix of a create task.
DOCA_EXPERIMENTAL void doca_ec_task_recover_set_recover_matrix(struct doca_ec_task_recover *task, const struct doca_ec_matrix *recover_matrix)
This method sets the recover_matrix of a recover task.
DOCA_EXPERIMENTAL void doca_ec_task_galois_mul_set_src_buf(struct doca_ec_task_galois_mul *task, const struct doca_buf *src_buf)
This method sets the source buffer of a Galois multiplication task.
DOCA_EXPERIMENTAL struct doca_task * doca_ec_task_recover_as_task(struct doca_ec_task_recover *task)
This method converts an EC recover task to a doca_task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_task_recover_set_conf(struct doca_ec *ec, doca_ec_task_recover_completion_cb_t successful_task_completion_cb, doca_ec_task_recover_completion_cb_t error_task_completion_cb, uint32_t num_tasks)
This method sets the recover tasks configuration.
DOCA_EXPERIMENTAL struct doca_task * doca_ec_task_galois_mul_as_task(struct doca_ec_task_galois_mul *task)
This method converts an EC Galois multiplication task to a doca_task.
void(* doca_ec_task_update_completion_cb_t)(struct doca_ec_task_update *task, union doca_data task_user_data, union doca_data ctx_user_data)
Function to execute on completion of an update task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_cap_get_max_block_size(const struct doca_devinfo *devinfo, uint64_t *max_block_size)
Get maximum block size supported for DOCA EC tasks.
void(* doca_ec_task_galois_mul_completion_cb_t)(struct doca_ec_task_galois_mul *task, union doca_data task_user_data, union doca_data ctx_user_data)
Function to execute on completion of a Galois multiplication task.
DOCA_EXPERIMENTAL struct doca_task * doca_ec_task_update_as_task(struct doca_ec_task_update *task)
This method converts an EC update task to a doca_task.
DOCA_EXPERIMENTAL struct doca_buf * doca_ec_task_create_get_rdnc_blocks(const struct doca_ec_task_create *task)
This method gets the rdnc_blocks buffer of a create task. The rdnc_blocks buffer is a destination buf...
DOCA_EXPERIMENTAL struct doca_task * doca_ec_task_create_as_task(struct doca_ec_task_create *task)
This method converts an EC create task to a doca_task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_cap_task_galois_mul_is_supported(const struct doca_devinfo *devinfo)
DOCA_EXPERIMENTAL doca_error_t doca_ec_matrix_create_recover(struct doca_ec *ec, const struct doca_ec_matrix *coding_matrix, uint32_t missing_indices[], size_t n_missing, struct doca_ec_matrix **matrix)
Generate coding matrix for Erasure Code recovery from failure. To use this function must call doca_ec...
DOCA_EXPERIMENTAL doca_error_t doca_ec_matrix_create(struct doca_ec *ec, enum doca_ec_matrix_type type, size_t data_block_count, size_t rdnc_block_count, struct doca_ec_matrix **matrix)
Generate coding matrix for Erasure Code encode i.e. most basic encode matrix. This is necessary for e...
DOCA_EXPERIMENTAL void doca_ec_task_recover_set_recovered_data_blocks(struct doca_ec_task_recover *task, struct doca_buf *recovered_data_blocks)
This method sets the recovered_data_blocks buffer of a recover task.
DOCA_EXPERIMENTAL struct doca_ctx * doca_ec_as_ctx(struct doca_ec *ec)
Convert EC instance into context.
DOCA_EXPERIMENTAL void doca_ec_task_update_set_updated_rdnc_blocks(struct doca_ec_task_update *task, struct doca_buf *updated_rdnc_blocks)
This method sets the updated_rdnc_blocks buffer of an update task.
DOCA_EXPERIMENTAL void doca_ec_task_update_set_update_matrix(struct doca_ec_task_update *task, const struct doca_ec_matrix *update_matrix)
This method sets the update_matrix of an update task.
DOCA_EXPERIMENTAL const struct doca_buf * doca_ec_task_galois_mul_get_src_buf(const struct doca_ec_task_galois_mul *task)
This method gets the source buffer of a Galois multiplication task.
DOCA_EXPERIMENTAL const struct doca_ec_matrix * doca_ec_task_recover_get_recover_matrix(const struct doca_ec_task_recover *task)
This method gets the recover_matrix of a recover task.
DOCA_EXPERIMENTAL doca_error_t doca_ec_cap_task_recover_is_supported(const struct doca_devinfo *devinfo)
DOCA_EXPERIMENTAL const struct doca_ec_matrix * doca_ec_task_galois_mul_get_coding_matrix(const struct doca_ec_task_galois_mul *task)
This method gets the coding matrix of a Galois multiplication task.
@ DOCA_EC_MATRIX_TYPE_VANDERMONDE
@ DOCA_EC_MATRIX_TYPE_CAUCHY
enum doca_error doca_error_t
DOCA API return codes.
Convenience type for representing opaque data.