Re: [PATCH] hash: fix CRC32c computation
From: Pattan, Reshma <hidden>
Date: 2016-02-10 14:35:07
Hi, Small typo.
quoted hunk ↗ jump to hunk
-----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Didier Pallard Sent: Tuesday, December 22, 2015 9:35 AM To: dev@dpdk.org; Richardson, Bruce <redacted>; De Lara Guarch, Pablo [off-list ref] Subject: [dpdk-dev] [PATCH] hash: fix CRC32c computationdiff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index78a34b7..485f8a2 100644--- a/lib/librte_hash/rte_hash_crc.h +++ b/lib/librte_hash/rte_hash_crc.h + * Use single crc32 instruction to perform a hash on a byte value.
"on a byte value" should be ===> "on 2 bytes".
+ * Fall back to software crc32 implementation in case SSE4.2 is
+ * not supported
+ *
+ * @param data
+ * Data to perform hash on.
+ * @param init_val
+ * Value to initialise hash generator.
+ * @return
+ * 32bit calculated hash value.
+ */
+static inline uint32_t
+rte_hash_crc_2byte(uint16_t data, uint32_t init_val) { #if defined
+RTE_ARCH_I686 || defined RTE_ARCH_X86_64
+ if (likely(crc32_alg & CRC32_SSE42))
+ return crc32c_sse42_u16(data, init_val); #endif
+
+ return crc32c_2bytes(data, init_val);
+}
+Thanks, Reshma