From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0091.outbound.protection.outlook.com [157.55.234.91]) by dpdk.org (Postfix) with ESMTP id 8E83E11C5 for ; Wed, 8 Jul 2015 10:22:01 +0200 (CEST) Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none; Received: from zhigangTHINK (124.207.145.166) by VI1PR02MB0815.eurprd02.prod.outlook.com (10.162.14.152) with Microsoft SMTP Server (TLS) id 15.1.207.19; Wed, 8 Jul 2015 08:21:42 +0000 From: Tony Lu To: "'Sanford, Robert'" , References: <1436172698-21749-1-git-send-email-zlu@ezchip.com> <1436172698-21749-3-git-send-email-zlu@ezchip.com> In-Reply-To: Date: Wed, 8 Jul 2015 16:21:27 +0800 Message-ID: <001501d0b957$2072eb80$6158c280$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AQHQuMSBEcoP8DaiYUCl84fFQ/g1Mp3RPEgg Content-Language: zh-cn X-Originating-IP: [124.207.145.166] X-ClientProxiedBy: BY2PR07CA047.namprd07.prod.outlook.com (10.141.251.22) To VI1PR02MB0815.eurprd02.prod.outlook.com (25.162.14.152) X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB0815; 2:x+HfZUiIp5MQZmytDY3ZgdIqXAGId5Eleu9u1K9H9ZLsqTzbjcU3z9okIjKTvNSR; 3:ChX/ZwVIudCzd+3qq2cbs3TDqmaxbpd9AEnNBbn44tctz7fHQNctWLk+jUNd2Ed7tJoNQD42zxPmp3IGtP7F/OO+GukGkLThxupPsBwjyAERQbqmgprq21KhvJyMah/3/3EgEHgIMd9+5Kvqnqy4cA==; 25:ua9bnzOAVxX+KYpltKYn1doZkW7ZHXQg7A3wgFDWVZEB0GjM4r2wjxampRd1D3a7g6aRPzjsqHuO2jUpiJl2nWCXeCa+qRs3OFYAMTZs5P0AxvSK9LgPd7bGNEOGhmUKKN9jAzGa2jgdd+hGRcSmL9l+ZznNx4nAuCy6tJfx26CBZFfFGqfE5FeX+eWpxzdnxifWmgtvYtOORPlHppImVrRmX+yNLUP2sYNwtNHOfW0HRAncVEAkuvAshKVuA5Hpny7vUWeIiUV9Brs0hvkgRg==; 20:NtB/z6/iq7pikRdFoJqXT/HV7H5slhBvCOHSg7bQcVLDS2q9NQya0ZhZ+V0Ey2TXrhDjzvksjdZ3y094T98EuxRM0Xmpdtq2bWPeySa0NfGVtUpansxoP1p4DTQqXkv9xZkr4+bKfukJuYFoL7r31TrLNpKArPl7fqckMTeLrP0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0815; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:VI1PR02MB0815; BCL:0; PCL:0; RULEID:; SRVR:VI1PR02MB0815; X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB0815; 4:w994ratkN4p+bsVFD7OmarVgzC1Kjf6SbmO+Oi8lIgj28vigClJXc5YRFng8OLpx9SU792fpZpolyk5Z6ypnNC6CdROZM9zeHYMHr98UklmaXN6HMHkBLl6/YllX7kG1cdStEJ8ex32s6dfXbarW70bRWE7KKM8cJlnKhb154mvmzTpSr9YKP3ptP0yRJWofC3NenH/p7HKtXBYiHg2mV6mHW6FEe5/wSu/CH+9mqsKdf2Pg3IbwaXxh6Qyh+5iGmlWhC6eQEncbPKgNpQT5T5AYiw7vS6Oudjns3+gaSuo= X-Forefront-PRVS: 0631F0BC3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(13464003)(51704005)(377454003)(164054003)(77096005)(59696002)(92566002)(46102003)(33716001)(61296003)(96836002)(50466002)(106116001)(122386002)(66066001)(62966003)(42186005)(77156002)(40100003)(5001960100002)(2950100001)(19580405001)(50986999)(84116002)(5001770100001)(46406003)(107886002)(2656002)(23726002)(102836002)(33646002)(189998001)(76176999)(19580395003)(97756001)(14726001)(50226001)(86362001)(87976001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR02MB0815; H:zhigangTHINK; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR02MB0815; 23:yT0lfLCVJOvfdUbgBWiyshUK8wKnFzE6Od2EgRuEV?= =?us-ascii?Q?ATC/J1i4fwiMhPLb/AU+WZvxIvJl3WC+E8xI26pMPymr4pzo8tm5X6/OUwS6?= =?us-ascii?Q?WundUtHIpDvwH/KGxTef6lI25tzZE8KbBLlGi1Vtg7qqPz9mq5QzJwJ2XtnX?= =?us-ascii?Q?m2W2VBCadu9lp8Qxf8ypNDW0+UbPbFbUJvVjxvXRAVHDGJFOdFWiyoza4e80?= =?us-ascii?Q?xzbcrkokwnfr5jqfXC3yPKgw6W02vDGVZP1Y8mi/nEtqdjR6xEpv1Dw8NA8N?= =?us-ascii?Q?1q9oDSKVdEZGdMlOcNmSdayXzV4G+FrEu2OJUoQx1cwxB7HFuQL/cX633eGD?= =?us-ascii?Q?mmbe6ayg8EYv3/skTReXHMXbw81N4jwQ2T+p3bYBNgfinQOkK7YToGUMwBTy?= =?us-ascii?Q?JH1urP2I9k+l2NN/qYiLHAQ7hwU4Q4/mzBYcAD3DPfguG7bfmUPAIHUmVPAt?= =?us-ascii?Q?6LUg7vciNSZ0DfJcJ/ZfMhIWuZnkZVqpn39RjTncygg0GRrLtHw7N+U2SYW0?= =?us-ascii?Q?Y36stJzjptMm9/JH5VReDFfdQ7+xESrrVkvCYJvAkwm0VId5zIYKrmbx8tkH?= =?us-ascii?Q?vnqiY58UCJfL9yE4ulu0BEy8CwKwxofiwhOvqSxrVkkGt5Ne26TXKBROYhYI?= =?us-ascii?Q?06gbxJPOO2v5yBLumfrL4fyd47ld7b0b9Hm0hNhQcDdr0Z0Zdd2vtFK212Zz?= =?us-ascii?Q?dP/+XxdM4iVoRESyZ8rfsFr3q6xsuKyKWMOS52MTnE0U9sYsJix9QRaSnFEo?= =?us-ascii?Q?8axdAYNCaei8bE/qPpC4d5NnUeDM8cyBoSP+c2Y7vNXsI3g/UBRs5efpLeu/?= =?us-ascii?Q?EB2zzdzTSyyG3TJK6iO0LcLlAEtHjC568a9BxiOzWhkO9VRqLJV91Hge3CLx?= =?us-ascii?Q?8hmLqHLllW/ecZVJUqu50wgnfVo14hFdEclXVeJ/0SylOGzpB6k4l6SbVQDi?= =?us-ascii?Q?SebPKintWFsPsB99Houxiq77fR5K0j5Siq9EL/TQNjd3TbDaTSXmMkobRHiE?= =?us-ascii?Q?W7ifAS+dqtIvxLirQFeI+LWJsFibCALZnT4CAZfKdFy2II+Zrv9/yHyewACM?= =?us-ascii?Q?klpezc=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB0815; 5:Oly9zDTWYuUB3CeORB+DlPtAHwPZFIIw6LZ+KydUgniC5w/c84DgXfFdaNAaFUohLW3X4iOcY6Q6g2/6P5rF1HvpMYAk7XvNRhT4GNBz9IpOZnXk6Q1K3N6RUIgX2liPr8f27Uxm5NBdiqrZO1BRKw==; 24:MQj1ONM4nk/4GRYTELYJXv+fOscQqTnu56r7eyP7Zvi8RBvUg4RXjWssUr2ewyJQRIYKlKwQ9VYiqdSr0QTTjcyctXVqXvTR1kG5kwZ/ybM=; 20:nvNncvLWrIZDI+4Q1MTFG1t+/aPwZJMslcyRYPOIsJtGL9SNa6d9df+jtnYShThAdIsXbyk7yxqfPSGz594JHg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2015 08:21:42.6929 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB0815 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: , X-List-Received-Date: Wed, 08 Jul 2015 08:22:07 -0000 >-----Original Message----- >From: Sanford, Robert [mailto:rsanford@akamai.com] >Sent: Tuesday, July 07, 2015 10:52 PM >To: Zhigang Lu; dev@dpdk.org >Subject: Re: [dpdk-dev] [PATCH v3 02/12] hash: fix compilation on non-X86 >platforms > >Hi Zhigang, > >Can you add this one-line X86 change (below)? When included by C++ code, 'key' >needs an explicit type cast. OK, will add this in next version. >You may want to put the 'const' keyword in your non-X86 change, too. >-- > >Thanks, >Robert > > > > >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; > #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 >>