5 #ifndef _RTE_HASH_CRC_H_ 6 #define _RTE_HASH_CRC_H_ 22 #include <rte_config.h> 26 #include "rte_crc_sw.h" 28 #define CRC32_SW (1U << 0) 29 #define CRC32_SSE42 (1U << 1) 30 #define CRC32_x64 (1U << 2) 31 #define CRC32_SSE42_x64 (CRC32_x64|CRC32_SSE42) 32 #define CRC32_ARM64 (1U << 3) 34 static uint8_t crc32_alg = CRC32_SW;
36 #if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) 37 #include "rte_crc_arm64.h" 38 #elif defined(RTE_ARCH_X86) 39 #include "rte_crc_x86.h" 41 #include "rte_crc_generic.h" 63 #if defined RTE_ARCH_X86 64 if (!(alg & CRC32_SSE42_x64))
66 "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n");
68 crc32_alg = CRC32_SSE42;
70 crc32_alg = CRC32_SSE42_x64;
73 #if defined RTE_ARCH_ARM64 74 if (!(alg & CRC32_ARM64))
76 "Unsupported CRC32 algorithm requested using CRC32_ARM64\n");
78 crc32_alg = CRC32_ARM64;
81 if (crc32_alg == CRC32_SW)
83 "Unsupported CRC32 algorithm requested using CRC32_SW\n");
89 #if defined(RTE_ARCH_X86) 91 #elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) 110 static inline uint32_t
123 static inline uint32_t
136 static inline uint32_t
149 static inline uint32_t
166 static inline uint32_t
170 uintptr_t pd = (uintptr_t) data;
172 for (i = 0; i < data_len / 8; i++) {
177 if (data_len & 0x4) {
182 if (data_len & 0x2) {
static uint32_t rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
#define RTE_LOG(l, t,...)
static uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val)
static uint32_t rte_hash_crc(const void *data, uint32_t data_len, uint32_t init_val)
static uint32_t rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
static void rte_hash_crc_set_alg(uint8_t alg)
__extension__ int rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature)
static uint32_t rte_hash_crc_4byte(uint32_t data, uint32_t init_val)