From patchwork Tue Jul 7 14:52:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sanford, Robert" X-Patchwork-Id: 6160 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 054C05A26; Tue, 7 Jul 2015 16:52:16 +0200 (CEST) Received: from prod-mail-xrelay08.akamai.com (prod-mail-xrelay08.akamai.com [96.6.114.112]) by dpdk.org (Postfix) with ESMTP id 487C7595E for ; Tue, 7 Jul 2015 16:52:14 +0200 (CEST) Received: from prod-mail-xrelay08.akamai.com (localhost.localdomain [127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id 2929F4CF68; Tue, 7 Jul 2015 14:52:13 +0000 (GMT) Received: from prod-mail-relay09.akamai.com (prod-mail-relay09.akamai.com [172.27.22.68]) by prod-mail-xrelay08.akamai.com (Postfix) with ESMTP id 1393C4CF66; Tue, 7 Jul 2015 14:52:13 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=akamai.com; s=a1; t=1436280733; bh=lzm8sU74UQyqI8A457XwJ3F8tCn7mSq57gJR0QUfBEU=; h=From:To:Subject:Date:References:In-Reply-To:From; b=Hc5oKy5CTUCZkZKi1V5K55BM9JLoP/CIUQWEPZcNFI3r6j+WOi7alArxMJCB2wdIi fUTcLXBHfOhb9V5UIlyf6VZ0U7TeJEK+LViPeErfb0FztzFlTJeUhYvqyfgz5UGVL2 LwHLpB4C7DmJLECfkeNfEIAFIoz35qDTUJ1noCtY= Received: from email.msg.corp.akamai.com (ustx2ex-cas5.msg.corp.akamai.com [172.27.25.34]) by prod-mail-relay09.akamai.com (Postfix) with ESMTP id 11FC21E07C; Tue, 7 Jul 2015 14:52:13 +0000 (GMT) Received: from USTX2EX-DAG1MB3.msg.corp.akamai.com (172.27.27.103) by ustx2ex-dag1mb5.msg.corp.akamai.com (172.27.27.105) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Tue, 7 Jul 2015 09:52:10 -0500 Received: from USTX2EX-DAG1MB3.msg.corp.akamai.com ([172.27.27.103]) by ustx2ex-dag1mb3.msg.corp.akamai.com ([172.27.27.103]) with mapi id 15.00.1076.000; Tue, 7 Jul 2015 09:52:11 -0500 From: "Sanford, Robert" To: Zhigang Lu , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 02/12] hash: fix compilation on non-X86 platforms Thread-Index: AQHQuMSBEcoP8DaiYUCl84fFQ/g1Mg== Date: Tue, 7 Jul 2015 14:52:11 +0000 Message-ID: References: <1436172698-21749-1-git-send-email-zlu@ezchip.com> <1436172698-21749-3-git-send-email-zlu@ezchip.com> In-Reply-To: <1436172698-21749-3-git-send-email-zlu@ezchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.4.3.140616 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.19.133.181] Content-ID: <4D8D26B691DCDE49A662F1BE39C7D9EC@akamai.com> MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 02/12] hash: fix compilation on non-X86 platforms X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Zhigang, Can you add this one-line X86 change (below)? When included by C++ code, 'key' needs an explicit type cast. You may want to put the 'const' keyword in your non-X86 change, too. --- Thanks, Robert #else const uint32_t *k = (uint32_t *)(uintptr_t)key & (uintptr_t)~3); -- >The "hash: remove duplicated code" change unfortunately broke the >build for non-X86 platforms. This patch fixes this breakage. > >Change-Id: Ie109d67e681b75b45320fab1bf9de4eb9c9701bf >Signed-off-by: Zhigang Lu >--- > lib/librte_hash/rte_jhash.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/lib/librte_hash/rte_jhash.h b/lib/librte_hash/rte_jhash.h >index e230449..d1b6cf3 100644 >--- a/lib/librte_hash/rte_jhash.h >+++ b/lib/librte_hash/rte_jhash.h >@@ -44,6 +44,7 @@ > extern "C" { > #endif > >+#include > #include > #include > >@@ -122,7 +123,7 @@ __rte_jhash_2hashes(const void *key, uint32_t length, >uint32_t *pc, > const uint32_t *k = key; > const uint32_t s = 0; > #else >- const uint32_t *k = (uint32_t *)(uintptr_t)key & (uintptr_t)~3); >+ const uint32_t *k = (uint32_t *)((uintptr_t)key & (uintptr_t)~3); > const uint32_t s = ((uintptr_t)key & 3) * CHAR_BIT; > #endif > if (!check_align || s == 0) { >-- >2.1.2 > diff --git a/lib/librte_hash/rte_jhash.h b/lib/librte_hash/rte_jhash.h index e230449..49b4ac0 100644 --- a/lib/librte_hash/rte_jhash.h +++ b/lib/librte_hash/rte_jhash.h @@ -119,7 +119,7 @@ __rte_jhash_2hashes(const void *key, uint32_t length, uint32_t *pc, * If check_align is not set, first case will be used */ #if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_X32) - const uint32_t *k = key; + const uint32_t *k = (const uint32_t *)key; const uint32_t s = 0;