From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 700AB2BA1 for ; Thu, 29 Sep 2016 03:40:40 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 28 Sep 2016 18:40:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,412,1470726000"; d="scan'208";a="1063725092" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga002.fm.intel.com with ESMTP; 28 Sep 2016 18:40:38 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.164]) by irsmsx105.ger.corp.intel.com ([169.254.7.196]) with mapi id 14.03.0248.002; Thu, 29 Sep 2016 02:40:37 +0100 From: "De Lara Guarch, Pablo" To: "Richardson, Bruce" CC: "dev@dpdk.org" , "Marohn, Byron" , "Edupuganti, Saikrishna" Thread-Topic: [PATCH v3 2/4] hash: reorganize bucket structure Thread-Index: AQHSGWd/FfXxeDvFT0Oo7npE04aMA6CPsBQw Date: Thu, 29 Sep 2016 01:40:37 +0000 Message-ID: References: <1472856999-31028-1-git-send-email-pablo.de.lara.guarch@intel.com> <1473190444-120795-1-git-send-email-pablo.de.lara.guarch@intel.com> <1473190444-120795-3-git-send-email-pablo.de.lara.guarch@intel.com> <20160928090523.GB47356@bricha3-MOBL3> In-Reply-To: <20160928090523.GB47356@bricha3-MOBL3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzIyNjBiYmQtZTIwZC00ZTQxLWJjNjUtMmNjYzAwYjU5YmM4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlVpVEdTSnl5XC9NbFZRc2hUNG9sOTE0QTFFWG5UUjV1U1oxaWJcL3hhMW4zaz0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 2/4] hash: reorganize bucket structure 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: Thu, 29 Sep 2016 01:40:41 -0000 > -----Original Message----- > From: Richardson, Bruce > Sent: Wednesday, September 28, 2016 2:05 AM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; Marohn, Byron; Edupuganti, Saikrishna > Subject: Re: [PATCH v3 2/4] hash: reorganize bucket structure >=20 > On Tue, Sep 06, 2016 at 08:34:02PM +0100, Pablo de Lara wrote: > > From: Byron Marohn > > > > Move current signatures of all entries together in the bucket > > and same with all alternative signatures, instead of having > > current and alternative signatures together per entry in the bucket. > > This will be benefitial in the next commits, where a vectorized > > comparison will be performed, achieving better performance. > > > > Signed-off-by: Byron Marohn > > Signed-off-by: Saikrishna Edupuganti > > --- > > lib/librte_hash/rte_cuckoo_hash.c | 43 ++++++++++++++++++---------= ------- > - > > lib/librte_hash/rte_cuckoo_hash.h | 17 ++++---------- > > lib/librte_hash/rte_cuckoo_hash_x86.h | 20 ++++++++-------- > > 3 files changed, 37 insertions(+), 43 deletions(-) > > > > > --- a/lib/librte_hash/rte_cuckoo_hash.h > > +++ b/lib/librte_hash/rte_cuckoo_hash.h > > @@ -151,17 +151,6 @@ struct lcore_cache { > > void *objs[LCORE_CACHE_SIZE]; /**< Cache objects */ > > } __rte_cache_aligned; > > > > -/* Structure storing both primary and secondary hashes */ > > -struct rte_hash_signatures { > > - union { > > - struct { > > - hash_sig_t current; > > - hash_sig_t alt; > > - }; > > - uint64_t sig; > > - }; > > -}; > > - > > /* Structure that stores key-value pair */ > > struct rte_hash_key { > > union { > > @@ -174,10 +163,14 @@ struct rte_hash_key { > > > > /** Bucket structure */ > > struct rte_hash_bucket { > > - struct rte_hash_signatures signatures[RTE_HASH_BUCKET_ENTRIES]; > > + hash_sig_t sig_current[RTE_HASH_BUCKET_ENTRIES]; > > + > > /* Includes dummy key index that always contains index 0 */ > > uint32_t key_idx[RTE_HASH_BUCKET_ENTRIES + 1]; > > + > > uint8_t flag[RTE_HASH_BUCKET_ENTRIES]; > > + > > + hash_sig_t sig_alt[RTE_HASH_BUCKET_ENTRIES]; > > } __rte_cache_aligned; > > >=20 > Is there a reason why sig_current and sig_alt fields cannot be beside eac= h > other in the structure. It looks strange having them separate by other fi= elds? Bucket entries has increased to 8 now, so sig_current and key_idx take 64 b= ytes (key_idx will be reduced to 8 entries in the fourth patch). Therefore, the idea was to push sig_alt to the next cache line (assuming a 64 byte cacheline, if it is bigger, then either way is ok), as it is not used in lookup (like sig_current and key_idx). Anyway, I think I will move sig_alt before flag, so it is cache aligned, in case vectorization is used in the future. Thanks, Pablo >=20 > /Bruce