1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
5 #ifndef _RTE_NET_CRC_H_
6 #define _RTE_NET_CRC_H_
14 /** CRC polynomials */
15 #define CRC32_ETH_POLYNOMIAL 0x04c11db7UL
16 #define CRC16_CCITT_POLYNOMIAL 0x1021U
18 #define CRC_LUT_SIZE 256
21 enum rte_net_crc_type {
22 RTE_NET_CRC16_CCITT = 0,
27 /** CRC compute algorithm */
28 enum rte_net_crc_alg {
29 RTE_NET_CRC_SCALAR = 0,
35 * This API set the CRC computation algorithm (i.e. scalar version,
36 * x86 64-bit sse4.2 intrinsic version, etc.) and internal data
40 * This parameter is used to select the CRC implementation version.
41 * - RTE_NET_CRC_SCALAR
42 * - RTE_NET_CRC_SSE42 (Use 64-bit SSE4.2 intrinsic)
43 * - RTE_NET_CRC_NEON (Use ARM Neon intrinsic)
46 rte_net_crc_set_alg(enum rte_net_crc_alg alg);
52 * Pointer to the packet data for CRC computation
54 * Data length for CRC computation
56 * CRC type (enum rte_net_crc_type)
62 rte_net_crc_calc(const void *data,
64 enum rte_net_crc_type type);
71 #endif /* _RTE_NET_CRC_H_ */