DPDK 22.11.5
rte_crc_generic.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2022 Marvell.
3 */
4
5#ifndef _RTE_CRC_GENERIC_H_
6#define _RTE_CRC_GENERIC_H_
7
8/* Software crc32 implementation for 1 byte value. */
9static inline uint32_t
10rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
11{
12 return crc32c_1byte(data, init_val);
13}
14
15/* Software crc32 implementation for 2 byte value. */
16static inline uint32_t
17rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
18{
19 return crc32c_2bytes(data, init_val);
20}
21
22/* Software crc32 implementation for 4 byte value. */
23static inline uint32_t
24rte_hash_crc_4byte(uint32_t data, uint32_t init_val)
25{
26 return crc32c_1word(data, init_val);
27}
28
29/* Software crc32 implementation for 8 byte value. */
30static inline uint32_t
31rte_hash_crc_8byte(uint64_t data, uint32_t init_val)
32{
33 return crc32c_2words(data, init_val);
34}
35
36#endif /* _RTE_CRC_GENERIC_H_ */
static uint32_t rte_hash_crc_4byte(uint32_t data, uint32_t init_val)
static uint32_t rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
static uint32_t rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
static uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val)