DPDK  18.11.10
rte_net_crc.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Intel Corporation
3  */
4 
5 #ifndef _RTE_NET_CRC_H_
6 #define _RTE_NET_CRC_H_
7 
8 #include <stdint.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
15 #define CRC32_ETH_POLYNOMIAL 0x04c11db7UL
16 #define CRC16_CCITT_POLYNOMIAL 0x1021U
17 
18 #define CRC_LUT_SIZE 256
19 
21 enum rte_net_crc_type {
22  RTE_NET_CRC16_CCITT = 0,
23  RTE_NET_CRC32_ETH,
24  RTE_NET_CRC_REQS
25 };
26 
28 enum rte_net_crc_alg {
29  RTE_NET_CRC_SCALAR = 0,
30  RTE_NET_CRC_SSE42,
31  RTE_NET_CRC_NEON,
32  RTE_NET_CRC_MIPS,
33  RTE_NET_CRC_LOONGARCH,
34 };
35 
47 void
48 rte_net_crc_set_alg(enum rte_net_crc_alg alg);
49 
63 uint32_t
64 rte_net_crc_calc(const void *data,
65  uint32_t data_len,
66  enum rte_net_crc_type type);
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 
73 #endif /* _RTE_NET_CRC_H_ */