From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v3 2/4] hash: reorganize bucket structure Date: Wed, 28 Sep 2016 10:05:23 +0100 Message-ID: <20160928090523.GB47356@bricha3-MOBL3> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Byron Marohn , Saikrishna Edupuganti To: Pablo de Lara Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3510A2B97 for ; Wed, 28 Sep 2016 11:05:27 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1473190444-120795-3-git-send-email-pablo.de.lara.guarch@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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; > Is there a reason why sig_current and sig_alt fields cannot be beside each other in the structure. It looks strange having them separate by other fields? /Bruce