mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Refactors the whole raid support.
This commit is contained in:
parent
6868fae748
commit
53744ed2b1
5 changed files with 1374 additions and 1136 deletions
14
check.c
14
check.c
|
|
@ -228,7 +228,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
memcpy(buffer[diskmax+COMBO1[i].a], buffer_recov[COMBO1[i].a], state->block_size);
|
||||
|
||||
/* recover data */
|
||||
raid_recov_1data(buffer, diskmax, state->block_size, failed[failed_map[0]].index, COMBO1[i].a, buffer_zero);
|
||||
raid_recov_1data(failed[failed_map[0]].index, COMBO1[i].a, buffer, diskmax, buffer_zero, state->block_size);
|
||||
|
||||
if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero))
|
||||
return 0;
|
||||
|
|
@ -249,7 +249,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
memcpy(buffer[diskmax+COMBO2[i].a], buffer_recov[COMBO2[i].a], state->block_size);
|
||||
|
||||
/* recover data */
|
||||
raid_recov_1data(buffer, diskmax, state->block_size, failed[failed_map[0]].index, COMBO2[i].a, buffer_zero);
|
||||
raid_recov_1data(failed[failed_map[0]].index, COMBO2[i].a, buffer, diskmax, buffer_zero, state->block_size);
|
||||
|
||||
if (is_parity_matching(state, diskmax, COMBO2[i].b, buffer, buffer_recov))
|
||||
return 0;
|
||||
|
|
@ -271,7 +271,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
memcpy(buffer[diskmax+COMBO2[i].b], buffer_recov[COMBO2[i].b], state->block_size);
|
||||
|
||||
/* recover data */
|
||||
raid_recov_2data(buffer, diskmax, state->block_size, failed[failed_map[0]].index, failed[failed_map[1]].index, COMBO2[i].a, COMBO2[i].b, buffer_zero);
|
||||
raid_recov_2data(failed[failed_map[0]].index, failed[failed_map[1]].index, COMBO2[i].a, COMBO2[i].b, buffer, diskmax, buffer_zero, state->block_size);
|
||||
|
||||
if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero))
|
||||
return 0;
|
||||
|
|
@ -293,7 +293,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
memcpy(buffer[diskmax+COMBO3[i].b], buffer_recov[COMBO3[i].b], state->block_size);
|
||||
|
||||
/* recover data */
|
||||
raid_recov_2data(buffer, diskmax, state->block_size, failed[failed_map[0]].index, failed[failed_map[1]].index, COMBO3[i].a, COMBO3[i].b, buffer_zero);
|
||||
raid_recov_2data(failed[failed_map[0]].index, failed[failed_map[1]].index, COMBO3[i].a, COMBO3[i].b, buffer, diskmax, buffer_zero, state->block_size);
|
||||
|
||||
if (is_parity_matching(state, diskmax, COMBO3[i].c, buffer, buffer_recov))
|
||||
return 0;
|
||||
|
|
@ -316,7 +316,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
memcpy(buffer[diskmax+COMBO3[i].c], buffer_recov[COMBO3[i].c], state->block_size);
|
||||
|
||||
/* recover data */
|
||||
raid_recov_3data(buffer, diskmax, state->block_size, failed[failed_map[0]].index, failed[failed_map[1]].index, failed[failed_map[2]].index, COMBO3[i].a, COMBO3[i].b, COMBO3[i].c, buffer_zero);
|
||||
raid_recov_3data(failed[failed_map[0]].index, failed[failed_map[1]].index, failed[failed_map[2]].index, COMBO3[i].a, COMBO3[i].b, COMBO3[i].c, buffer, diskmax, buffer_zero, state->block_size);
|
||||
|
||||
if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero))
|
||||
return 0;
|
||||
|
|
@ -339,7 +339,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
memcpy(buffer[diskmax+COMBO4[i].c], buffer_recov[COMBO4[i].c], state->block_size);
|
||||
|
||||
/* recover data */
|
||||
raid_recov_3data(buffer, diskmax, state->block_size, failed[failed_map[0]].index, failed[failed_map[1]].index, failed[failed_map[2]].index, COMBO4[i].a, COMBO4[i].b, COMBO4[i].c, buffer_zero);
|
||||
raid_recov_3data(failed[failed_map[0]].index, failed[failed_map[1]].index, failed[failed_map[2]].index, COMBO4[i].a, COMBO4[i].b, COMBO4[i].c, buffer, diskmax, buffer_zero, state->block_size);
|
||||
|
||||
if (is_parity_matching(state, diskmax, COMBO4[i].d, buffer, buffer_recov))
|
||||
return 0;
|
||||
|
|
@ -363,7 +363,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
memcpy(buffer[diskmax+COMBO4[i].d], buffer_recov[COMBO4[i].d], state->block_size);
|
||||
|
||||
/* recover data */
|
||||
raid_recov_4data(buffer, diskmax, state->block_size, failed[failed_map[0]].index, failed[failed_map[1]].index, failed[failed_map[2]].index, failed[failed_map[3]].index, COMBO4[i].a, COMBO4[i].b, COMBO4[i].c, COMBO4[i].d, buffer_zero);
|
||||
raid_recov_4data(failed[failed_map[0]].index, failed[failed_map[1]].index, failed[failed_map[2]].index, failed[failed_map[3]].index, COMBO4[i].a, COMBO4[i].b, COMBO4[i].c, COMBO4[i].d, buffer, diskmax, buffer_zero, state->block_size);
|
||||
|
||||
if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero))
|
||||
return 0;
|
||||
|
|
|
|||
110
raid.h
110
raid.h
|
|
@ -24,64 +24,84 @@
|
|||
/**
|
||||
* Max number of data disks for RAID6.
|
||||
*/
|
||||
#define RAID6_DATA_LIMIT 21
|
||||
#define RAID6_DATA_LIMIT 255
|
||||
|
||||
/**
|
||||
* Max number of data disks for RAIDQP.
|
||||
*/
|
||||
#define RAIDQP_DATA_LIMIT 21
|
||||
|
||||
/**
|
||||
* Syndrome computation.
|
||||
*/
|
||||
void raid_gen(unsigned level, unsigned char** buffer, unsigned diskmax, unsigned size);
|
||||
|
||||
/*
|
||||
* Recover failure of one data block x using parity i.
|
||||
*/
|
||||
void raid_recov_1data(unsigned char** dptrs, unsigned diskmax, unsigned size, int x, int i, unsigned char* zero);
|
||||
|
||||
/*
|
||||
* Recover failure of two data blocks x,y using parity i,j.
|
||||
*/
|
||||
void raid_recov_2data(unsigned char** dptrs, unsigned diskmax, unsigned size, int x, int y, int i, int j, unsigned char* zero);
|
||||
|
||||
/*
|
||||
* Recover failure of three data blocks x,y,z using parity i,j,k.
|
||||
*/
|
||||
void raid_recov_3data(unsigned char** dptrs, unsigned diskmax, unsigned size, int x, int y, int z, int i, int j, int k, unsigned char* zero);
|
||||
|
||||
/*
|
||||
* Recover failure of four data blocks x,y,z,v using parity i,j,k,l.
|
||||
*/
|
||||
void raid_recov_4data(unsigned char** dptrs, unsigned diskmax, unsigned size, int x, int y, int z, int v, int i, int j, int k, int l, unsigned char* zero);
|
||||
|
||||
/**
|
||||
* Initializes the RAID system.
|
||||
*/
|
||||
void raid_init(void);
|
||||
|
||||
/**
|
||||
* Internal specialized syndrome computation.
|
||||
* Computes the specified number of parities.
|
||||
* \param level Number of parities to compute.
|
||||
* \param vbuf Vector of pointers to the blocks for disks and parities.
|
||||
* It has (::data + ::level) elements. Each element points to a buffer of ::size bytes.
|
||||
* \param data Number of data disks.
|
||||
* \param size Size of the blocks pointed by vbuf.
|
||||
*/
|
||||
void raid5_int32r2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid5_mmxr2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid5_mmxr4(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid5_sse2r2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid5_sse2r4(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid5_sse2r8(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid6_int32r2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid6_mmxr2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid6_sse2r2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raid6_sse2r4(unsigned char** buffer, unsigned diskmax, unsigned size);
|
||||
void raidTP_int32r2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raidTP_mmxr1(unsigned char** buffer, unsigned diskmax, unsigned size);
|
||||
void raidTP_sse2r1(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raidTP_sse2r2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raidQP_int32r2(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raidQP_mmxr1(unsigned char** buffer, unsigned diskmax, unsigned size);
|
||||
void raidQP_sse2r1(unsigned char** dptr, unsigned diskmax, unsigned size);
|
||||
void raidQP_sse2r2(unsigned char** buffer, unsigned diskmax, unsigned size);
|
||||
void raid_gen(unsigned level, unsigned char** vbuf, unsigned data, unsigned size);
|
||||
|
||||
/*
|
||||
* Recovers failure of one data block x using parity i.
|
||||
* Note that only the data block is recovered. The full parity is instead destroyed.
|
||||
* \param x Index of the data disk to recover. Starting from 0.
|
||||
* \param i Index of the parity to use for the recovering. Starting from 0.
|
||||
* \param vbuf Vector of pointers to the blocks for disks and parities.
|
||||
* It has (::data + ::i + 1) elements. Each element points to a buffer of ::size bytes.
|
||||
* \param data Number of data disks.
|
||||
* \param zero Buffer filled with 0 of ::size bytes.
|
||||
* This buffer is not modified.
|
||||
* \param size Size of the blocks pointed by vbuf.
|
||||
*/
|
||||
void raid_recov_1data(int x, int i, unsigned char** vbuf, unsigned data, unsigned char* zero, unsigned size);
|
||||
|
||||
/*
|
||||
* Recovers failure of two data blocks x,y using parity i,j.
|
||||
* Note that only the data blocks are recovered. The full parity is instead destroyed.
|
||||
*/
|
||||
void raid_recov_2data(int x, int y, int i, int j, unsigned char** vbuf, unsigned data, unsigned char* zero, unsigned size);
|
||||
|
||||
/*
|
||||
* Recovers failure of three data blocks x,y,z using parity i,j,k.
|
||||
* Note that only the data blocks are recovered. The full parity is instead destroyed.
|
||||
*/
|
||||
void raid_recov_3data(int x, int y, int z, int i, int j, int k, unsigned char** vbuf, unsigned data, unsigned char* zero, unsigned size);
|
||||
|
||||
/*
|
||||
* Recovers failure of four data blocks x,y,z,v using parity i,j,k,l.
|
||||
* Note that only the data blocks are recovered. The full parity is instead destroyed.
|
||||
*/
|
||||
void raid_recov_4data(int x, int y, int z, int v, int i, int j, int k, int l, unsigned char** vbuf, unsigned data, unsigned char* zero, unsigned size);
|
||||
|
||||
/**
|
||||
* Internal specialized parity computation.
|
||||
* Only for testing.
|
||||
*/
|
||||
void raid5_int32r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid5_int64r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid5_mmxr4(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid5_sse2r4(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid5_sse2r8(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid6_int32r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid6_int64r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid6_mmxr2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid6_sse2r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raid6_sse2r4(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidTP_int32r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidTP_int64r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidTP_mmxr1(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidTP_sse2r1(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidTP_sse2r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidQP_int32r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidQP_int64r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidQP_mmxr1(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidQP_sse2r1(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
void raidQP_sse2r2(unsigned char** vbuf, unsigned data, unsigned size);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
91
selftest.c
91
selftest.c
|
|
@ -20,6 +20,7 @@
|
|||
#include "snapraid.h"
|
||||
#include "util.h"
|
||||
#include "raid.h"
|
||||
#include "cpu.h"
|
||||
#include "elem.h"
|
||||
#include "state.h"
|
||||
|
||||
|
|
@ -45,7 +46,7 @@ static struct hash_test_vector TEST_SPOOKY2[] = {
|
|||
{ 0, 0, { 0 } }
|
||||
};
|
||||
|
||||
static void raidtest(unsigned diskmax, unsigned block_size)
|
||||
static void recovtest(unsigned diskmax, unsigned block_size)
|
||||
{
|
||||
void* buffer_alloc;
|
||||
unsigned char** buffer;
|
||||
|
|
@ -136,7 +137,7 @@ static void raidtest(unsigned diskmax, unsigned block_size)
|
|||
buffer[l] = buffer_test3;
|
||||
|
||||
/* recover */
|
||||
raid_recov_4data(buffer, diskmax, block_size, i, j, k, l, 0, 1, 2, 3, buffer_zero);
|
||||
raid_recov_4data(i, j, k, l, 0, 1, 2, 3, buffer, diskmax, buffer_zero, block_size);
|
||||
|
||||
/* check */
|
||||
if (memcmp(buffer_test0, a, block_size) != 0
|
||||
|
|
@ -188,7 +189,7 @@ static void raidtest(unsigned diskmax, unsigned block_size)
|
|||
buffer[l] = buffer_bad;
|
||||
|
||||
/* recover ignoring p */
|
||||
raid_recov_3data(buffer, diskmax, block_size, i, j, k, COMBO3[n].use[0], COMBO3[n].use[1], COMBO3[n].use[2], buffer_zero);
|
||||
raid_recov_3data(i, j, k, COMBO3[n].use[0], COMBO3[n].use[1], COMBO3[n].use[2], buffer, diskmax, buffer_zero, block_size);
|
||||
|
||||
/* check */
|
||||
if (memcmp(buffer_test0, a, block_size) != 0
|
||||
|
|
@ -237,7 +238,7 @@ static void raidtest(unsigned diskmax, unsigned block_size)
|
|||
buffer[l] = buffer_bad;
|
||||
|
||||
/* recover */
|
||||
raid_recov_2data(buffer, diskmax, block_size, i, j, COMBO2[n].use[0], COMBO2[n].use[1], buffer_zero);
|
||||
raid_recov_2data(i, j, COMBO2[n].use[0], COMBO2[n].use[1], buffer, diskmax, buffer_zero, block_size);
|
||||
|
||||
/* check */
|
||||
if (memcmp(buffer_test0, a, block_size) != 0
|
||||
|
|
@ -284,7 +285,7 @@ static void raidtest(unsigned diskmax, unsigned block_size)
|
|||
buffer[l] = buffer_bad;
|
||||
|
||||
/* recover */
|
||||
raid_recov_1data(buffer, diskmax, block_size, i, COMBO1[n].use, buffer_zero);
|
||||
raid_recov_1data(i, COMBO1[n].use, buffer, diskmax, buffer_zero, block_size);
|
||||
|
||||
/* check */
|
||||
if (memcmp(buffer_test0, a, block_size) != 0) {
|
||||
|
|
@ -306,6 +307,83 @@ static void raidtest(unsigned diskmax, unsigned block_size)
|
|||
free(buffer);
|
||||
}
|
||||
|
||||
static void gentest(unsigned diskmax, unsigned block_size)
|
||||
{
|
||||
void* buffer_alloc;
|
||||
unsigned char** buffer;
|
||||
unsigned buffermax;
|
||||
unsigned i, j;
|
||||
void (*map[64])(unsigned char** buffer, unsigned diskmax, unsigned size);
|
||||
unsigned mac;
|
||||
|
||||
buffermax = diskmax + LEV_MAX * 2;
|
||||
|
||||
buffer = malloc_nofail_vector_align(buffermax, block_size, &buffer_alloc);
|
||||
|
||||
/* fill with random */
|
||||
for(i=0;i<diskmax;++i) {
|
||||
for(j=0;j<block_size;++j)
|
||||
buffer[i][j] = rand();
|
||||
}
|
||||
|
||||
/* compute the parity */
|
||||
raid_gen(LEV_MAX, buffer, diskmax, block_size);
|
||||
|
||||
/* copy in back buffers */
|
||||
for(i=0;i<LEV_MAX;++i)
|
||||
memcpy(buffer[diskmax + LEV_MAX + i], buffer[diskmax + i], block_size);
|
||||
|
||||
/* load all the available functions */
|
||||
mac = 0;
|
||||
map[mac++] = raid5_int32r2;
|
||||
map[mac++] = raid5_int64r2;
|
||||
map[mac++] = raid6_int32r2;
|
||||
map[mac++] = raid6_int64r2;
|
||||
map[mac++] = raidTP_int32r2;
|
||||
map[mac++] = raidTP_int64r2;
|
||||
map[mac++] = raidQP_int32r2;
|
||||
map[mac++] = raidQP_int64r2;
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_mmx()) {
|
||||
map[mac++] = raid5_mmxr4;
|
||||
map[mac++] = raid6_mmxr2;
|
||||
map[mac++] = raidQP_mmxr1;
|
||||
map[mac++] = raidTP_mmxr1;
|
||||
}
|
||||
|
||||
if (cpu_has_sse2()) {
|
||||
map[mac++] = raid5_sse2r4;
|
||||
map[mac++] = raid6_sse2r2;
|
||||
map[mac++] = raidTP_sse2r1;
|
||||
map[mac++] = raidQP_sse2r1;
|
||||
#if defined(__x86_64__)
|
||||
map[mac++] = raid5_sse2r8;
|
||||
map[mac++] = raid6_sse2r4;
|
||||
map[mac++] = raidTP_sse2r2;
|
||||
map[mac++] = raidQP_sse2r2;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* check all the functions */
|
||||
for(j=0;j<mac;++j) {
|
||||
/* compute parity */
|
||||
map[j](buffer, diskmax, block_size);
|
||||
|
||||
/* check it */
|
||||
for(i=0;i<LEV_MAX;++i) {
|
||||
if (memcmp(buffer[diskmax + LEV_MAX + i], buffer[diskmax + i], block_size) != 0) {
|
||||
fprintf(stderr, "Failed RAID test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(buffer_alloc);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
#define HASH_TEST_MAX 512 /* tests are never longer than 512 bytes */
|
||||
|
||||
static void hashtest(void)
|
||||
|
|
@ -421,6 +499,7 @@ void selftest(int gui)
|
|||
|
||||
hashtest();
|
||||
crc32ctest();
|
||||
raidtest(24, 2048);
|
||||
gentest(24, 256 * 1024);
|
||||
recovtest(24, 2048);
|
||||
}
|
||||
|
||||
|
|
|
|||
72
speed.c
72
speed.c
|
|
@ -130,8 +130,8 @@ void speed(void)
|
|||
#endif
|
||||
printf("\n");
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
printf("Expected fastest RAID5 is ");
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_sse2())
|
||||
#if defined(__x86_64__)
|
||||
printf("sse2x8");
|
||||
|
|
@ -142,8 +142,16 @@ void speed(void)
|
|||
printf("mmxx4");
|
||||
else
|
||||
printf("int32x2");
|
||||
#else
|
||||
if (sizeof(void*) == 4)
|
||||
printf("int32x2");
|
||||
else
|
||||
printf("int64x2");
|
||||
#endif
|
||||
printf("\n");
|
||||
|
||||
printf("Expected fastest RAID6 is ");
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_sse2())
|
||||
#if defined(__x86_64__)
|
||||
printf("sse2x4");
|
||||
|
|
@ -154,8 +162,16 @@ void speed(void)
|
|||
printf("mmxx2");
|
||||
else
|
||||
printf("int32x2");
|
||||
#else
|
||||
if (sizeof(void*) == 4)
|
||||
printf("int32x2");
|
||||
else
|
||||
printf("int64x2");
|
||||
#endif
|
||||
printf("\n");
|
||||
|
||||
printf("Expected fastest RAIDTP is ");
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_sse2())
|
||||
#if defined(__x86_64__)
|
||||
printf("sse2x2");
|
||||
|
|
@ -166,8 +182,17 @@ void speed(void)
|
|||
printf("mmxx1");
|
||||
else
|
||||
printf("int32x2");
|
||||
#else
|
||||
if (sizeof(void*) == 4)
|
||||
printf("int32x2");
|
||||
else
|
||||
printf("int64x2");
|
||||
#endif
|
||||
printf("\n");
|
||||
|
||||
|
||||
printf("Expected fastest RAIDQP is ");
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_sse2())
|
||||
#if defined(__x86_64__)
|
||||
printf("sse2x2");
|
||||
|
|
@ -178,8 +203,15 @@ void speed(void)
|
|||
printf("mmxx1");
|
||||
else
|
||||
printf("int32x2");
|
||||
printf("\n");
|
||||
#else
|
||||
if (sizeof(void*) == 4)
|
||||
printf("int32x2");
|
||||
else
|
||||
printf("int64x2");
|
||||
#endif
|
||||
printf("\n");
|
||||
|
||||
|
||||
printf("If these expectations are false, please report it in the SnapRAID forum\n");
|
||||
|
||||
printf("\n");
|
||||
|
|
@ -235,14 +267,14 @@ void speed(void)
|
|||
|
||||
printf("RAID5 int32x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
SPEED_START {
|
||||
raid5_int64r2(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("RAID5 int64x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_mmx()) {
|
||||
SPEED_START {
|
||||
raid5_mmxr2(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("RAID5 mmxx2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
SPEED_START {
|
||||
raid5_mmxr4(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
|
@ -251,12 +283,6 @@ void speed(void)
|
|||
}
|
||||
|
||||
if (cpu_has_sse2()) {
|
||||
SPEED_START {
|
||||
raid5_sse2r2(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("RAID5 sse2x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
SPEED_START {
|
||||
raid5_sse2r4(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
|
@ -279,6 +305,12 @@ void speed(void)
|
|||
|
||||
printf("RAID6 int32x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
SPEED_START {
|
||||
raid6_int64r2(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("RAID6 int64x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_mmx()) {
|
||||
SPEED_START {
|
||||
|
|
@ -311,6 +343,12 @@ void speed(void)
|
|||
|
||||
printf("RAIDTP int32x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
SPEED_START {
|
||||
raidTP_int64r2(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("RAIDTP int64x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_mmx()) {
|
||||
SPEED_START {
|
||||
|
|
@ -343,6 +381,12 @@ void speed(void)
|
|||
|
||||
printf("RAIDQP int32x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
SPEED_START {
|
||||
raidQP_int64r2(buffer, diskmax, block_size);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("RAIDQP int64x2 %"PRIu64" [MB/s]\n", ds / dt);
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (cpu_has_mmx()) {
|
||||
SPEED_START {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue