common/sfc_efx: do not include libefx headers from efsys.h
[dpdk.git] / lib / librte_net / rte_net_crc.c
index 73ac3a9..4f5b9e8 100644 (file)
@@ -10,9 +10,9 @@
 #include <rte_common.h>
 #include <rte_net_crc.h>
 
-#if defined(RTE_ARCH_X86_64) && defined(RTE_MACHINE_CPUFLAG_PCLMULQDQ)
+#if defined(RTE_ARCH_X86_64) && defined(__PCLMUL__)
 #define X86_64_SSE42_PCLMULQDQ     1
-#elif defined(RTE_ARCH_ARM64) && defined(RTE_MACHINE_CPUFLAG_PMULL)
+#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRYPTO)
 #define ARM64_NEON_PMULL           1
 #endif
 
 #include <net_crc_neon.h>
 #endif
 
+/** CRC polynomials */
+#define CRC32_ETH_POLYNOMIAL 0x04c11db7UL
+#define CRC16_CCITT_POLYNOMIAL 0x1021U
+
+#define CRC_LUT_SIZE 256
+
 /* crc tables */
 static uint32_t crc32_eth_lut[CRC_LUT_SIZE];
 static uint32_t crc16_ccitt_lut[CRC_LUT_SIZE];
@@ -69,8 +75,8 @@ reflect_32bits(uint32_t val)
        uint32_t i, res = 0;
 
        for (i = 0; i < 32; i++)
-               if ((val & (1 << i)) != 0)
-                       res |= (uint32_t)(1 << (31 - i));
+               if ((val & (1U << i)) != 0)
+                       res |= (uint32_t)(1U << (31 - i));
 
        return res;
 }