Use CRC32C implementation from ISA-L when available - enables VPCLMULQDQ version with AVX512 which is ~2x faster
This commit is contained in:
@@ -9,6 +9,7 @@ add_library(vitastor_blk SHARED
|
|||||||
)
|
)
|
||||||
target_link_libraries(vitastor_blk
|
target_link_libraries(vitastor_blk
|
||||||
${LIBURING_LIBRARIES}
|
${LIBURING_LIBRARIES}
|
||||||
|
${ISAL_LIBRARIES}
|
||||||
tcmalloc_minimal
|
tcmalloc_minimal
|
||||||
# for timerfd_manager
|
# for timerfd_manager
|
||||||
vitastor_common
|
vitastor_common
|
||||||
|
|||||||
@@ -12,4 +12,5 @@ add_executable(vitastor-disk
|
|||||||
target_link_libraries(vitastor-disk
|
target_link_libraries(vitastor-disk
|
||||||
tcmalloc_minimal
|
tcmalloc_minimal
|
||||||
${LIBURING_LIBRARIES}
|
${LIBURING_LIBRARIES}
|
||||||
|
${ISAL_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -39,6 +39,17 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "crc32c.h"
|
#include "crc32c.h"
|
||||||
|
|
||||||
|
#ifdef WITH_ISAL
|
||||||
|
|
||||||
|
#include <isa-l/crc.h>
|
||||||
|
|
||||||
|
uint32_t crc32c(uint32_t crc, const void *buf, size_t len)
|
||||||
|
{
|
||||||
|
return crc32_iscsi((unsigned char*)buf, len, crc ^ 0xffffffff) ^ 0xffffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
/* CRC-32C (iSCSI) polynomial in reversed bit order. */
|
/* CRC-32C (iSCSI) polynomial in reversed bit order. */
|
||||||
#define POLY 0x82f63b78
|
#define POLY 0x82f63b78
|
||||||
|
|
||||||
@@ -377,6 +388,8 @@ uint32_t crc32c(uint32_t crc, const void *buf, size_t len)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint8_t zero_page[4096] = {};
|
static uint8_t zero_page[4096] = {};
|
||||||
|
|
||||||
uint32_t crc32c_pad(uint32_t prev_crc, const void *buf, size_t len, size_t left_pad, size_t right_pad)
|
uint32_t crc32c_pad(uint32_t prev_crc, const void *buf, size_t len, size_t left_pad, size_t right_pad)
|
||||||
|
|||||||
Reference in New Issue
Block a user