|
Motr
M0
|
#include "lib/types.h"#include "lib/assert.h"#include "lib/memory.h"#include "lib/errno.h"#include "lib/arith.h"#include "lib/ub.h"#include "ut/ut.h"#include "sns/parity_math.h"
Go to the source code of this file.
Data Structures | |
| struct | mat_collection |
| struct | sns_ir_node |
Macros | |
| #define | KB(x) ((x) * 1024) |
| #define | MB(x) (KB(x) * 1024) |
| #define | _TESTS |
Enumerations | |
| enum | { MAX_NUM_ROWS = 20 } |
| enum | { DATA_UNIT_COUNT_MAX = 30, PARITY_UNIT_COUNT_MAX = 12, DATA_TO_PRTY_RATIO_MAX = DATA_UNIT_COUNT_MAX / PARITY_UNIT_COUNT_MAX, UNIT_BUFF_SIZE_MAX = MB(1), DATA_UNIT_COUNT = 15, PARITY_UNIT_COUNT = 1, RS_MAX_PARITY_UNIT_COUNT = DATA_UNIT_COUNT - 1, NODES = 15 } |
| enum | { NUM_SEG = 8, SEG_SIZE = 64 } |
| enum | recovery_type { FAIL_VECTOR, FAIL_INDEX } |
| enum | failure_type { ALL_DATA, ALL_PARITY, MIXED_FAILURE } |
| enum | ir_matrix_type { IRM_VANDMAT, IRM_NORM_VANDMAT, IRM_SINGULAR_MAT } |
| enum | { UB_ITER = 100 } |
Functions | |
| static void | test_matrix_inverse (void) |
| static void | test_incr_recov_init (void) |
| static void | test_incr_recov (void) |
| static void | test_invalid_input (void) |
| static int | matrix_init (struct mat_collection *) |
| static void | mat_fill (struct m0_matrix *mat, int N, int K, enum ir_matrix_type mt) |
| static void | identity_row_set (struct m0_matrix *mat, int row) |
| static void | vandermonde_row_set (struct m0_matrix *mat, int row) |
| static void | null_matrix_fill (struct m0_matrix *mat, int N) |
| static void | invert (int N, int K, enum ir_matrix_type mt, struct mat_collection *matrices) |
| static bool | mat_compare (struct m0_matrix *mat1, struct m0_matrix *mat2) |
| static void | matrix_fini (struct mat_collection *matrices) |
| static void | parity_calculate (struct m0_parity_math *math, struct m0_bufvec *x, struct m0_bufvec *p, uint32_t num_seg, uint32_t seg_size) |
| static void | direct_recover (struct m0_parity_math *math, struct m0_bufvec *x, struct m0_bufvec *p) |
| static uint32_t * | failure_setup (struct m0_parity_math *math, uint32_t total_failures, enum failure_type ft) |
| static void | array_randomly_fill (uint32_t *r_arr, uint32_t size, uint32_t range) |
| static void | rhs_prepare (const struct m0_sns_ir *ir, struct m0_matvec *des, const struct m0_bufvec *x, const struct m0_bufvec *p, const uint32_t *failed_arr, uint32_t total_failures) |
| static void | reconstruct (const struct m0_sns_ir *ir, const struct m0_matvec *b, struct m0_matvec *r) |
| static bool | compare (const struct m0_sns_ir *ir, const uint32_t *failed_arr, const struct m0_bufvec *x, const struct m0_matvec *r) |
| static void | incremental_recover (struct m0_parity_math *math, struct m0_bufvec *x, struct m0_bufvec *p) |
| static void | sns_ir_nodes_init (struct m0_parity_math *math, struct sns_ir_node *nodes, uint32_t *failed_arr, uint32_t node_nr, uint32_t alive_nr) |
| static void | failure_register (struct m0_sns_ir *ir, struct m0_bufvec *recov_arr, uint32_t *failed_arr, uint32_t total_failures) |
| static void | alive_arrays_fill (struct m0_sns_ir *ir, uint32_t *alive_blocks, uint32_t start_idx, uint32_t count) |
| static void | sns_ir_nodes_recover (struct sns_ir_node *node, uint32_t node_nr, struct m0_bufvec *x, struct m0_bufvec *p) |
| static void | sns_ir_nodes_gather (struct sns_ir_node *node, uint32_t node_nr, struct m0_bufvec *x, struct m0_bufvec *p, uint32_t *failed_arr) |
| static void | sns_ir_nodes_compare (struct sns_ir_node *node, struct m0_bufvec *x, struct m0_bufvec *p) |
| static void | sns_ir_nodes_fini (struct sns_ir_node *node, uint32_t node_nr, uint32_t total_failures) |
| static uint32_t | block_nr (const struct m0_sns_ir *ir) |
| static void | bufvec_initialize (struct m0_bufvec **bvec, uint32_t count, uint32_t num_seg, uint32_t size) |
| static void | bufvec_fill (struct m0_bufvec *x) |
| static void | bufvec_fini (struct m0_bufvec *bvec, uint32_t count) |
| static bool | bufvec_eq (struct m0_bufvec *bvec1, struct m0_bufvec *bvec2) |
| static void | buf_initialize (struct m0_buf *buf, uint32_t size, uint32_t len) |
| static void | buf_free (struct m0_buf *buf, uint32_t count) |
| static void | bufvec_buf (struct m0_bufvec *bvec, struct m0_buf *buf, uint32_t count, bool dir) |
| static void | unit_spoil (const uint32_t buff_size, const uint32_t fail_count, const uint32_t data_count) |
| static bool | expected_eq (const uint32_t data_count, const uint32_t buff_size) |
| static bool | config_generate (uint32_t *data_count, uint32_t *parity_count, uint32_t *buff_size, const enum m0_parity_cal_algo algo) |
| static bool | rand_rs_config_generate (uint32_t *data_count, uint32_t *parity_count, uint32_t *buff_size) |
| static void | test_recovery (const enum m0_parity_cal_algo algo, const enum recovery_type rt) |
| static void | test_rs_fv_recover (void) |
| static void | test_rs_fv_rand_recover (void) |
| static void | test_xor_fv_recover (void) |
| static void | test_xor_fail_idx_recover (void) |
| static void | test_buffer_xor (void) |
| static void | test_parity_math_diff (uint32_t parity_cnt) |
| static void | test_parity_math_diff_xor (void) |
| static void | test_parity_math_diff_rs (void) |
| static void | test_incr_recov_rs (void) |
| static void | _buf_free (struct m0_buf *buf) |
| static int | ub_init (const char *opts M0_UNUSED) |
| void | parity_math_tb (void) |
| static void | ub_small_4K (int iter) |
| static void | ub_medium_4K (int iter) |
| static void | ub_large_4K (int iter) |
| static void | ub_small_1M (int iter) |
| static void | ub_medium_1M (int iter) |
| static void | ub_large_1M (int iter) |
| static void | ub_small_32K (int iter) |
| static void | ub_medium_32K (int iter) |
| static void | ub_large_32K (int iter) |
| static void | ub_small_4_2_4K (int iter) |
| static void | ub_small_4_2_256K (int iter) |
| static void | ub_small_4_2_1M (int iter) |
Variables | |
| static uint8_t | expected [DATA_UNIT_COUNT_MAX][UNIT_BUFF_SIZE_MAX] |
| static uint8_t | data [DATA_UNIT_COUNT_MAX][UNIT_BUFF_SIZE_MAX] |
| static uint8_t | parity [DATA_UNIT_COUNT_MAX][UNIT_BUFF_SIZE_MAX] |
| static uint8_t | fail [DATA_UNIT_COUNT_MAX+PARITY_UNIT_COUNT_MAX] |
| static int32_t | duc = DATA_UNIT_COUNT_MAX |
| static int32_t | puc = PARITY_UNIT_COUNT_MAX |
| static int32_t | fuc = PARITY_UNIT_COUNT_MAX |
| static uint32_t | UNIT_BUFF_SIZE = 256 |
| static int32_t | fail_index_xor |
| static uint64_t | seed = 42 |
| struct m0_ut_suite | parity_math_ut |
| struct m0_ut_suite | parity_math_ssse3_ut |
| struct m0_ub_set | m0_parity_math_ub |
| #define _TESTS |
Definition at line 1405 of file parity_math_ut.c.
Definition at line 32 of file parity_math_ut.c.
Definition at line 33 of file parity_math_ut.c.
| anonymous enum |
| Enumerator | |
|---|---|
| MAX_NUM_ROWS | |
Definition at line 35 of file parity_math_ut.c.
| anonymous enum |
| Enumerator | |
|---|---|
| DATA_UNIT_COUNT_MAX | |
| PARITY_UNIT_COUNT_MAX | |
| DATA_TO_PRTY_RATIO_MAX | |
| UNIT_BUFF_SIZE_MAX | |
| DATA_UNIT_COUNT | |
| PARITY_UNIT_COUNT | |
| RS_MAX_PARITY_UNIT_COUNT | |
| NODES | |
Definition at line 39 of file parity_math_ut.c.
| anonymous enum |
| Enumerator | |
|---|---|
| NUM_SEG | |
| SEG_SIZE | |
Definition at line 50 of file parity_math_ut.c.
| anonymous enum |
| Enumerator | |
|---|---|
| UB_ITER | |
Definition at line 1589 of file parity_math_ut.c.
| enum failure_type |
| Enumerator | |
|---|---|
| ALL_DATA | |
| ALL_PARITY | |
| MIXED_FAILURE | |
Definition at line 86 of file parity_math_ut.c.
| enum ir_matrix_type |
| Enumerator | |
|---|---|
| IRM_VANDMAT | |
| IRM_NORM_VANDMAT | |
| IRM_SINGULAR_MAT | |
Definition at line 92 of file parity_math_ut.c.
| enum recovery_type |
| Enumerator | |
|---|---|
| FAIL_VECTOR | |
| FAIL_INDEX | |
Definition at line 73 of file parity_math_ut.c.
|
static |
Definition at line 1353 of file parity_math_ut.c.


