From patchwork Fri Mar 22 13:53:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 138748 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5458543D06; Fri, 22 Mar 2024 14:54:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44D4642E9B; Fri, 22 Mar 2024 14:54:06 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 3D2A340284 for ; Fri, 22 Mar 2024 14:54:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711115643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KCygQd9Sp9MHGLmpE3rAOCXBUT4zFz3pYdomjSif9G8=; b=GsBz9SKmgi+clV3gSppPnuYBrnMH9JhEZt+fF5dUYnsEVVW8U/4XYcBHxadITdNh0AZtkP nzTqrPimYG7zx8Yh9EHgtKcrwx78pDrW5wZ5QDba4jDiS2wF9zPGVaiht8JTkJjuJLxLIm YNkJPjgUdHBNF7cIag1ncHLJJzHY3A8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-132-uUsr8Sb-PUiqQAsBBCqwfQ-1; Fri, 22 Mar 2024 09:54:02 -0400 X-MC-Unique: uUsr8Sb-PUiqQAsBBCqwfQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E1481C0173E; Fri, 22 Mar 2024 13:53:58 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id B23073C20; Fri, 22 Mar 2024 13:53:57 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Cristian Dumitrescu Subject: [PATCH] table: remove experimental CRC API for some arches Date: Fri, 22 Mar 2024 14:53:28 +0100 Message-ID: <20240322135328.393562-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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 #include -__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 @@ -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