examples/l3fwd: merge l3fwd-acl example
[dpdk.git] / lib / hash / 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. */
9 static inline uint32_t
10 rte_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. */
16 static inline uint32_t
17 rte_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. */
23 static inline uint32_t
24 rte_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. */
30 static inline uint32_t
31 rte_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_ */