summaryrefslogtreecommitdiff
path: root/test/liberasurecode_test.c
diff options
context:
space:
mode:
authorKota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>2016-11-03 04:54:19 -0700
committerKota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>2016-12-06 17:08:55 -0800
commit8d067ab2f631b147745e5eb3cf85056042c1439e (patch)
treebd2aaa2b70ab17418f9e62eab525aae6425369af /test/liberasurecode_test.c
parent0a2c06b8b446cbe4fda89c18c20b069728c70323 (diff)
downloadliberasurecode-8d067ab2f631b147745e5eb3cf85056042c1439e.tar.gz
ISA-L Cauchy support
This is for supporting ISA-L cauchy based matrix. The difference from isa_l_rs_vand is only the matrix to use the encode/decode calculation. As a known issue, isa_l_rs_vand backend has constraint for the combinations of the available fragment to be able to decode/reconstuct. (See related change in detail) To avoid the constraint, this patch adds another isa-l backend to use cauchy matrix and keep the backward compatibility, this is in another isa_l_rs_cauchy namespace. For implementation consieration, the code is almost same except the matrix generation fucntion so that this patch makes isa_l_common.c file for gathering common fucntions like init/encode/decode/reconstruct. And then the common init funciton takes an extra args "gen_matrix_func_name" for entry point to load the fucntion by dlsym from isa-l .so file. Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Related-Change: Icee788a0931fe692fe0de31fabc4ba450e338a87 Change-Id: I6eb150d9d0c3febf233570fa7729f9f72df2e9be
Diffstat (limited to 'test/liberasurecode_test.c')
-rw-r--r--test/liberasurecode_test.c69
1 files changed, 68 insertions, 1 deletions
diff --git a/test/liberasurecode_test.c b/test/liberasurecode_test.c
index 386d49f..32b2e9b 100644
--- a/test/liberasurecode_test.c
+++ b/test/liberasurecode_test.c
@@ -39,6 +39,7 @@
#define JERASURE_RS_VAND_BACKEND "jerasure_rs_vand"
#define JERASURE_RS_CAUCHY_BACKEND "jerasure_rs_cauchy"
#define ISA_L_RS_VAND_BACKEND "isa_l_rs_vand"
+#define ISA_L_RS_CAUCHY_BACKEND "isa_l_rs_cauchy"
#define SHSS_BACKEND "shss"
#define RS_VAND_BACKEND "liberasurecode_rs_vand"
@@ -281,6 +282,8 @@ char * get_name_from_backend_id(ec_backend_id_t be) {
return FLAT_XOR_HD_BACKEND;
case EC_BACKEND_ISA_L_RS_VAND:
return ISA_L_RS_VAND_BACKEND;
+ case EC_BACKEND_ISA_L_RS_CAUCHY:
+ return ISA_L_RS_CAUCHY_BACKEND;
case EC_BACKEND_SHSS:
return SHSS_BACKEND;
case EC_BACKEND_LIBERASURECODE_RS_VAND:
@@ -316,6 +319,9 @@ struct ec_args *create_ec_args(ec_backend_id_t be, ec_checksum_type_t ct, int ba
case EC_BACKEND_ISA_L_RS_VAND:
backend_args_array = isa_l_test_args;
break;
+ case EC_BACKEND_ISA_L_RS_CAUCHY:
+ backend_args_array = isa_l_test_args;
+ break;
case EC_BACKEND_SHSS:
backend_args_array = shss_test_args;
break;
@@ -1910,7 +1916,7 @@ struct testcase testcases[] = {
test_verify_stripe_metadata_frag_idx_invalid,
EC_BACKEND_JERASURE_RS_CAUCHY, CHKSUM_CRC32,
.skip = false},
- // ISA-L tests
+ // ISA-L rs_vand tests
{"create_and_destroy_backend",
test_create_and_destroy_backend,
EC_BACKEND_ISA_L_RS_VAND, CHKSUM_NONE,
@@ -1974,6 +1980,67 @@ struct testcase testcases[] = {
{"test_isa_l_decode_reconstruct_specific_error_case",
test_decode_reconstruct_specific_error_case,
EC_BACKENDS_MAX, 0, // note this test is using ISA-L in hard coded
+ .skip = false},
+ // ISA-L rs cauchy tests
+ {"create_and_destroy_backend",
+ test_create_and_destroy_backend,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"simple_encode_isa_l",
+ test_simple_encode_decode,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"decode_with_missing_data_isa_l",
+ test_decode_with_missing_data,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"decode_with_missing_multi_data_isa_l",
+ test_decode_with_missing_multi_data,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"decode_with_missing_multi_parity_isa_l",
+ test_decode_with_missing_multi_parity,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"test_decode_with_missing_multi_data_parity_isa_l",
+ test_decode_with_missing_multi_data_parity,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"simple_reconstruct_isa_l",
+ test_simple_reconstruct,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"test_fragments_needed_isa_l",
+ test_fragments_needed,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"test_get_fragment_metadata_isa_l",
+ test_get_fragment_metadata,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_NONE,
+ .skip = false},
+ {"test_verify_stripe_metadata",
+ test_verify_stripe_metadata,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32,
+ .skip = false},
+ {"test_verify_stripe_metadata_libec_mismatch",
+ test_verify_stripe_metadata_libec_mismatch,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32,
+ .skip = false},
+ {"test_verify_stripe_metadata_magic_mismatch",
+ test_verify_stripe_metadata_magic_mismatch,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32,
+ .skip = false},
+ {"test_verify_stripe_metadata_be_id_mismatch",
+ test_verify_stripe_metadata_be_id_mismatch,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32,
+ .skip = false},
+ {"test_verify_stripe_metadata_be_ver_mismatch",
+ test_verify_stripe_metadata_be_ver_mismatch,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32,
+ .skip = false},
+ {"test_verify_stripe_metadata_frag_idx_invalid",
+ test_verify_stripe_metadata_frag_idx_invalid,
+ EC_BACKEND_ISA_L_RS_CAUCHY, CHKSUM_CRC32,
.skip = false},
// shss tests
{"create_and_destroy_backend",