From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pablo.de.lara.guarch@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 369835A8C
 for <dev@dpdk.org>; Fri, 17 Jul 2015 09:34:56 +0200 (CEST)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga102.fm.intel.com with ESMTP; 17 Jul 2015 00:34:42 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.15,494,1432623600"; d="scan'208";a="730600625"
Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159])
 by orsmga001.jf.intel.com with ESMTP; 17 Jul 2015 00:34:41 -0700
Received: from irsmsx108.ger.corp.intel.com ([169.254.11.201]) by
 IRSMSX104.ger.corp.intel.com ([169.254.5.171]) with mapi id 14.03.0224.002;
 Fri, 17 Jul 2015 08:34:40 +0100
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Tony Lu <zlu@ezchip.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH v7 1/7] hash: replace existing hash library
 with cuckoo hash implementation
Thread-Index: AQHQu29EOFIwuy285UGf11xGpF0wDp3dzxKAgADIHeCAAFH/8IAAYyMA
Date: Fri, 17 Jul 2015 07:34:39 +0000
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D897272D88F9@IRSMSX108.ger.corp.intel.com>
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>
 <E115CCD9D858EF4F90C690B0DCB4D897272D85AD@IRSMSX108.ger.corp.intel.com>
 <001c01d0c041$98b01c30$ca105490$@com>
In-Reply-To: <001c01d0c041$98b01c30$ca105490$@com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [163.33.239.182]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Jul 2015 07:34:57 -0000



> -----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 librar=
y
> with cuckoo hash implementation
>=20
> Hi, Pablo
>=20
> >-----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 libra=
ry
> 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 =3D _mm_loadu_si128((const __m128i *) key1);
> >> >+	const __m128i k2 =3D _mm_loadu_si128((const __m128i *) key2);
> >> >+	const __m128i x =3D _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 <emmintrin.h>.  Is
> >> it possible to replace this function with platform independent code?
> >
> >Thanks for spotting this. I just sent a patch that should fix the proble=
m.
> >Can you check if it works?
>=20
> Thanks for your quick response, but __m128i and all the _mm_ related
> functions
> are X86 specific defined in <emmintrin.h>.  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.
>=20
With the patch that I sent, if you are compiling for a non-x86 arch, you sh=
ould not have any problem,
since all that code will only be used if using x86 arch. Have you tried com=
piling DPDK with the patch?

Pablo

> Thanks
> -Tony
>=20
>=20
> >Thanks,
> >Pablo
> >>
> >> Thanks
> >> -Zhigang Lu
>=20