|
static |
|
static |
Definition at line 858 of file parity_math_ut.c.


|
inlinestatic |
|
static |
Definition at line 1371 of file parity_math_ut.c.


|
static |
Definition at line 1359 of file parity_math_ut.c.


|
static |
Definition at line 1326 of file parity_math_ut.c.


Definition at line 1380 of file parity_math_ut.c.


|
static |
Definition at line 1309 of file parity_math_ut.c.


|
static |
Definition at line 1299 of file parity_math_ut.c.


|
static |
Definition at line 1284 of file parity_math_ut.c.


|
static |
Definition at line 923 of file parity_math_ut.c.


|
static |
Definition at line 195 of file parity_math_ut.c.


|
static |
Definition at line 787 of file parity_math_ut.c.


|
static |
|
static |
Definition at line 1053 of file parity_math_ut.c.


|
static |
Definition at line 833 of file parity_math_ut.c.


|
static |
Definition at line 669 of file parity_math_ut.c.


|
static |
Definition at line 966 of file parity_math_ut.c.


|
static |
Definition at line 606 of file parity_math_ut.c.


Definition at line 705 of file parity_math_ut.c.


|
static |
Definition at line 622 of file parity_math_ut.c.


|
static |
Definition at line 718 of file parity_math_ut.c.


