Skip to content

Commit b8d5633

Browse files
pablodelaratkanteck
authored andcommitted
erasure_code: check for size alignment on powerpc gf_vect_mul_vsx implementation
Follows the rest of the gf_vect_mul implementations for other architectures, and checks for size alignment, stated in the documentation. Signed-off-by: Pablo de Lara <[email protected]>
1 parent 91e7906 commit b8d5633

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

erasure_code/gf_vect_mul_test.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ int main(int argc, char *argv[])
171171
#endif
172172
}
173173

174-
#if !defined(ppc64le)
175174
// Test all unsupported sizes up to TEST_SIZE
176175
for (size = 0; size < TEST_SIZE; size++) {
177176
if (size % align != 0 && gf_vect_mul(size, gf_const_tbl, buff1, buff2) == 0) {
@@ -181,10 +180,7 @@ int main(int argc, char *argv[])
181180
goto exit;
182181
}
183182
}
184-
#else
185-
printf
186-
("WARNING: Test disabled on PPC due to known issue https://github.com/intel/isa-l/issues/263\n");
187-
#endif
183+
188184
printf(" done: Pass\n");
189185
fflush(0);
190186

erasure_code/ppc64le/ec_base_vsx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ void ec_encode_data_update(int len, int k, int rows, int vec_i, unsigned char *v
9292

9393
int gf_vect_mul(int len, unsigned char *a, void *src, void *dest)
9494
{
95+
/* Size must be aligned to 32 bytes */
96+
if ((len % 32) != 0)
97+
return -1;
98+
9599
gf_vect_mul_vsx(len, a, (unsigned char *)src, (unsigned char *)dest);
96100
return 0;
97101
}

0 commit comments

Comments
 (0)