From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0062.outbound.protection.outlook.com [157.56.112.62]) by dpdk.org (Postfix) with ESMTP id 21A72ADA7 for ; Fri, 17 Jul 2015 09:58:32 +0200 (CEST) Received: from AM2PR02MB0803.eurprd02.prod.outlook.com (10.163.146.23) by AM2PR02MB0882.eurprd02.prod.outlook.com (10.163.147.148) with Microsoft SMTP Server (TLS) id 15.1.213.14; Fri, 17 Jul 2015 07:58:31 +0000 Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none; Received: from zhigangTHINK (124.207.145.166) by AM2PR02MB0803.eurprd02.prod.outlook.com (10.163.146.23) with Microsoft SMTP Server (TLS) id 15.1.213.14; Fri, 17 Jul 2015 07:58:28 +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> In-Reply-To: Date: Fri, 17 Jul 2015 15:58:10 +0800 Message-ID: <000201d0c066$608af120$21a0d360$@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/8IAAYyMAgAAHo0A= Content-Language: zh-cn X-Originating-IP: [124.207.145.166] X-ClientProxiedBy: BLUPR11CA0026.namprd11.prod.outlook.com (10.141.240.36) To AM2PR02MB0803.eurprd02.prod.outlook.com (25.163.146.23) X-Microsoft-Exchange-Diagnostics: 1; AM2PR02MB0803; 2:sjwRIxIgmJt4/R0UBQ+ylRNilcTLUmRNXNVeItV0rUZlYN3vqaR9oo0bI6JUn1EL; 3:JaeFDL+IpLSMBsk2gJCJEP56iGqFkb8UOgxFcmFrFWUS0q3Hipya0Zv9ZBJLN9aZyPbx7daKdPvBpOOu/ME3NujhtGIdTsWNoQVlN6n/QcjDBYrwN/9bPzn6YQ39YAUaacdElkx34cloMx1bA6pwdg==; 25:V69l4X+42ztl9yWRx23wMg59fdwaZsoswCJXWPrj9t6jnX3DBWTS0IYsXlh0obMG0K9CwkFDvO9s8h8ULrCGZNusfjqBvmbBI4y/1SotTWaSrwYJATbkWWU3yEBQQOMbQRlnfjrtke2kRP42IHvAEkKZUCdQDDcgWv5dX1XZuCJ6l1HxQDuAHhdIoLw5vCluxfjFuHwgFQjPNasy/j8/T9SG11Bl8Y+zrpDfPkQgVFkrCflTbr551IXMmvuJ7CKI; 20:SGC7yvJPbzu4nW39eKx+n0Lx4iyL+/jxDmHBsjruYCDfrorbnh5EPfs2XZqBKVrxjB9kNzecsVHdeW5aPE5p+3MF05xxc518lLJGAwZzPRxT9ZEYEalHtiQaejETiL05Xmp7YtV8jnizNPCvZ0yLKDuaeXCs8Y+7QqYN/7rTl9U=; 4:jOaVtTKPG5w0+Hk/tGLySnmdhaf/qQpncF9Udw+ow29IcCiaqh+WY6sNuzMC7GQF+zmkAVT0zzSXoeumccuanQtB/pD0S1fYO15hRsZAAHKLKN5DdxLHOm/qbv/0YmroZHbltq2pOY3gxwhVjkAjqLmgHTrjRSeS5Yvbm4DU55Zo2y8ofhTVysAsKgKs+gyK3Zb+9TX3QDLQXovmVJLfGAC55VUuy66LXqOG5ZEedzoWNh2g3gZih6CLwykHvTQngLMiNp9oCalOlOANkYnAwFNO+4HoS4pBMJHpHVUB+O4= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:AM2PR02MB0803; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:AM2PR02MB0882; AM2PR02MB0803: 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:AM2PR02MB0803; BCL:0; PCL:0; RULEID:; SRVR:AM2PR02MB0803; X-Forefront-PRVS: 06400060E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(13464003)(164054003)(377454003)(52604005)(33646002)(50226001)(47776003)(61296003)(86362001)(14726001)(77156002)(2656002)(84116002)(23726002)(87976001)(40100003)(19580405001)(122386002)(42186005)(107886002)(2950100001)(5001960100002)(33716001)(66066001)(19580395003)(50986999)(50466002)(97756001)(46102003)(106116001)(76176999)(77096005)(102836002)(59696002)(5001770100001)(46406003)(189998001)(92566002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR02MB0803; H:zhigangTHINK; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR02MB0803; 23:G4CrtoqG+dVJUF4DcjNCKI7hS0KyunvwO6ctdxMOU?= =?us-ascii?Q?mW2E8AqdUAeH5mMjbhyBfbtrOJDrY1Tr4gvE9Jn9aFqkM8wOZshUs2RP/HxG?= =?us-ascii?Q?xO8qS4D6WMsgKJC3sCpLlbaylagppx1ptc29SOuPrh0yT8w3t4+9PRqIV7Am?= =?us-ascii?Q?VPDbnQ2ZvmoDgqLZaXW4IWC7KbWky8nF1YRWTyx/s/ITvQ9V0MaUKA+fbKhK?= =?us-ascii?Q?L4swdGbyaFkgaRWzHWQN35sfEXqO22n3pHSpuvkRYSPNokYHLFlrmrbnwnGh?= =?us-ascii?Q?3rl8fmdjN/JfxGUdv9P9Jj9WJCM9JvmKtn0sSCftRUwtBdoHSRZFEOdZh3C1?= =?us-ascii?Q?ToC0iPfHVYltEL29Le8a39dvmB/X9wbxLpu3iOYHVtr5wk4mCL5ROm0eB0K+?= =?us-ascii?Q?xZncy6lC+/taUW/BC69VBRFUM/mhro5S9itbD2TaQHKRdfoEtCfzVFBxYNRE?= =?us-ascii?Q?iwWR7HLZoVLO1lrE164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v2eum/jvvvw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2015 07:58:28.9567 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR02MB0803 X-Microsoft-Exchange-Diagnostics: 1; AM2PR02MB0882; 2:N6uEfs8+z9RlDyosrSU0d0p4SMuM4skHAoVGB6QmkYwvKXPap44GQc9VOPwiqOmt; 3:URdkVy4B4sjmgpkHZTVZTycIYKmBjZA1SGDJjohxO8i/EiXkKEwhSFczBdqznD0v+GrOurjpfgHZ4npNq39vvgW2Yi7gW/X/Eaenq2nuubomH+xEgmEKenf4Lkxc8lxEJ6YdUFEHW5lEirsU1KegFg==; 25:GUyCfMvdQ5TsTQFHANbx610CVVV+uiUMO73q7JP1WCAJGlWZfvypkjLJqunAqA98JE1WuYoKjEKMeFX7h+luE2PeOD6VRXWnwtMrDiXvNWYQeSutGTh8DQeMvbbSncddY1/o92f/Co1t7MPepnYc7FQvZfQnbISnsiTXWZqDO0SheJEVJBlldiHRr9Ld/AY0oaLG90bzRXRXJGP6dI189D798DsiIojLax/5j4lR1Bm24NLHLOuf4gDdI2ZdyU/C; 20:UAVrFSlqtDkwh7Nbev6KrReoNWXxlWiwPVDDyWjXMbkQjEfs2liD1Pm9kiZ1M7D5CfTqCgdfCdAWK/SHgjrRUg==; 23:eAuKeONBV5E60aoxHLqKqaKuC+n0/vxRYXZ1N4Bv1QmQEERFz2fEigl6Km8uCjLQQMLM8OwxcWLP0c/jfU5MCLDeJ8K/dOC/Ahfs+nwWip4Wm8KFbXcfUcd1FLIQJADHve7E7rZyKERf2HIA2fPyaLHrTV4NeYvKowNTpwkO9s071uC/tVOsUkXoPKxi7FYCA00zpYwfvNyo5VOl+A5ERGFUp0HxFrZkWstXisV2G5KCgpDxX/dPjlqZQ9IPDnjl AM2PR02MB0882: X-MS-Exchange-Organization-RulesExecuted X-OriginatorOrg: ezchip.com 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 07:58:32 -0000 >-----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 Thanks -Tony >Pablo > >> Thanks >> -Tony >> >> >> >Thanks, >> >Pablo >> >> >> >> Thanks >> >> -Zhigang Lu >>