|
static |
Definition at line 584 of file parity_math_ut.c.


|
static |
Definition at line 696 of file parity_math_ut.c.


|
static |
Definition at line 762 of file parity_math_ut.c.


| void parity_math_tb | ( | void | ) |
Definition at line 1437 of file parity_math_ut.c.


|
static |
Definition at line 266 of file parity_math_ut.c.


|
static |
Definition at line 897 of file parity_math_ut.c.


|
static |
Definition at line 1213 of file parity_math_ut.c.


|
static |
Definition at line 1237 of file parity_math_ut.c.


|
static |
Definition at line 1141 of file parity_math_ut.c.


|
static |
Definition at line 1003 of file parity_math_ut.c.


|
static |
Definition at line 1090 of file parity_math_ut.c.


|
static |
|
static |
Definition at line 940 of file parity_math_ut.c.


|
static |
Definition at line 732 of file parity_math_ut.c.


|
static |
|
static |
Definition at line 1253 of file parity_math_ut.c.


|
static |
Definition at line 557 of file parity_math_ut.c.


|
static |
Definition at line 464 of file parity_math_ut.c.


|
static |
|
static |
|
static |
Definition at line 313 of file parity_math_ut.c.


|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1432 of file parity_math_ut.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 684 of file parity_math_ut.c.


|
static |
Definition at line 56 of file parity_math_ut.c.
|
static |
Definition at line 59 of file parity_math_ut.c.
|
static |
Definition at line 55 of file parity_math_ut.c.
|
static |
Definition at line 58 of file parity_math_ut.c.
|
static |
Definition at line 63 of file parity_math_ut.c.
|
static |
Definition at line 61 of file parity_math_ut.c.
| struct m0_ub_set m0_parity_math_ub |
Definition at line 1591 of file parity_math_ut.c.
|
static |
Definition at line 57 of file parity_math_ut.c.
| struct m0_ut_suite parity_math_ssse3_ut |
Definition at line 1424 of file parity_math_ut.c.
| struct m0_ut_suite parity_math_ut |
Definition at line 1416 of file parity_math_ut.c.
|
static |
Definition at line 60 of file parity_math_ut.c.
|
static |
Definition at line 64 of file parity_math_ut.c.
|
static |
Definition at line 62 of file parity_math_ut.c.