Add the ability for backends to specify
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
This commit is contained in:
@@ -106,6 +106,10 @@ struct ec_backend_common {
|
||||
char soversion[MAX_LEN]; /* EC backend shared library version */
|
||||
|
||||
struct ec_backend_op_stubs *ops; /* EC backend stubs */
|
||||
int metadata_adder; /* EC backend custom metadata adder -
|
||||
* metadata_adder bytes are added to
|
||||
* the fragment size when allocating
|
||||
* data/parity fragment buffers */
|
||||
};
|
||||
|
||||
/* EC backend definition */
|
||||
|
||||
@@ -588,4 +588,5 @@ struct ec_backend_common backend_isa_l_rs_vand = {
|
||||
#endif
|
||||
.soversion = "2.0",
|
||||
.ops = &isa_l_rs_vand_op_stubs,
|
||||
.metadata_adder = 0,
|
||||
};
|
||||
|
||||
@@ -384,4 +384,5 @@ struct ec_backend_common backend_jerasure_rs_cauchy = {
|
||||
#endif
|
||||
.soversion = "2.0",
|
||||
.ops = &jerasure_rs_cauchy_op_stubs,
|
||||
.metadata_adder = 0,
|
||||
};
|
||||
|
||||
@@ -325,4 +325,5 @@ struct ec_backend_common backend_jerasure_rs_vand = {
|
||||
#endif
|
||||
.soversion = "2.0",
|
||||
.ops = &jerasure_rs_vand_op_stubs,
|
||||
.metadata_adder = 0,
|
||||
};
|
||||
|
||||
@@ -223,5 +223,6 @@ struct ec_backend_common backend_null = {
|
||||
#endif
|
||||
.soversion = "1.0",
|
||||
.ops = &null_op_stubs,
|
||||
.metadata_adder = 0,
|
||||
};
|
||||
|
||||
|
||||
@@ -170,5 +170,6 @@ struct ec_backend_common backend_flat_xor_hd = {
|
||||
#endif
|
||||
.soversion = "1.0",
|
||||
.ops = &flat_xor_hd_op_stubs,
|
||||
.metadata_adder = 0,
|
||||
};
|
||||
|
||||
|
||||
@@ -175,6 +175,9 @@ int get_aligned_data_size(ec_backend_t instance, int data_len)
|
||||
int alignment_multiple;
|
||||
int aligned_size = 0;
|
||||
|
||||
/* Account for any custom metadata the backend wants to add in data_len */
|
||||
data_len += instance->common.metadata_adder;
|
||||
|
||||
/*
|
||||
* For Cauchy reed-solomon align to k*word_size*packet_size
|
||||
* For Vandermonde reed-solomon and flat-XOR, align to k*word_size
|
||||
|
||||
Reference in New Issue
Block a user