From patchwork Wed Feb 27 09:44:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanqin Wei X-Patchwork-Id: 1048784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 448WJL3chYz9s4Y for ; Wed, 27 Feb 2019 20:55:14 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E7F28895B; Wed, 27 Feb 2019 09:55:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CD01E8912 for ; Wed, 27 Feb 2019 09:44:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 74DF376D for ; Wed, 27 Feb 2019 09:44:12 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3EB231596; Wed, 27 Feb 2019 01:44:12 -0800 (PST) Received: from net-arm-c2400.shanghai.arm.com (net-arm-c2400.shanghai.arm.com [10.169.41.165]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 78CAF3F575; Wed, 27 Feb 2019 01:44:11 -0800 (PST) From: Yanqin Wei To: dev@openvswitch.org Date: Wed, 27 Feb 2019 17:44:06 +0800 Message-Id: <1551260646-36452-1-git-send-email-Yanqin.Wei@arm.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: nd@arm.com Subject: [ovs-dev] [PATCH v1 1/1] hash: Enable hash_bytes128 optimization for aarch64. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org "hash_bytes128" has two versions for 64 bits and 32 bits system. This should be common optimization for their respective platforms. But 64 bits version was only enabled in x86-64. This patch enable it for aarch64 platform. Micro benchmarking test was run in two kinds of arm platform. It was observed that 50% performance improvement in thunderX2 and 40% improvement in TaiShan(Cortex-A72). Signed-off-by: Yanqin Wei --- lib/hash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hash.c b/lib/hash.c index c64f25e..06f8339 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -72,7 +72,7 @@ hash_words64__(const uint64_t p[], size_t n_words, uint32_t basis) return hash_words64_inline(p, n_words, basis); } -#if !(defined(__x86_64__)) +#if !(defined(__x86_64__)) && !(defined(__aarch64__)) void hash_bytes128(const void *p_, size_t len, uint32_t basis, ovs_u128 *out) { @@ -233,7 +233,7 @@ hash_bytes128(const void *p_, size_t len, uint32_t basis, ovs_u128 *out) out->u32[3] = h4; } -#else /* __x86_64__ */ +#else /* __x86_64__ or __aarch64__*/ static inline uint64_t hash_rot64(uint64_t x, int8_t r) @@ -361,4 +361,4 @@ hash_bytes128(const void *p_, size_t len, uint32_t basis, ovs_u128 *out) out->u64.lo = h1; out->u64.hi = h2; } -#endif /* __x86_64__ */ +#endif /* __x86_64__ or __aarch64__*/