Make all RAID forwarders static and local using a new registration interface

Co-authored-by: Andrea Mazzoleni <amadvance@gmail.com>
This commit is contained in:
Christoph Hellwig 2026-04-11 18:26:55 +02:00 • committed by Andrea Mazzoleni
parent 4016f0974a
commit cf515b82b2
12 changed files with 568 additions and 529 deletions

View file

@ -290,7 +290,7 @@ void speed(int period, int nd, int size)
/* GEN1 */
printf("%8s", "gen1");
printf("%8s", raid_gen1_tag());
printf("%8s", raid_gen_tag(RAID_ALGO_CAUCHY_PAR1));
fflush(stdout);
printf("%8s", "");
@ -343,7 +343,7 @@ void speed(int period, int nd, int size)
/* GEN2 */
printf("%8s", "gen2");
printf("%8s", raid_gen2_tag());
printf("%8s", raid_gen_tag(RAID_ALGO_CAUCHY_PAR2));
fflush(stdout);
printf("%8s", "");
@ -402,7 +402,7 @@ void speed(int period, int nd, int size)
/* GENz */
printf("%8s", "genz");
printf("%8s", raid_genz_tag());
printf("%8s", raid_gen_tag(RAID_ALGO_VANDERMONDE_PAR3));
fflush(stdout);
printf("%8s", "");
@ -465,7 +465,7 @@ void speed(int period, int nd, int size)
/* GEN3 */
printf("%8s", "gen3");
printf("%8s", raid_gen3_tag());
printf("%8s", raid_gen_tag(RAID_ALGO_CAUCHY_PAR3));
fflush(stdout);
SPEED_START {
@ -528,7 +528,7 @@ void speed(int period, int nd, int size)
/* GEN4 */
printf("%8s", "gen4");
printf("%8s", raid_gen4_tag());
printf("%8s", raid_gen_tag(RAID_ALGO_CAUCHY_PAR4));
fflush(stdout);
SPEED_START {
@ -593,7 +593,7 @@ void speed(int period, int nd, int size)
/* GEN5 */
printf("%8s", "gen5");
printf("%8s", raid_gen5_tag());
printf("%8s", raid_gen_tag(RAID_ALGO_CAUCHY_PAR5));
fflush(stdout);
SPEED_START {
@ -658,7 +658,7 @@ void speed(int period, int nd, int size)
/* GEN6 */
printf("%8s", "gen6");
printf("%8s", raid_gen6_tag());
printf("%8s", raid_gen_tag(RAID_ALGO_CAUCHY_PAR5));
fflush(stdout);
SPEED_START {
@ -734,12 +734,12 @@ void speed(int period, int nd, int size)
printf("\n");
printf("%8s", "rec1");
printf("%8s", raid_rec1_tag());
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR1));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[0] = sizeof(void*) == 8 ? raid_gen1_int64 : raid_gen1_int32;
raid_gen_force(1, sizeof(void*) == 8 ? raid_gen1_int64 : raid_gen1_int32);
/* +1 to avoid GEN1 optimized case */
raid_rec1_int8(1, id, ip + 1, nd, size, v);
} SPEED_STOP
@ -752,7 +752,7 @@ void speed(int period, int nd, int size)
if (raid_cpu_has_ssse3()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[0] = raid_gen1_sse2;
raid_gen_force(1, raid_gen1_sse2);
/* +1 to avoid GEN1 optimized case */
raid_rec1_ssse3(1, id, ip + 1, nd, size, v);
} SPEED_STOP
@ -765,7 +765,7 @@ void speed(int period, int nd, int size)
if (raid_cpu_has_avx2()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[0] = raid_gen1_avx2;
raid_gen_force(1, raid_gen1_avx2);
/* +1 to avoid GEN1 optimized case */
raid_rec1_avx2(1, id, ip + 1, nd, size, v);
} SPEED_STOP
@ -778,12 +778,12 @@ void speed(int period, int nd, int size)
printf("\n");
printf("%8s", "rec2");
printf("%8s", raid_rec2_tag());
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR2));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[1] = sizeof(void*) == 8 ? raid_gen2_int64 : raid_gen2_int32;
raid_gen_force(2, sizeof(void*) == 8 ? raid_gen2_int64 : raid_gen2_int32);
/* +1 to avoid GEN2 optimized case */
raid_rec2_int8(2, id, ip + 1, nd, size, v);
} SPEED_STOP
@ -797,9 +797,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[1] = raid_gen2_sse2ext;
raid_gen_force(2, raid_gen2_sse2ext);
#else
raid_gen_ptr[1] = raid_gen2_sse2;
raid_gen_force(2, raid_gen2_sse2);
#endif
/* +1 to avoid GEN2 optimized case */
raid_rec2_ssse3(2, id, ip + 1, nd, size, v);
@ -813,7 +813,7 @@ void speed(int period, int nd, int size)
if (raid_cpu_has_avx2()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[1] = raid_gen2_avx2;
raid_gen_force(2, raid_gen2_avx2);
/* +1 to avoid GEN1 optimized case */
raid_rec2_avx2(2, id, ip + 1, nd, size, v);
} SPEED_STOP
@ -826,12 +826,12 @@ void speed(int period, int nd, int size)
printf("\n");
printf("%8s", "rec3");
printf("%8s", raid_recX_tag());
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR3));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[2] = raid_gen3_int8;
raid_gen_force(3, raid_gen3_int8);
raid_recX_int8(3, id, ip, nd, size, v);
} SPEED_STOP
@ -844,9 +844,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[2] = raid_gen3_ssse3ext;
raid_gen_force(3, raid_gen3_ssse3ext);
#else
raid_gen_ptr[2] = raid_gen3_ssse3;
raid_gen_force(3, raid_gen3_ssse3);
#endif
raid_recX_ssse3(3, id, ip, nd, size, v);
} SPEED_STOP
@ -860,9 +860,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[2] = raid_gen3_avx2ext;
raid_gen_force(3, raid_gen3_avx2ext);
#else
raid_gen_ptr[2] = raid_gen3_ssse3;
raid_gen_force(3, raid_gen3_ssse3);
#endif
raid_recX_avx2(3, id, ip, nd, size, v);
} SPEED_STOP
@ -875,12 +875,12 @@ void speed(int period, int nd, int size)
printf("\n");
printf("%8s", "rec4");
printf("%8s", raid_recX_tag());
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR4));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[3] = raid_gen4_int8;
raid_gen_force(4, raid_gen4_int8);
raid_recX_int8(4, id, ip, nd, size, v);
} SPEED_STOP
@ -893,9 +893,10 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[3] = raid_gen4_ssse3ext;
raid_gen_force(4, raid_gen4_ssse3ext);
#else
raid_gen_ptr[3] = raid_gen4_ssse3;
raid_gen_force(4, raid_gen4_ssse3);
#endif
raid_recX_ssse3(4, id, ip, nd, size, v);
} SPEED_STOP
@ -909,9 +910,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[3] = raid_gen4_avx2ext;
raid_gen_force(4, raid_gen4_avx2ext);
#else
raid_gen_ptr[3] = raid_gen4_ssse3;
raid_gen_force(4, raid_gen4_ssse3);
#endif
raid_recX_avx2(4, id, ip, nd, size, v);
} SPEED_STOP
@ -924,12 +925,12 @@ void speed(int period, int nd, int size)
printf("\n");
printf("%8s", "rec5");
printf("%8s", raid_recX_tag());
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR5));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[4] = raid_gen5_int8;
raid_gen_force(5, raid_gen5_int8);
raid_recX_int8(5, id, ip, nd, size, v);
} SPEED_STOP
@ -942,9 +943,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[4] = raid_gen5_ssse3ext;
raid_gen_force(5, raid_gen5_ssse3ext);
#else
raid_gen_ptr[4] = raid_gen5_ssse3;
raid_gen_force(5, raid_gen5_ssse3);
#endif
raid_recX_ssse3(5, id, ip, nd, size, v);
} SPEED_STOP
@ -958,9 +959,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[4] = raid_gen5_avx2ext;
raid_gen_force(5, raid_gen5_avx2ext);
#else
raid_gen_ptr[4] = raid_gen5_ssse3;
raid_gen_force(5, raid_gen5_ssse3);
#endif
raid_recX_avx2(5, id, ip, nd, size, v);
} SPEED_STOP
@ -973,12 +974,12 @@ void speed(int period, int nd, int size)
printf("\n");
printf("%8s", "rec6");
printf("%8s", raid_recX_tag());
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR6));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_ptr[5] = raid_gen6_int8;
raid_gen_force(6, raid_gen6_int8);
raid_recX_int8(6, id, ip, nd, size, v);
} SPEED_STOP
@ -991,9 +992,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[5] = raid_gen6_ssse3ext;
raid_gen_force(6, raid_gen6_ssse3ext);
#else
raid_gen_ptr[5] = raid_gen6_ssse3;
raid_gen_force(6, raid_gen6_ssse3);
#endif
raid_recX_ssse3(6, id, ip, nd, size, v);
} SPEED_STOP
@ -1007,9 +1008,9 @@ void speed(int period, int nd, int size)
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_ptr[5] = raid_gen6_avx2ext;
raid_gen_force(6, raid_gen6_avx2ext);
#else
raid_gen_ptr[5] = raid_gen6_ssse3;
raid_gen_force(6, raid_gen6_ssse3);
#endif
raid_recX_avx2(6, id, ip, nd, size, v);
} SPEED_STOP