DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] table: remove experimental CRC API for some arches
@ 2024-03-22 13:53 David Marchand
  0 siblings, 0 replies; only message in thread
From: David Marchand @ 2024-03-22 13:53 UTC (permalink / raw)
  To: dev; +Cc: Cristian Dumitrescu

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(-)

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
-- 
2.44.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-22 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 13:53 [PATCH] table: remove experimental CRC API for some arches David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).