From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 3510A2B97
 for <dev@dpdk.org>; Wed, 28 Sep 2016 11:05:27 +0200 (CEST)
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by orsmga101.jf.intel.com with ESMTP; 28 Sep 2016 02:05:26 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.30,409,1470726000"; d="scan'208";a="14539337"
Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.220.108])
 by orsmga004.jf.intel.com with SMTP; 28 Sep 2016 02:05:24 -0700
Received: by  (sSMTP sendmail emulation); Wed, 28 Sep 2016 10:05:23 +0025
Date: Wed, 28 Sep 2016 10:05:23 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: dev@dpdk.org, Byron Marohn <byron.marohn@intel.com>,
 Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
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
Content-Disposition: inline
In-Reply-To: <1473190444-120795-3-git-send-email-pablo.de.lara.guarch@intel.com>
Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?=
 =?iso-8859-1?Q?opment?= Ireland Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
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 <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: Wed, 28 Sep 2016 09:05:27 -0000

On Tue, Sep 06, 2016 at 08:34:02PM +0100, Pablo de Lara wrote:
> From: Byron Marohn <byron.marohn@intel.com>
> 
> 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 <byron.marohn@intel.com>
> Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
> ---
>  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(-)
> 
<snip>
> --- 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