From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH] table: remove experimental CRC API for some arches
Date: Fri, 22 Mar 2024 14:53:28 +0100 [thread overview]
Message-ID: <20240322135328.393562-1-david.marchand@redhat.com> (raw)
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
reply other threads:[~2024-03-22 13:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240322135328.393562-1-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).