From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0078.outbound.protection.outlook.com [157.55.234.78]) by dpdk.org (Postfix) with ESMTP id BE2DA11A4 for ; Fri, 17 Jul 2015 16:39:25 +0200 (CEST) Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none; Received: from zhigangTHINK (123.120.121.217) by AM2PR02MB0802.eurprd02.prod.outlook.com (10.163.146.22) with Microsoft SMTP Server (TLS) id 15.1.213.14; Fri, 17 Jul 2015 14:39:22 +0000 From: Tony Lu To: "'De Lara Guarch, Pablo'" , References: <1436571020-16252-1-git-send-email-pablo.de.lara.guarch@intel.com> <1436573936-15956-1-git-send-email-pablo.de.lara.guarch@intel.com> <1436573936-15956-2-git-send-email-pablo.de.lara.guarch@intel.com> <001601d0bfab$6c4071e0$44c155a0$@com> <001c01d0c041$98b01c30$ca105490$@com> <000201d0c066$608af120$21a0d360$@com> In-Reply-To: Date: Fri, 17 Jul 2015 22:39:00 +0800 Message-ID: <001201d0c09e$64a253b0$2de6fb10$@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: AQHQu29EOFIwuy285UGf11xGpF0wDp3dzxKAgADIHeCAAFH/8IAAYyMAgAAHo0CAABLDMIAAXh+A Content-Language: zh-cn X-Originating-IP: [123.120.121.217] X-ClientProxiedBy: SG2PR06CA0039.apcprd06.prod.outlook.com (25.163.105.49) To AM2PR02MB0802.eurprd02.prod.outlook.com (25.163.146.22) X-Microsoft-Exchange-Diagnostics: 1; AM2PR02MB0802; 2:wumHliUdmZ0pCux2xOV+nZGQI6DIJf5MeNobjFd8JdTH4TXMYW6qTmeDUQ+75plv; 3:EG5SQQk5Bxa0vNz+p3KhlHn70l2oqEiXTb1xAaG9fXr0oH9Z/rIY9SDU0UZaFoLKGL8WcYu76UD74lTwutzu6NFFwqR4K8CrfEFsZXX/RWrkVXqLeRDXXTjLQl898C47fUqACBNRX6vbQfjiW6UlYg==; 25:EwHr1xVIpg93+V47aOyY8dHq0bKpxbM8pkkoqMO00Vb0M/icfNp25JXiWACM/q9Zq6TklsYhiYbsoa9Zzr0Etcq0eTmrs0pu3K5v5F9mPRdq5+ou15bfWbsgyyXtu0MtBHrNycZUHPFMRK8SidIre70RJmjC0v0mj4g3LBHx5kao8wbX9Kq34ahdVCHzHIgDBZ1x89JSzUgcHsGAxJp5JT5cSt9GM01Y8NwgiSbXN5zCrfEiN76111Mw8/MH4uEI; 20:S7cGbkP4DRc8/RdowGQZcAc/sri0HTkJYz2Ne0T2eUQZXRIC92pEeI5RkyFGRrYVoc4Xz7ZmzVRbbOAfo3xVHr39jv5n5FHeLXEUDTny+oW0Y1bdwohQHlPjRh0DFCWFFN0+gS95BVF13d5cOgbdyWQVQObRJeH7RUyDaeG1Bh8=; 4:lYKRV97Vh0VIlLiH3ItErxBErlWSXdZeTQap677f7124MltFhZVW9E6mLwf7L7pB2fF0hTYV3Ah1kkSNdJM4QdC+L1EheLweSI67d/DF+l0Au9NCglwQMm+o8IlNjaFGwIpjRqW0MSB+POenqgCapulB5CoV/gnxlAfusnZMVDTPsegh2PQOwDlwHdf9xmat8aVYsLb8wXtnSRlsAXjqg5eNyArw8b0kPtgA00qaANAJRKG/MgGucGFTadn3gMl+XpIoWc10eVP8grJcl3jRvpPMJTspqRtl6kqqJSR+qaU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR02MB0802; AM2PR02MB0802: X-MS-Exchange-Organization-RulesExecuted 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:AM2PR02MB0802; BCL:0; PCL:0; RULEID:; SRVR:AM2PR02MB0802; X-Forefront-PRVS: 06400060E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(52604005)(13464003)(164054003)(377454003)(77156002)(47776003)(102836002)(50466002)(66066001)(2950100001)(23726002)(107886002)(5001960100002)(189998001)(77096005)(46406003)(46102003)(42186005)(93886004)(76176999)(5001770100001)(50986999)(59696002)(40100003)(19580405001)(33646002)(61296003)(19580395003)(84116002)(86362001)(106116001)(122386002)(92566002)(50226001)(62966003)(97756001)(96836002)(2656002)(14726001)(33716001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR02MB0802; H:zhigangTHINK; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR02MB0802; 23:CJyUkzHCz0BI3c0mF+rbzvTDBDITCURmXz1msIH1Q?= =?us-ascii?Q?2x9At6Fk071rZDlYL/IWwcY0UTcTm2JwlMZD9mRS0tc67zC49BAgaIFRysS1?= =?us-ascii?Q?72NEoLPPP0TP1PsoK7rwJfLDMTaUDpjw+/Fx4rLRb8k7oQLE4/2Q/dkX5+UN?= =?us-ascii?Q?YpVi25RJokv4SOKjQZCsWyBi849k8B5SvzFwe7pqvI3DxhJNHy8mQeY2v6Vo?= =?us-ascii?Q?f79AXzlhVOyJLI8ubtE2YD/Mec6noGyVoDVZXgS+9EAESrOv2t0zwUmulW72?= =?us-ascii?Q?uqXU6h++kzeTtIRmOm4PBPJLkPT16y28VCiB25uuvm3w7+mPZvyVsclYaF5T?= =?us-ascii?Q?S8qjrYIR9a09hRS1ATRPhROzlw6O8LJ28eQBasY14UTAaQMi/6+Pjwm9991O?= =?us-ascii?Q?dgKVXXWw6gFrPmTgsSTiR1IL7oVeJ2x/exP0YtEyPBp4wSWzr127qFvpGcpP?= =?us-ascii?Q?BngNi6G2KIyPlx+pkowQrcXdIiXMUf6qd5x9SnnuW4sX3sYe3ccwlqYnIhgY?= =?us-ascii?Q?MZXTDSsLmMODHmzyP82lgif/vpf1rOXjl+JJReIpatXnItRnKEQxfrHGqiDU?= =?us-ascii?Q?CsoLvzi8W50Lv/ktlCnKlvSeveMqVdUrB92t7xbg/3VT+NJCxz3BPnlWy3UC?= =?us-ascii?Q?bOAkm3AAWiJ28ZQhQL+YAAV4jsRfXrFDX9Tjo4UyAfzHPotTeF0eJJFVzsp/?= =?us-ascii?Q?2t3bO+/KJz2t2/jPlKHc29N7zHtq+FNrn2LMmnofcbFrmGnuT2U2SQqKSYKu?= =?us-ascii?Q?hVh/HH/l6E162BXxYt44kt0+N4nYCNW5w4Ev9RDPoEzpMsQamShZ4ARZIR3Z?= =?us-ascii?Q?/HmAk6OLcCdY3ss6FIjOBUuh7A8PBY791r+1tt/PrJkf7K17yqvT6dBrODKy?= =?us-ascii?Q?PNfR8D5qalOXHNJOzVUu3xdMCVHB2Q4EBaJdGnoWKgNjQVeoVH8+oHk2tnCq?= =?us-ascii?Q?XLrx5/jHp74N776EUxHwUGFqjLEB5vwm7pHyyjUpHUDxIud0pOvGSlts/Fej?= =?us-ascii?Q?MVMTjRSo2Y+j5P2Y2rEVSQKl6/GebEq3MT3zkmfKsKzThIZQbh8JZmF1nYka?= =?us-ascii?Q?MwrPQudxwTrPgmC3ylLqI0QQEM3?= X-Microsoft-Exchange-Diagnostics: 1; AM2PR02MB0802; 5:zGHIPb0qXw4b+AxU/KidhqQ7HWXVEKxIWD/9OO0Tk0iFKdWq3S8IsmoEorhrmMLXBJJ6T/JxesFNbrgzZLC931InRbwmYgZ1i7jyjHYhL2v4IdJfVjodf362XQVojv+DpBoF9WvsxTqv7YLSgOOVAg==; 24:mr1qBSoErVOEst4vs146mzX4mT7uEQqL/IA3L0ErJk+pZt9ShNFHQptfxbQw/RWf0ONxM22iOzcWiLZsAEyviPaOLvqE6eyv7TmQ/UPME7o=; 20:jBuePkmq5UgJfbhMRV5aGj/e8Pg6gyMQ+KYg4kT6dV3wI3F+VkrqkT6UB9dbU4dDv8hI01JTpOWMi5yxtxRx+g== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2015 14:39:22.4815 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR02MB0802 Subject: Re: [dpdk-dev] [PATCH v7 1/7] hash: replace existing hash library with cuckoo hash implementation 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: Fri, 17 Jul 2015 14:39:26 -0000 Hi, Pablo The patch "hash: fix compilation for non-x86 systems " works for no-X86 arches. Thanks for your quick fix. >-----Original Message----- >From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com] >Sent: Friday, July 17, 2015 5:06 PM >To: Tony Lu; dev@dpdk.org >Subject: RE: [dpdk-dev] [PATCH v7 1/7] hash: replace existing hash library with >cuckoo hash implementation > >Hi Tony, > >> -----Original Message----- >> From: Tony Lu [mailto:zlu@ezchip.com] >> Sent: Friday, July 17, 2015 8:58 AM >> To: De Lara Guarch, Pablo; dev@dpdk.org >> Subject: RE: [dpdk-dev] [PATCH v7 1/7] hash: replace existing hash >> library with cuckoo hash implementation >> >> >-----Original Message----- >> >From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com] >> >Sent: Friday, July 17, 2015 3:35 PM >> >To: Tony Lu; dev@dpdk.org >> >Subject: RE: [dpdk-dev] [PATCH v7 1/7] hash: replace existing hash >> >library >> with >> >cuckoo hash implementation >> > >> > >> > >> >> -----Original Message----- >> >> From: Tony Lu [mailto:zlu@ezchip.com] >> >> Sent: Friday, July 17, 2015 4:35 AM >> >> To: De Lara Guarch, Pablo; dev@dpdk.org >> >> Subject: RE: [dpdk-dev] [PATCH v7 1/7] hash: replace existing hash >> >> library with cuckoo hash implementation >> >> >> >> Hi, Pablo >> >> >> >> >-----Original Message----- >> >> >From: De Lara Guarch, Pablo >> >> >[mailto:pablo.de.lara.guarch@intel.com] >> >> >Sent: Friday, July 17, 2015 4:42 AM >> >> >To: Tony Lu; dev@dpdk.org >> >> >Subject: RE: [dpdk-dev] [PATCH v7 1/7] hash: replace existing hash >> >> >library >> >> with >> >> >cuckoo hash implementation >> >> > >> >> >Hi Tony, >> >> > >> >> >> -----Original Message----- >> >> >> From: Tony Lu [mailto:zlu@ezchip.com] >> >> >> Sent: Thursday, July 16, 2015 10:40 AM >> >> >> To: De Lara Guarch, Pablo; dev@dpdk.org >> >> >> Subject: RE: [dpdk-dev] [PATCH v7 1/7] hash: replace existing >> >> >> hash library with cuckoo hash implementation >> >> >> >> >> >> >diff --git a/lib/librte_hash/rte_cuckoo_hash.c >> >> >> b/lib/librte_hash/rte_cuckoo_hash.c >> >> >> >new file mode 100644 >> >> >> >index 0000000..50e3acd >> >> >> >--- /dev/null >> >> >> >+++ b/lib/librte_hash/rte_cuckoo_hash.c >> >> >> >@@ -0,0 +1,1027 @@ >> >> >> ... >> >> >> >+ >> >> >> >+/* Functions to compare multiple of 16 byte keys (up to 128 >> >> >> >+bytes) */ static int rte_hash_k16_cmp_eq(const void *key1, >> >> >> >+const void *key2, size_t key_len >> >> >> >__rte_unused) >> >> >> >+{ >> >> >> >+ const __m128i k1 = _mm_loadu_si128((const __m128i *) >> key1); >> >> >> >+ const __m128i k2 = _mm_loadu_si128((const __m128i *) >> key2); >> >> >> >+ const __m128i x = _mm_xor_si128(k1, k2); >> >> >> >+ >> >> >> >+ return !_mm_test_all_zeros(x, x); } >> >> >> ... >> >> >> >> >> >> When compiling the latest dev DPDK for non-x86 arch, it fails on >> >> >> the above code, as the SSE is x86 specific defined in >> >> >> . Is it possible to replace this function with >> >> >> platform >> >independent code? >> >> > >> >> >Thanks for spotting this. I just sent a patch that should fix the >> problem. >> >> >Can you check if it works? >> >> >> >> Thanks for your quick response, but __m128i and all the _mm_ >> >> related functions are X86 specific defined in . This >> >> header file is only available in X86 compiler library, but no-X86 >> >> archs do not have this file. So if we can replace all the X86 >> >> specific code in the above function, that would be great. >> >> >> >With the patch that I sent, if you are compiling for a non-x86 arch, >> >you >> should >> >not have any problem, since all that code will only be used if using >> >x86 >> arch. >> >Have you tried compiling DPDK with the patch? >> >> Yes, I have built the DPDK with your patch, and got the following errors. >> This is >> because there are no __m128i, _mm_loadu_si128(), _mm_cmpeq_epi32() and >> _mm_movemask_epi8() on no-X86 arches. >> >> == Build lib/librte_hash >> CC rte_cuckoo_hash.o >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c: In function >> 'rte_hash_k16_cmp_eq': >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: error: >> expected '=', ',', ';', 'asm' or '__attribute__' before 'k1' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: error: 'k1' >> undeclared (first use in this function) >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: error: >> (Each undeclared identifier is reported only once >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: error: >> for each function it appears in.) >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: warning: >> implicit declaration of function '_mm_loadu_si128' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: warning: >> nested extern declaration of '_mm_loadu_si128' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: error: >> expected ')' before '__m128i' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: warning: >> type defaults to 'int' in declaration of 'type name' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1126: warning: >> cast from pointer to integer of different size >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1127: error: >> expected '=', ',', ';', 'asm' or '__attribute__' before 'k2' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1127: error: 'k2' >> undeclared (first use in this function) >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1127: error: >> expected ')' before '__m128i' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1127: warning: >> type defaults to 'int' in declaration of 'type name' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1127: warning: >> cast from pointer to integer of different size >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1133: error: >> expected '=', ',', ';', 'asm' or '__attribute__' before 'x' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1133: error: 'x' >> undeclared (first use in this function) >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1133: warning: >> implicit declaration of function '_mm_cmpeq_epi32' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1133: warning: >> nested extern declaration of '_mm_cmpeq_epi32' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1135: warning: >> implicit declaration of function '_mm_movemask_epi8' >> /u/zlu.bjg/git/dpdk.org/lib/librte_hash/rte_cuckoo_hash.c:1135: warning: >> nested extern declaration of '_mm_movemask_epi8' >> make[3]: *** [rte_cuckoo_hash.o] Error 1 >> make[2]: *** [librte_hash] Error 2 >> make[1]: *** [lib] Error 2 >> make: *** [all] Error 2 > >Looking at the snippet, I would say the patch has not been applied (did you apply >the patch hash: "fix compilation for non-x86 systems"?), because looking at the >lines where it is failing, they are the old lines in rte_cuckoo_hash.c, which have >been moved to another file (and should not be included for you). >Pablo >> >> Thanks >> -Tony >> >> >Pablo >> > >> >> Thanks >> >> -Tony >> >> >> >> >> >> >Thanks, >> >> >Pablo >> >> >> >> >> >> Thanks >> >> >> -Zhigang Lu >> >> >>