From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <users-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E7A45A0C57
	for <public@inbox.dpdk.org>; Thu,  4 Nov 2021 17:50:00 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 2786D42761;
	Thu,  4 Nov 2021 17:49:59 +0100 (CET)
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com
 [64.147.123.20])
 by mails.dpdk.org (Postfix) with ESMTP id B3AFE411C9;
 Thu,  4 Nov 2021 17:49:56 +0100 (CET)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46])
 by mailout.west.internal (Postfix) with ESMTP id A8BDC3201A3C;
 Thu,  4 Nov 2021 12:49:54 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Thu, 04 Nov 2021 12:49:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm2; bh=
 KG8aUCDdxmDD8QYorpjpPs0sI0YcExRfm3LEz16342E=; b=JbjwG7n+zam+/bAS
 IsoHP+oWIcp8/QT/pmZHgvIRTHWZ+fA4J/yec4vqiuE1jklzCuDjHtOlBCUtQt5O
 lfcPovNSX1gOfruVxyEJJANp0N3Sf0lLzkMoEFo7bYuM/SHLwtJp5AFMTehRYkiw
 Wu1oY9RQfzAE5L/8hoC/eOwKn73lez0uRb68O4uDE2ZGs8rhWg4XbtHpepB6So5O
 fZiWsuIxoCvzbqOLyS3HcircEcUU9mmhIpSW48PomiW7/66SiRws3yF4YEsll0ka
 p+vjvMXciwupL9eiPKuebaUUvewxGuW4wVcsBr7aeHeqUMbdcLoyleK9LqMNUHRD
 7f5Bmg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=KG8aUCDdxmDD8QYorpjpPs0sI0YcExRfm3LEz1634
 2E=; b=Nco2M0RUfgxtYeAdB/rSwU8lO7V3tS7EcqKIqisjX6AapdyKbZbArPJJX
 ZD0Gr0UxpxSvR58naWL/Qppm8rqiN8qz3BirnGzXvULW/m8DSqSOrcF89Q82omoq
 gXZc5ZfYtI8zTf18AjnkbBcbUXguPXu+drR8H80cFI0az4AiNR8Tx1fjugyT10jB
 IgaZoCxi527/x4sMKkVPGY4vkmNwSvy/k+ZC0AYtvM+3EkVUkvfUN6fwoezM2qEZ
 yt2UJNtwz5RYRmCWrSCs0K6MI3yhjo4ajx5wlfMCnuQvHzJtBcz5TCsjZ82jjXQa
 gVsf3j8a0ityV1k6KX3s34qrwEIVQ==
X-ME-Sender: <xms:MQ-EYf5obvKWePutrQTi8m_nHXf99ChqWB8Ff-jYxI_3AdxdpkM_lw>
 <xme:MQ-EYU4EdcHaVWDZ0zu_cyrFUfUdKrW9x1a1Tl9mU3w37x1IWjX0p8WcsJv0rjscd
 cQkssVRA63OpO_8zA>
X-ME-Received: <xmr:MQ-EYWdB-RMnR9WFiqs1CykdRtAEdTMJtLkpNIFx4z9iGtd1JbnYYv_Mc9ioJoAEY95f77PIXArJjLqZ9tFdeV7L0g>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdeggdeklecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf
 frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei
 iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh
 hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:MQ-EYQLPulO_rX-Numj-iwEi-HBzoAYLQZXBSXpQEZ8YPwCr3wHKQg>
 <xmx:MQ-EYTK0oUrhSYuegcOt83jnMbujRv9R5_R4MZaKSTPCP4udUqTRkw>
 <xmx:MQ-EYZxBvQlwag_qAicveWzHJfBEy3SowLsmj-XyZ09_l8mJ4YxL3w>
 <xmx:Mg-EYb8JYOmJD0LrJqx6-_YwrQhxz1B4kXROWso4AQBZb8UDxoSIYA>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 4 Nov 2021 12:49:52 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
Cc: "Kinsella, Ray" <ray.kinsella@intel.com>,
 Syam Prasad N Pearson <syam.pearson@gadgeon.com>,
 "users@dpdk.org" <users@dpdk.org>, "dev@dpdk.org" <dev@dpdk.org>, "Wang,
 Yipeng1" <yipeng1.wang@intel.com>, "Gobriel, Sameh" <sameh.gobriel@intel.com>,
 "Richardson, Bruce" <bruce.richardson@intel.com>
Subject: Re: [dpdk-dev] Doubt regarding DPDK hash Library implementation
Date: Thu, 04 Nov 2021 17:49:51 +0100
Message-ID: <3060108.LiUVKm96O0@thomas>
In-Reply-To: <6c1c908e-6a9a-c50d-0fa3-be61770ef97c@intel.com>
References: <CAA2VcQjJPvz63p=gzM+Sh4J7UCRSUaHg5NBgB0o-pmq3m=kmmg@mail.gmail.com>
 <PH0PR11MB47769F949D7FD3273A0ABB48908D9@PH0PR11MB4776.namprd11.prod.outlook.com>
 <6c1c908e-6a9a-c50d-0fa3-be61770ef97c@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
Errors-To: users-bounces@dpdk.org

04/11/2021 17:39, Medvedkin, Vladimir:
> >> 01/11/2021 11:55, Syam Prasad N Pearson:
> >>> /** Number of items per bucket. */
> >>> *#define RTE_HASH_BUCKET_ENTRIES 8*
> >>>
> >>> defined inside:
> >>> dpdk-20.11.3/dpdk-stable-20.11.3/lib/librte_hash /rte_cuckoo_hash.h
> >>>
> >>> Why does the library take this value as *8*, is there any particular
> >>> reason for this? what if it is 16,32... etc.
> 
> Yes, RTE_HASH_BUCKET_ENTRIES can be any power of 2.
> The reason for choosing 8 is a tradeoff between performance and memory. 
> When it is equal to 8, the sizeof(struct rte_hash_bucket) equal to 
> RTE_CACHE_LINE_SIZE, thus, there are no gaps in memory between the hash 
> buckets due to their alignment.

That's a good comment to add in the code.