table: remove experimental CRC API for some arches

Message ID 20240322135328.393562-1-david.marchand@redhat.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series table: remove experimental CRC API for some arches |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

David Marchand March 22, 2024, 1:53 p.m. UTC
  x86 and ARM architectures provide a non-experimental implementation for
rte_crc32_u64().
Experimental API rte_crc32_u64_generic() was only exported for other
arches.

Leaving this API exposed could result in portability issues: an
application using rte_crc32_u64_generic() would not compile on x86 or
ARM.

Move this symbol code in the only caller of the table library, and
remove this symbol.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/table/rte_table_hash_func.h | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)
  

Patch

diff --git a/lib/table/rte_table_hash_func.h b/lib/table/rte_table_hash_func.h
index a962ec2f68..aa779c2182 100644
--- a/lib/table/rte_table_hash_func.h
+++ b/lib/table/rte_table_hash_func.h
@@ -14,23 +14,6 @@  extern "C" {
 #include <rte_compat.h>
 #include <rte_common.h>
 
-__rte_experimental
-static inline uint64_t
-rte_crc32_u64_generic(uint64_t crc, uint64_t value)
-{
-	int i;
-
-	crc = (crc & 0xFFFFFFFFLLU) ^ value;
-	for (i = 63; i >= 0; i--) {
-		uint64_t mask;
-
-		mask = -(crc & 1LLU);
-		crc = (crc >> 1LLU) ^ (0x82F63B78LLU & mask);
-	}
-
-	return crc;
-}
-
 #if defined(RTE_ARCH_X86_64)
 
 #include <x86intrin.h>
@@ -48,7 +31,17 @@  rte_crc32_u64(uint64_t crc, uint64_t v)
 static inline uint64_t
 rte_crc32_u64(uint64_t crc, uint64_t v)
 {
-	return rte_crc32_u64_generic(crc, v);
+	int i;
+
+	crc = (crc & 0xFFFFFFFFLLU) ^ v;
+	for (i = 63; i >= 0; i--) {
+		uint64_t mask;
+
+		mask = -(crc & 1LLU);
+		crc = (crc >> 1LLU) ^ (0x82F63B78LLU & mask);
+	}
+
+	return crc;
 }
 
 #endif