Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions hadoop-common-project/hadoop-common/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x
set(BULK_CRC_ARCH_SOURCE_FIlE "${SRC}/util/bulk_crc32_x86.c")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(BULK_CRC_ARCH_SOURCE_FIlE "${SRC}/util/bulk_crc32_aarch64.c")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
set(BULK_CRC_ARCH_SOURCE_FIlE "${SRC}/util/bulk_crc32_riscv64.c")
add_compile_options("-march=rv64gcv_zbc_zvbc")
else()
message("No HW CRC acceleration for ${CMAKE_SYSTEM_PROCESSOR}, falling back to SW")
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static uint32_t crc_val(uint32_t crc) {
* Computes the CRC32c checksum for the specified buffer using the slicing by 8
* algorithm over 64 bit quantities.
*/
static uint32_t crc32c_sb8(uint32_t crc, const uint8_t *buf, size_t length) {
uint32_t crc32c_sb8(uint32_t crc, const uint8_t *buf, size_t length) {
uint32_t running_length = ((length)/8)*8;
uint32_t end_bytes = length - running_length;
int li;
Expand Down Expand Up @@ -201,7 +201,7 @@ static void pipelined_crc32c_sb8(uint32_t *crc1, uint32_t *crc2, uint32_t *crc3,
* Update a CRC using the "zlib" polynomial -- what Hadoop calls CHECKSUM_CRC32
* using slicing-by-8
*/
static uint32_t crc32_zlib_sb8(
uint32_t crc32_zlib_sb8(
uint32_t crc, const uint8_t *buf, size_t length) {
uint32_t running_length = ((length)/8)*8;
uint32_t end_bytes = length - running_length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ typedef struct crc32_error {
const uint8_t *bad_data; // pointer to start of data chunk with error
} crc32_error_t;

extern uint32_t crc32c_sb8(uint32_t crc, const uint8_t *buf, size_t length);
extern uint32_t crc32_zlib_sb8(uint32_t crc, const uint8_t *buf, size_t length);

/**
* Either calculates checksums for or verifies a buffer of data.
Expand Down
Loading