Add GFNI affine parity generation for RAID polynomial

This commit is contained in:
Andrea Mazzoleni 2026-08-19 17:59:02 +02:00
parent 711ccba629
commit c34cfe24da
11 changed files with 805 additions and 28 deletions

View file

@ -73,6 +73,13 @@ int main(void)
/* LCOV_EXCL_STOP */
}
printf("Test GFNI affine matrices...\n");
if (raid_test_gfaffine() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test Cauchy RAID parity generation with 1-%u data disks...\n", RAID_DATA_MAX);
for (int i = 1; i <= RAID_DATA_MAX; ++i) {
if (raid_test_par(RAID_MODE_CAUCHY_RAID, i, TEST_SIZE) != 0) {

View file

@ -16,6 +16,13 @@ int main(void)
raid_init();
printf("Test GFNI affine matrices\n");
if (raid_test_gfaffine() != 0) {
/* LCOV_EXCL_START */
goto bail;
/* LCOV_EXCL_STOP */
}
printf("Test Cauchy RAID\n");
if (raid_test_poly(RAID_MODE_CAUCHY_RAID) != 0) {
/* LCOV_EXCL_START */

View file

@ -208,6 +208,10 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
if (raid_cpu_has_avx2gfni())
printf("%8s", "");
if (raid_cpu_has_avx512gfni())
printf("%8s", "");
#endif
#endif
printf("\n");
@ -351,7 +355,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen2_avx2gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -363,7 +371,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen2_avx512gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -470,7 +482,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen3_avx2gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -482,7 +498,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen3_avx512gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -589,7 +609,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen4_avx2gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -601,7 +625,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen4_avx512gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -706,7 +734,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen5_avx2gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -718,7 +750,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen5_avx512gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -823,7 +859,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen6_avx2gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}
@ -835,7 +875,11 @@ void speed_gen(int nd, void **v, int size, int delta, int period, const char *ms
printf("%8" PRIu64, ds / dt);
} else {
printf("%8s", "");
SPEED_START {
raid_gen6_avx512gfni_raid(nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
}
fflush(stdout);
}