liberasurecode  1.2.0
Erasure Code API library
 All Data Structures Files Functions Variables Typedefs Macros
Data Structures | Macros | Typedefs | Functions | Variables
isa_l_rs_vand.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "erasurecode.h"
#include "erasurecode_backend.h"
#include "erasurecode_helpers.h"
#include "erasurecode_helpers_ext.h"

Go to the source code of this file.

Data Structures

struct  isa_l_rs_vand_descriptor
 

Macros

#define ISA_L_RS_VAND_LIB_MAJOR   2
 
#define ISA_L_RS_VAND_LIB_MINOR   13
 
#define ISA_L_RS_VAND_LIB_REV   0
 
#define ISA_L_RS_VAND_LIB_VER_STR   "2.13"
 
#define ISA_L_RS_VAND_LIB_NAME   "isa_l_rs_vand"
 
#define ISA_L_RS_VAND_SO_NAME   "libisal.so.2"
 
#define ISA_L_W   8
 

Typedefs

typedef void(* ec_encode_data_func )(int, int, int, unsigned char *, unsigned char **, unsigned char **)
 
typedef void(* ec_init_tables_func )(int, int, unsigned char *, unsigned char *)
 
typedef void(* gf_gen_rs_matrix_func )(unsigned char *, int, int)
 
typedef int(* gf_invert_matrix_func )(unsigned char *, unsigned char *, const int)
 
typedef unsigned char(* gf_mul_func )(unsigned char, unsigned char)
 

Functions

static int isa_l_rs_vand_encode (void *desc, char **data, char **parity, int blocksize)
 
static unsigned char * isa_l_get_decode_matrix (int k, int m, unsigned char *encode_matrix, int *missing_idxs)
 
static int get_num_missing_elements (int *missing_idxs)
 
static void mult_and_xor_row (unsigned char *to_row, unsigned char *from_row, unsigned char val, int num_elems, gf_mul_func gf_mul)
 
static unsigned char * get_inverse_rows (int k, int m, unsigned char *decode_inverse, unsigned char *encode_matrix, int *missing_idxs, gf_mul_func gf_mul)
 
