[PATCH v6 3/7] hash: remove spurious warnings in CRC32 init

Stephen Hemminger
2026-03-29T23:24:38Z

The warnings in rte_hash_crc_set_alg() were misleading - they fired
when requesting a valid algorithm that would actually be used.
For example, requesting CRC32_SSE42 would trigger a warning even
though SSE4.2 instructions would be used successfully.

Remove the spurious warnings and only warn when the requested
algorithm is truly unavailable and falling back to software CRC.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/hash/rte_hash_crc.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c
index 523be0bf92..8b70982c4b 100644
--- a/lib/hash/rte_hash_crc.c
+++ b/lib/hash/rte_hash_crc.c
@@ -37,9 +37,6 @@ rte_hash_crc_set_alg(uint8_t alg)
return;

#if defined RTE_ARCH_X86
- if (!(alg & CRC32_SSE42_x64))
- HASH_CRC_LOG(WARNING,
- "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42");
if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42)
rte_hash_crc32_alg = CRC32_SSE42;
else
@@ -47,16 +44,13 @@ rte_hash_crc_set_alg(uint8_t alg)
#endif

#if defined RTE_ARCH_ARM64
- if (!(alg & CRC32_ARM64))
- HASH_CRC_LOG(WARNING,
- "Unsupported CRC32 algorithm requested using CRC32_ARM64");
if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32))
rte_hash_crc32_alg = CRC32_ARM64;
#endif

if (rte_hash_crc32_alg == CRC32_SW)
HASH_CRC_LOG(WARNING,
- "Unsupported CRC32 algorithm requested using CRC32_SW");
+ "Unsupported CRC32 algorithm requested, using CRC32_SW");
}

/* Setting the best available algorithm */
--
2.53.0