diff --git a/Makefile.am b/Makefile.am index 3d57e098..8e0ae731 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,7 +75,7 @@ EXTRA_DIST = \ noautomake.sh \ README AUTHORS HISTORY INSTALL COPYING TODO TEST INSTALL.windows \ snapraid.d snapraid.1 snapraid.txt \ - test-raid5.conf test-raid6.conf test-raidTP.conf test-raidQP.conf test-raidPP.conf test-raidHP.conf test-raidHP-hole.conf \ + test-raid5.conf test-raid6.conf test-raidS3.conf test-raidS4.conf test-raidS5.conf test-raidS6.conf test-raidS6-hole.conf \ snapraid.conf.example \ configure.windows-x86 configure.windows-x64 snapraid.conf.example.windows \ acinclude.m4 @@ -99,14 +99,14 @@ maintainer-clean-local: CHECKFLAGS = --test-skip-device --test-skip-self -q CHECKCOUNT = 2000 CHECKSIZE = 4000 -CONF = $(srcdir)/test-raidHP.conf -HOLE = $(srcdir)/test-raidHP-hole.conf +CONF = $(srcdir)/test-raidS6.conf +HOLE = $(srcdir)/test-raidS6-hole.conf RAID5 = $(srcdir)/test-raid5.conf RAID6 = $(srcdir)/test-raid6.conf -RAIDTP = $(srcdir)/test-raidTP.conf -RAIDQP = $(srcdir)/test-raidQP.conf -RAIDPP = $(srcdir)/test-raidPP.conf -RAIDHP = $(srcdir)/test-raidHP.conf +RAIDTP = $(srcdir)/test-raidS3.conf +RAIDQP = $(srcdir)/test-raidS4.conf +RAIDPP = $(srcdir)/test-raidS5.conf +RAIDHP = $(srcdir)/test-raidS6.conf check-local: rm -rf test diff --git a/cpu.h b/cpu.h index 76c29b8a..97bedad1 100644 --- a/cpu.h +++ b/cpu.h @@ -3,7 +3,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -192,20 +192,20 @@ static inline int cpu_has_slowpshufb(void) * RAID6 mmx 1160 [MB/s] * RAID6 sse2 2082 [MB/s] * RAID6 sse2ext 2481 [MB/s] - * RAIDTP int32 236 [MB/s] - * RAIDTP int64 456 [MB/s] - * RAIDTP mmx 576 [MB/s] - * RAIDTP sse2 1109 [MB/s] - * RAIDTP sse2ext 1527 [MB/s] - * RAIDTP ssse3 931 [MB/s] (slower than sse2ext) - * RAIDTP ssse3ext 932 [MB/s] (slower than sse2ext) - * RAIDQP int32 144 [MB/s] - * RAIDQP int64 271 [MB/s] - * RAIDQP mmx 431 [MB/s] - * RAIDQP sse2 843 [MB/s] - * RAIDQP sse2ext 1086 [MB/s] - * RAIDQP ssse3 732 [MB/s] (slower than sse2ext) - * RAIDQP ssse3ext 571 [MB/s] (slower than sse2ext) + * RAIDZ3 int32 236 [MB/s] + * RAIDZ3 int64 456 [MB/s] + * RAIDZ3 mmx 576 [MB/s] + * RAIDZ3 sse2 1109 [MB/s] + * RAIDZ3 sse2ext 1527 [MB/s] + * RAIDZ3 ssse3 931 [MB/s] (slower than sse2ext) + * RAIDZ3 ssse3ext 932 [MB/s] (slower than sse2ext) + * RAIDZ4 int32 144 [MB/s] + * RAIDZ4 int64 271 [MB/s] + * RAIDZ4 mmx 431 [MB/s] + * RAIDZ4 sse2 843 [MB/s] + * RAIDZ4 sse2ext 1086 [MB/s] + * RAIDZ4 ssse3 732 [MB/s] (slower than sse2ext) + * RAIDZ4 ssse3ext 571 [MB/s] (slower than sse2ext) */ if (family == 6 && model == 28) return 1; diff --git a/mktables.c b/mktables.c index 479dbaaf..4f399986 100644 --- a/mktables.c +++ b/mktables.c @@ -134,6 +134,32 @@ void set_cauchy(unsigned char* matrix) } } +/** + * Setup the Power matrix used to generate the parity. + */ +void set_power(unsigned char* matrix) +{ + unsigned i; + unsigned char v; + + v = 1; + for(i=0;i=0;--d) { + d0 = v_32(vbuf[d][i]); + d1 = v_32(vbuf[d][i+4]); + + p0 ^= d0; + p1 ^= d1; + + q0 = x2_32(q0); + q1 = x2_32(q1); + + q0 ^= d0; + q1 ^= d1; + + r0 = x2_32(r0); + r1 = x2_32(r1); + r0 = x2_32(r0); + r1 = x2_32(r1); + + r0 ^= d0; + r1 ^= d1; + } + v_32(p[i]) = p0; + v_32(p[i+4]) = p1; + v_32(q[i]) = q0; + v_32(q[i+4]) = q1; + v_32(r[i]) = r0; + v_32(r[i+4]) = r1; + } +} + +/* + * RAIDZ3 with power coefficients 64bit C implementation + */ +void raidZ3_int64(unsigned char** vbuf, unsigned data, unsigned size) +{ + unsigned char* p; + unsigned char* q; + unsigned char* r; + int d, l; + unsigned i; + + uint64_t d0, r0, q0, p0; + uint64_t d1, r1, q1, p1; + + l = data - 1; + p = vbuf[data]; + q = vbuf[data+1]; + r = vbuf[data+2]; + + for(i=0;i=0;--d) { + d0 = v_64(vbuf[d][i]); + d1 = v_64(vbuf[d][i+8]); + + p0 ^= d0; + p1 ^= d1; + + q0 = x2_64(q0); + q1 = x2_64(q1); + + q0 ^= d0; + q1 ^= d1; + + r0 = x2_64(r0); + r1 = x2_64(r1); + r0 = x2_64(r0); + r1 = x2_64(r1); + + r0 ^= d0; + r1 ^= d1; + } + v_64(p[i]) = p0; + v_64(p[i+8]) = p1; + v_64(q[i]) = q0; + v_64(q[i+8]) = q1; + v_64(r[i]) = r0; + v_64(r[i+8]) = r1; + } +} + +#if defined(__i386__) || defined(__x86_64__) +/* + * RAIDZ3 with power coefficients SSE2 implementation + */ +void raidZ3_sse2(unsigned char** vbuf, unsigned data, unsigned size) +{ + unsigned char* p; + unsigned char* q; + unsigned char* r; + int d, l; + unsigned i; + + l = data - 1; + p = vbuf[data]; + q = vbuf[data+1]; + r = vbuf[data+2]; + + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0])); + + for(i=0;i=0;--d) { + asm volatile("pxor %xmm4,%xmm4"); + asm volatile("pxor %xmm5,%xmm5"); + asm volatile("pxor %xmm6,%xmm6"); + asm volatile("pcmpgtb %xmm1,%xmm4"); + asm volatile("pcmpgtb %xmm2,%xmm5"); + asm volatile("paddb %xmm1,%xmm1"); + asm volatile("paddb %xmm2,%xmm2"); + asm volatile("pand %xmm7,%xmm4"); + asm volatile("pand %xmm7,%xmm5"); + asm volatile("pxor %xmm4,%xmm1"); + asm volatile("pxor %xmm5,%xmm2"); + asm volatile("pcmpgtb %xmm2,%xmm6"); + asm volatile("paddb %xmm2,%xmm2"); + asm volatile("pand %xmm7,%xmm6"); + asm volatile("pxor %xmm6,%xmm2"); + + asm volatile("movdqa %0,%%xmm3" : : "m" (vbuf[d][i])); + asm volatile("pxor %xmm3,%xmm0"); + asm volatile("pxor %xmm3,%xmm1"); + asm volatile("pxor %xmm3,%xmm2"); + } + asm volatile("movntdq %%xmm0,%0" : "=m" (p[i])); + asm volatile("movntdq %%xmm1,%0" : "=m" (q[i])); + asm volatile("movntdq %%xmm2,%0" : "=m" (r[i])); + } + + asm volatile("sfence" : : : "memory"); +} +#endif + +#if defined(__x86_64__) +/* + * RAIDZ3 with power coefficients SSE2 implementation + * + * Note that it uses 16 registers, meaning that x64 is required. + */ +void raidZ3_sse2ext(unsigned char** vbuf, unsigned data, unsigned size) +{ + unsigned char* p; + unsigned char* q; + unsigned char* r; + int d, l; + unsigned i; + + l = data - 1; + p = vbuf[data]; + q = vbuf[data+1]; + r = vbuf[data+2]; + + asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.poly[0])); + + for(i=0;i=0;--d) { + asm volatile("pxor %xmm4,%xmm4"); + asm volatile("pxor %xmm5,%xmm5"); + asm volatile("pxor %xmm6,%xmm6"); + asm volatile("pxor %xmm12,%xmm12"); + asm volatile("pxor %xmm13,%xmm13"); + asm volatile("pxor %xmm14,%xmm14"); + asm volatile("pcmpgtb %xmm1,%xmm4"); + asm volatile("pcmpgtb %xmm2,%xmm5"); + asm volatile("pcmpgtb %xmm9,%xmm12"); + asm volatile("pcmpgtb %xmm10,%xmm13"); + asm volatile("paddb %xmm1,%xmm1"); + asm volatile("paddb %xmm2,%xmm2"); + asm volatile("paddb %xmm9,%xmm9"); + asm volatile("paddb %xmm10,%xmm10"); + asm volatile("pand %xmm7,%xmm4"); + asm volatile("pand %xmm7,%xmm5"); + asm volatile("pand %xmm7,%xmm12"); + asm volatile("pand %xmm7,%xmm13"); + asm volatile("pxor %xmm4,%xmm1"); + asm volatile("pxor %xmm5,%xmm2"); + asm volatile("pxor %xmm12,%xmm9"); + asm volatile("pxor %xmm13,%xmm10"); + asm volatile("pcmpgtb %xmm2,%xmm6"); + asm volatile("pcmpgtb %xmm10,%xmm14"); + asm volatile("paddb %xmm2,%xmm2"); + asm volatile("paddb %xmm10,%xmm10"); + asm volatile("pand %xmm7,%xmm6"); + asm volatile("pand %xmm7,%xmm14"); + asm volatile("pxor %xmm6,%xmm2"); + asm volatile("pxor %xmm14,%xmm10"); + + asm volatile("movdqa %0,%%xmm3" : : "m" (vbuf[d][i])); + asm volatile("movdqa %0,%%xmm11" : : "m" (vbuf[d][i+16])); + asm volatile("pxor %xmm3,%xmm0"); + asm volatile("pxor %xmm3,%xmm1"); + asm volatile("pxor %xmm3,%xmm2"); + asm volatile("pxor %xmm11,%xmm8"); + asm volatile("pxor %xmm11,%xmm9"); + asm volatile("pxor %xmm11,%xmm10"); + } + asm volatile("movntdq %%xmm0,%0" : "=m" (p[i])); + asm volatile("movntdq %%xmm8,%0" : "=m" (p[i+16])); + asm volatile("movntdq %%xmm1,%0" : "=m" (q[i])); + asm volatile("movntdq %%xmm9,%0" : "=m" (q[i+16])); + asm volatile("movntdq %%xmm2,%0" : "=m" (r[i])); + asm volatile("movntdq %%xmm10,%0" : "=m" (r[i+16])); + } + + asm volatile("sfence" : : : "memory"); +} +#endif + +/* + * RAIDS3 8bit C implementation * * Note that instead of a generic multiplicationt table, likely resulting * in multiple cache misses, a precomputed table could be used. * But this is only a kind of reference function, and we are not really * interested in speed. */ -void raidTP_int8(unsigned char** vbuf, unsigned data, unsigned size) +void raidS3_int8(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -611,9 +849,9 @@ void raidTP_int8(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__i386__) || defined(__x86_64__) /* - * RAIDTP SSSE3 implementation + * RAIDS3 SSSE3 implementation */ -void raidTP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) +void raidS3_ssse3(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -697,11 +935,11 @@ void raidTP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__x86_64__) /* - * RAIDTP SSSE3 implementation + * RAIDS3 SSSE3 implementation * * Note that it uses 16 registers, meaning that x64 is required. */ -void raidTP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) +void raidS3_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -826,14 +1064,14 @@ void raidTP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) #endif /* - * RAIDQP 8bit C implementation + * RAIDS4 8bit C implementation * * Note that instead of a generic multiplicationt table, likely resulting * in multiple cache misses, a precomputed table could be used. * But this is only a kind of reference function, and we are not really * interested in speed. */ -void raidQP_int8(unsigned char** vbuf, unsigned data, unsigned size) +void raidS4_int8(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -878,9 +1116,9 @@ void raidQP_int8(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__i386__) || defined(__x86_64__) /* - * RAIDQP SSSE3 implementation + * RAIDS4 SSSE3 implementation */ -void raidQP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) +void raidS4_ssse3(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -983,11 +1221,11 @@ void raidQP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__x86_64__) /* - * RAIDQP SSSE3 implementation + * RAIDS4 SSSE3 implementation * * Note that it uses 16 registers, meaning that x64 is required. */ -void raidQP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) +void raidS4_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -1144,14 +1382,14 @@ void raidQP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) #endif /* - * RAIDPP 8bit C implementation + * RAIDS5 8bit C implementation * * Note that instead of a generic multiplicationt table, likely resulting * in multiple cache misses, a precomputed table could be used. * But this is only a kind of reference function, and we are not really * interested in speed. */ -void raidPP_int8(unsigned char** vbuf, unsigned data, unsigned size) +void raidS5_int8(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -1201,13 +1439,13 @@ void raidPP_int8(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__i386__) || defined(__x86_64__) /* - * RAIDPP SSSE3 implementation + * RAIDS5 SSSE3 implementation */ #ifdef _WIN32 /* ensures that stack is aligned at 16 bytes because we allocate SSE registers in it */ __attribute__((force_align_arg_pointer)) #endif -void raidPP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) +void raidS5_ssse3(unsigned char** vbuf, unsigned data, unsigned size) /* ensures that stack is aligned at 16 bytes because we allocate SSE registers in it */ { unsigned char* p; @@ -1331,11 +1569,11 @@ void raidPP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__x86_64__) /* - * RAIDPP SSSE3 implementation + * RAIDS5 SSSE3 implementation * * Note that it uses 16 registers, meaning that x64 is required. */ -void raidPP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) +void raidS5_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -1452,14 +1690,14 @@ void raidPP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) #endif /* - * RAIDHP 8bit C implementation + * RAIDS6 8bit C implementation * * Note that instead of a generic multiplicationt table, likely resulting * in multiple cache misses, a precomputed table could be used. * But this is only a kind of reference function, and we are not really * interested in speed. */ -void raidHP_int8(unsigned char** vbuf, unsigned data, unsigned size) +void raidS6_int8(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -1514,13 +1752,13 @@ void raidHP_int8(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__i386__) || defined(__x86_64__) /* - * RAIDHP SSSE3 implementation + * RAIDS6 SSSE3 implementation */ #ifdef _WIN32 /* ensures that stack is aligned at 16 bytes because we allocate SSE registers in it */ __attribute__((force_align_arg_pointer)) #endif -void raidHP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) +void raidS6_ssse3(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -1665,11 +1903,11 @@ void raidHP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) #if defined(__x86_64__) /* - * RAIDHP SSSE3 implementation + * RAIDS6 SSSE3 implementation * * Note that it uses 16 registers, meaning that x64 is required. */ -void raidHP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) +void raidS6_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) { unsigned char* p; unsigned char* q; @@ -1802,28 +2040,42 @@ void raidHP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) } #endif +/****************************************************************************/ +/* mode */ + +static unsigned raid_mode = RAID_MODE_S; /**< RAID mode. */ + +void raid_set(unsigned mode) +{ + raid_mode = mode; +} + /****************************************************************************/ /* parity generation */ /* internal forwarder */ static void (*raid5_gen)(unsigned char** vbuf, unsigned data, unsigned size); static void (*raid6_gen)(unsigned char** vbuf, unsigned data, unsigned size); -static void (*raidTP_gen)(unsigned char** vbuf, unsigned data, unsigned size); -static void (*raidQP_gen)(unsigned char** vbuf, unsigned data, unsigned size); -static void (*raidPP_gen)(unsigned char** vbuf, unsigned data, unsigned size); -static void (*raidHP_gen)(unsigned char** vbuf, unsigned data, unsigned size); +static void (*raidZ3_gen)(unsigned char** vbuf, unsigned data, unsigned size); +static void (*raidS3_gen)(unsigned char** vbuf, unsigned data, unsigned size); +static void (*raidS4_gen)(unsigned char** vbuf, unsigned data, unsigned size); +static void (*raidS5_gen)(unsigned char** vbuf, unsigned data, unsigned size); +static void (*raidS6_gen)(unsigned char** vbuf, unsigned data, unsigned size); void raid_gen(unsigned level, unsigned char** vbuf, unsigned data, unsigned size) { - assert(data >= RAID_DATA_MIN && data <= RAID_DATA_MAX); - switch (level) { case 1 : raid5_gen(vbuf, data, size); break; case 2 : raid6_gen(vbuf, data, size); break; - case 3 : raidTP_gen(vbuf, data, size); break; - case 4 : raidQP_gen(vbuf, data, size); break; - case 5 : raidPP_gen(vbuf, data, size); break; - case 6 : raidHP_gen(vbuf, data, size); break; + case 3 : + if (raid_mode == RAID_MODE_S) + raidS3_gen(vbuf, data, size); + else + raidZ3_gen(vbuf, data, size); + break; + case 4 : raidS4_gen(vbuf, data, size); break; + case 5 : raidS5_gen(vbuf, data, size); break; + case 6 : raidS6_gen(vbuf, data, size); break; default: fprintf(stderr, "Invalid raid gen level\n"); exit(EXIT_FAILURE); @@ -1892,11 +2144,11 @@ static inline const unsigned char* table(unsigned char v) */ static inline void raid_delta_gen(unsigned level, const int* d, const int* c, unsigned char** vbuf, unsigned data, unsigned char* zero, unsigned size) { - unsigned char* p[RAID_PARITY_MAX]; - unsigned char* pa[RAID_PARITY_MAX]; + unsigned char* p[RAID_PARITY_S_MAX]; + unsigned char* pa[RAID_PARITY_S_MAX]; unsigned i; - assert(level > 0 && level <= RAID_PARITY_MAX); + assert(level > 0 && level <= RAID_PARITY_S_MAX); for(i=0;iautosave = 0; state->need_write = 0; state->block_size = 256 * 1024; /* default 256 KiB */ + state->raid_mode = RAID_MODE_S; for(l=0;lparity_path[l][0] = 0; state->parity_device[l] = 0; @@ -117,6 +118,13 @@ static void state_config_check(struct snapraid_state* state, const char* path, t tommy_node* i; unsigned l; + if (state->raid_mode == RAID_MODE_Z) { + if (state->level > RAID_PARITY_Z_MAX) { + fprintf(stderr, "If you use the z-parity you cannot have more than %u parities.\n", RAID_PARITY_Z_MAX); + exit(EXIT_FAILURE); + } + } + for(l=0;llevel;++l) { if (state->parity_path[l][0] == 0) { fprintf(stderr, "No '%s' specification in '%s'\n", lev_config_name(l), path); @@ -370,6 +378,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co || strcmp(tag, "s-parity") == 0 || strcmp(tag, "t-parity") == 0 || strcmp(tag, "u-parity") == 0 + || strcmp(tag, "z-parity") == 0 ) { char device[PATH_MAX]; char* slash; @@ -383,6 +392,10 @@ void state_config(struct snapraid_state* state, const char* path, const char* co case 's' : l = 3; break; case 't' : l = 4; break; case 'u' : l = 5; break; + case 'z' : + l = 2; + state->raid_mode = RAID_MODE_Z; + break; default: fprintf(stderr, "Invalid '%s' specification in '%s' at line %u\n", tag, path, line); exit(EXIT_FAILURE); diff --git a/state.h b/state.h index d38846ae..00225a3b 100644 --- a/state.h +++ b/state.h @@ -87,6 +87,7 @@ struct snapraid_state { uint64_t autosave; /**< Autosave after the specified amount of data. 0 to disable. */ int need_write; /**< If the state is changed. */ uint32_t block_size; /**< Block size in bytes. */ + unsigned raid_mode; /**< Raid mode to use. RAID_MODE_DEFAULT or RAID_MODE_ALTERNATE. */ char parity_path[LEV_MAX][PATH_MAX]; /**< Path of the parity file. One for each parity. */ uint64_t parity_device[LEV_MAX]; /**< Device identifier of the parity. One for each parity. */ char pool[PATH_MAX]; /**< Path of the pool tree. */ diff --git a/tables.h b/tables.h index dd10ad68..f63807f2 100644 --- a/tables.h +++ b/tables.h @@ -8796,6 +8796,120 @@ const unsigned char __attribute__((aligned(256))) gfinv[256] = 0x42, 0xd4, 0xe8, 0x75, 0x7f, 0xff, 0x7e, 0xfd, }; +/** + * Power matrix used to generate parity. + * This matrix is valid for up to 3 parity with 251 data disks. + * + * 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + * 01 02 04 08 10 20 40 80 1d 3a 74 e8 cd 87 13 26 4c 98 2d 5a b4 75 ea c9 8f 03 06 0c 18 30 60 c0 9d 27 4e 9c 25 4a 94 35 6a d4 b5 77 ee c1 9f 23 46 8c 05 0a 14 28 50 a0 5d ba 69 d2 b9 6f de a1 5f be 61 c2 99 2f 5e bc 65 ca 89 0f 1e 3c 78 f0 fd e7 d3 bb 6b d6 b1 7f fe e1 df a3 5b b6 71 e2 d9 af 43 86 11 22 44 88 0d 1a 34 68 d0 bd 67 ce 81 1f 3e 7c f8 ed c7 93 3b 76 ec c5 97 33 66 cc 85 17 2e 5c b8 6d da a9 4f 9e 21 42 84 15 2a 54 a8 4d 9a 29 52 a4 55 aa 49 92 39 72 e4 d5 b7 73 e6 d1 bf 63 c6 91 3f 7e fc e5 d7 b3 7b f6 f1 ff e3 db ab 4b 96 31 62 c4 95 37 6e dc a5 57 ae 41 82 19 32 64 c8 8d 07 0e 1c 38 70 e0 dd a7 53 a6 51 a2 59 b2 79 f2 f9 ef c3 9b 2b 56 ac 45 8a 09 12 24 48 90 3d 7a f4 f5 f7 f3 fb eb cb 8b 0b 16 2c 58 b0 7d fa e9 cf 83 1b 36 6c + * 01 04 10 40 1d 74 cd 13 4c 2d b4 ea 8f 06 18 60 9d 4e 25 94 6a b5 ee 9f 46 05 14 50 5d 69 b9 de 5f 61 99 5e 65 89 1e 78 fd d3 6b b1 fe df 5b 71 d9 43 11 44 0d 34 d0 67 81 3e f8 c7 3b ec 97 66 85 2e b8 da 4f 21 84 2a a8 9a 52 55 49 39 e4 b7 e6 bf c6 3f fc d7 7b f1 e3 ab 96 62 95 6e a5 ae 82 32 c8 07 1c 70 dd 53 51 59 79 f9 c3 2b ac 8a 12 48 3d f4 f7 fb cb 0b 2c b0 fa cf 1b 6c ad 8e 02 08 20 80 3a e8 87 26 98 5a 75 c9 03 0c 30 c0 27 9c 4a 35 d4 77 c1 23 8c 0a 28 a0 ba d2 6f a1 be c2 2f bc ca 0f 3c f0 e7 bb d6 7f e1 a3 b6 e2 af 86 22 88 1a 68 bd ce 1f 7c ed 93 76 c5 33 cc 17 5c 6d a9 9e 42 15 54 4d 29 a4 aa 92 72 d5 73 d1 63 91 7e e5 b3 f6 ff db 4b 31 c4 37 dc 57 41 19 64 8d 0e 38 e0 a7 a6 a2 b2 f2 ef 9b 56 45 09 24 90 7a f5 f3 eb 8b 16 58 7d e9 + */ +const unsigned char __attribute__((aligned(256))) gfpower[3][256] = +{ + { + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, + }, + { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, + 0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, + 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, + 0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, + 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23, + 0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, + 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1, + 0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, + 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0, + 0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, + 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2, + 0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, + 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce, + 0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, + 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc, + 0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, + 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54, + 0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, + 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73, + 0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, + 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff, + 0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, + 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41, + 0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, + 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6, + 0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, + 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09, + 0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, + 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16, + 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, + 0x1b, 0x36, 0x6c, + }, + { + 0x01, 0x04, 0x10, 0x40, 0x1d, 0x74, 0xcd, 0x13, + 0x4c, 0x2d, 0xb4, 0xea, 0x8f, 0x06, 0x18, 0x60, + 0x9d, 0x4e, 0x25, 0x94, 0x6a, 0xb5, 0xee, 0x9f, + 0x46, 0x05, 0x14, 0x50, 0x5d, 0x69, 0xb9, 0xde, + 0x5f, 0x61, 0x99, 0x5e, 0x65, 0x89, 0x1e, 0x78, + 0xfd, 0xd3, 0x6b, 0xb1, 0xfe, 0xdf, 0x5b, 0x71, + 0xd9, 0x43, 0x11, 0x44, 0x0d, 0x34, 0xd0, 0x67, + 0x81, 0x3e, 0xf8, 0xc7, 0x3b, 0xec, 0x97, 0x66, + 0x85, 0x2e, 0xb8, 0xda, 0x4f, 0x21, 0x84, 0x2a, + 0xa8, 0x9a, 0x52, 0x55, 0x49, 0x39, 0xe4, 0xb7, + 0xe6, 0xbf, 0xc6, 0x3f, 0xfc, 0xd7, 0x7b, 0xf1, + 0xe3, 0xab, 0x96, 0x62, 0x95, 0x6e, 0xa5, 0xae, + 0x82, 0x32, 0xc8, 0x07, 0x1c, 0x70, 0xdd, 0x53, + 0x51, 0x59, 0x79, 0xf9, 0xc3, 0x2b, 0xac, 0x8a, + 0x12, 0x48, 0x3d, 0xf4, 0xf7, 0xfb, 0xcb, 0x0b, + 0x2c, 0xb0, 0xfa, 0xcf, 0x1b, 0x6c, 0xad, 0x8e, + 0x02, 0x08, 0x20, 0x80, 0x3a, 0xe8, 0x87, 0x26, + 0x98, 0x5a, 0x75, 0xc9, 0x03, 0x0c, 0x30, 0xc0, + 0x27, 0x9c, 0x4a, 0x35, 0xd4, 0x77, 0xc1, 0x23, + 0x8c, 0x0a, 0x28, 0xa0, 0xba, 0xd2, 0x6f, 0xa1, + 0xbe, 0xc2, 0x2f, 0xbc, 0xca, 0x0f, 0x3c, 0xf0, + 0xe7, 0xbb, 0xd6, 0x7f, 0xe1, 0xa3, 0xb6, 0xe2, + 0xaf, 0x86, 0x22, 0x88, 0x1a, 0x68, 0xbd, 0xce, + 0x1f, 0x7c, 0xed, 0x93, 0x76, 0xc5, 0x33, 0xcc, + 0x17, 0x5c, 0x6d, 0xa9, 0x9e, 0x42, 0x15, 0x54, + 0x4d, 0x29, 0xa4, 0xaa, 0x92, 0x72, 0xd5, 0x73, + 0xd1, 0x63, 0x91, 0x7e, 0xe5, 0xb3, 0xf6, 0xff, + 0xdb, 0x4b, 0x31, 0xc4, 0x37, 0xdc, 0x57, 0x41, + 0x19, 0x64, 0x8d, 0x0e, 0x38, 0xe0, 0xa7, 0xa6, + 0xa2, 0xb2, 0xf2, 0xef, 0x9b, 0x56, 0x45, 0x09, + 0x24, 0x90, 0x7a, 0xf5, 0xf3, 0xeb, 0x8b, 0x16, + 0x58, 0x7d, 0xe9, + }, +}; + /** * Cauchy matrix used to generate parity. * This matrix is valid for up to 6 parity with 251 data disks. diff --git a/test-raidTP.conf b/test-raidS3.conf similarity index 100% rename from test-raidTP.conf rename to test-raidS3.conf diff --git a/test-raidQP.conf b/test-raidS4.conf similarity index 100% rename from test-raidQP.conf rename to test-raidS4.conf diff --git a/test-raidPP.conf b/test-raidS5.conf similarity index 100% rename from test-raidPP.conf rename to test-raidS5.conf diff --git a/test-raidHP-hole.conf b/test-raidS6-hole.conf similarity index 100% rename from test-raidHP-hole.conf rename to test-raidS6-hole.conf diff --git a/test-raidHP.conf b/test-raidS6.conf similarity index 100% rename from test-raidHP.conf rename to test-raidS6.conf diff --git a/util.c b/util.c index 084579b4..4a2d268e 100644 --- a/util.c +++ b/util.c @@ -1362,13 +1362,13 @@ void* malloc_nofail_align(size_t size, void** freeptr) * * RAID5 sse2x4 21936 [MB/s] * RAID6 sse2x2 11902 [MB/s] - * RAIDTP sse2x1 5838 [MB/s] + * RAIDZ3 sse2x1 5838 [MB/s] * * Without displacement: * * RAID5 sse2x4 15368 [MB/s] * RAID6 sse2x2 6814 [MB/s] - * RAIDTP sse2x1 3033 [MB/s] + * RAIDZ3 sse2x1 3033 [MB/s] */ #define MALLOC_DISPLACEMENT (7*256)