static int isa_l_rs_vand_decode (void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
 
static int isa_l_rs_vand_reconstruct (void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
 
static int isa_l_rs_vand_min_fragments (void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)
 
static void * isa_l_rs_vand_init (struct ec_backend_args *args, void *backend_sohandle)
 
static int isa_l_rs_vand_element_size (void *desc)
 Return the element-size, which is the number of bits stored on a given device, per codeword. More...
 
static int isa_l_rs_vand_exit (void *desc)
 
static bool isa_l_rs_vand_is_compatible_with (uint32_t version)
 

Variables

struct ec_backend_op_stubs isa_l_rs_vand_ops
 
struct ec_backend isa_l_rs_vand
 
struct ec_backend_common backend_isa_l_rs_vand
 
struct ec_backend_op_stubs isa_l_rs_vand_op_stubs
 

Macro Definition Documentation

#define ISA_L_RS_VAND_LIB_MAJOR   2

Definition at line 38 of file isa_l_rs_vand.c.

#define ISA_L_RS_VAND_LIB_MINOR   13

Definition at line 39 of file isa_l_rs_vand.c.

#define ISA_L_RS_VAND_LIB_NAME   "isa_l_rs_vand"

Definition at line 42 of file isa_l_rs_vand.c.

#define ISA_L_RS_VAND_LIB_REV   0

Definition at line 40 of file isa_l_rs_vand.c.

#define ISA_L_RS_VAND_LIB_VER_STR   "2.13"

Definition at line 41 of file isa_l_rs_vand.c.

#define ISA_L_RS_VAND_SO_NAME   "libisal.so.2"

Definition at line 46 of file isa_l_rs_vand.c.

#define ISA_L_W   8

Definition at line 470 of file isa_l_rs_vand.c.

Referenced by isa_l_rs_vand_init().

Typedef Documentation

typedef void(* ec_encode_data_func)(int, int, int, unsigned char *, unsigned char **, unsigned char **)

Definition at line 54 of file isa_l_rs_vand.c.

typedef void(* ec_init_tables_func)(int, int, unsigned char *, unsigned char *)

Definition at line 55 of file isa_l_rs_vand.c.

typedef void(* gf_gen_rs_matrix_func)(unsigned char *, int, int)

Definition at line 56 of file isa_l_rs_vand.c.

typedef int(* gf_invert_matrix_func)(unsigned char *, unsigned char *, const int)

Definition at line 57 of file isa_l_rs_vand.c.

typedef unsigned char(* gf_mul_func)(unsigned char, unsigned char)

Definition at line 58 of file isa_l_rs_vand.c.

Function Documentation

static unsigned char* get_inverse_rows ( int  k,
int  m,
unsigned char *  decode_inverse,
unsigned char *  encode_matrix,
int *  missing_idxs,
gf_mul_func  gf_mul 
)
static
static int get_num_missing_elements ( int *  missing_idxs)
static

Definition at line 131 of file isa_l_rs_vand.c.

Referenced by get_inverse_rows(), and isa_l_rs_vand_decode().

static unsigned char* isa_l_get_decode_matrix ( int  k,
int  m,
unsigned char *  encode_matrix,
int *  missing_idxs 
)
static
static int isa_l_rs_vand_decode ( void *  desc,
char **  data,
char **  parity,
int *  missing_idxs,
int  blocksize 
)
static
static int isa_l_rs_vand_element_size ( void *  desc)
static

Return the element-size, which is the number of bits stored on a given device, per codeword.

This is always 8 in ISA-L

Returns the size in bits!

Definition at line 571 of file isa_l_rs_vand.c.

static int isa_l_rs_vand_encode ( void *  desc,
char **  data,
char **  parity,
int  blocksize 
)
static
static int isa_l_rs_vand_exit ( void *  desc)
static

Definition at line 576 of file isa_l_rs_vand.c.

static void* isa_l_rs_vand_init ( struct ec_backend_args *  args,
void *  backend_sohandle 
)
static
static bool isa_l_rs_vand_is_compatible_with ( uint32_t  version)
static

Definition at line 591 of file isa_l_rs_vand.c.

References backend_isa_l_rs_vand.

static int isa_l_rs_vand_min_fragments ( void *  desc,
int *  missing_idxs,
int *  fragments_to_exclude,
int *  fragments_needed 
)
static

Definition at line 443 of file isa_l_rs_vand.c.

References isa_l_rs_vand_descriptor::k, and isa_l_rs_vand_descriptor::m.

static int isa_l_rs_vand_reconstruct ( void *  desc,
char **  data,
char **  parity,
int *  missing_idxs,
int  destination_idx,
int  blocksize 
)
static

Get available elements and compute the inverse of their corresponding rows.

Get the row needed to reconstruct

Fill in the available elements

Copy pointer of buffer to reconstruct

Do the reconstruction

Definition at line 333 of file isa_l_rs_vand.c.

References isa_l_rs_vand_descriptor::ec_encode_data, isa_l_rs_vand_descriptor::ec_init_tables, get_inverse_rows(), isa_l_rs_vand_descriptor::gf_invert_matrix, isa_l_rs_vand_descriptor::gf_mul, isa_l_get_decode_matrix(), isa_l_rs_vand_descriptor::k, isa_l_rs_vand_descriptor::m, and isa_l_rs_vand_descriptor::matrix.

static void mult_and_xor_row ( unsigned char *  to_row,
unsigned char *  from_row,
unsigned char  val,
int  num_elems,
gf_mul_func  gf_mul 
)
static

Definition at line 142 of file isa_l_rs_vand.c.

References isa_l_rs_vand_descriptor::gf_mul.

Referenced by get_inverse_rows().

Variable Documentation

struct ec_backend_common backend_isa_l_rs_vand
Initial value:
= {
.id = EC_BACKEND_ISA_L_RS_VAND,
.backend_metadata_size = 0,
.ec_backend_version = _VERSION(ISA_L_RS_VAND_LIB_MAJOR,
}
#define ISA_L_RS_VAND_LIB_MINOR
Definition: isa_l_rs_vand.c:39
#define ISA_L_RS_VAND_LIB_VER_STR
Definition: isa_l_rs_vand.c:41
#define ISA_L_RS_VAND_LIB_NAME
Definition: isa_l_rs_vand.c:42
#define ISA_L_RS_VAND_SO_NAME
Definition: isa_l_rs_vand.c:46
struct ec_backend_op_stubs isa_l_rs_vand_op_stubs
#define ISA_L_RS_VAND_LIB_MAJOR
Definition: isa_l_rs_vand.c:38
#define ISA_L_RS_VAND_LIB_REV
Definition: isa_l_rs_vand.c:40

Definition at line 52 of file isa_l_rs_vand.c.

Referenced by isa_l_rs_vand_is_compatible_with().

struct ec_backend isa_l_rs_vand

Definition at line 51 of file isa_l_rs_vand.c.

struct ec_backend_op_stubs isa_l_rs_vand_op_stubs
Initial value:
= {
.RECONSTRUCT = isa_l_rs_vand_reconstruct,
.ISCOMPATIBLEWITH = isa_l_rs_vand_is_compatible_with,
}
static int isa_l_rs_vand_decode(void *desc, char **data, char **parity, int *missing_idxs, int blocksize)
static bool isa_l_rs_vand_is_compatible_with(uint32_t version)
static void * isa_l_rs_vand_init(struct ec_backend_args *args, void *backend_sohandle)
static int isa_l_rs_vand_exit(void *desc)
static int isa_l_rs_vand_reconstruct(void *desc, char **data, char **parity, int *missing_idxs, int destination_idx, int blocksize)
static int isa_l_rs_vand_encode(void *desc, char **data, char **parity, int blocksize)
Definition: isa_l_rs_vand.c:81
static int isa_l_rs_vand_element_size(void *desc)
Return the element-size, which is the number of bits stored on a given device, per codeword...
static int isa_l_rs_vand_min_fragments(void *desc, int *missing_idxs, int *fragments_to_exclude, int *fragments_needed)

Definition at line 595 of file isa_l_rs_vand.c.

struct ec_backend_op_stubs isa_l_rs_vand_ops

Definition at line 50 of file isa_l_rs_vand.c.