From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F72CA0C41 for ; Sun, 7 Nov 2021 16:33:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6410640689; Sun, 7 Nov 2021 16:33:57 +0100 (CET) Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by mails.dpdk.org (Postfix) with ESMTP id 6EF7F40040 for ; Sun, 7 Nov 2021 05:53:31 +0100 (CET) Received: by mail-yb1-f177.google.com with SMTP id o12so34246808ybk.1 for ; Sat, 06 Nov 2021 21:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gadgeon.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dYbEVhE9h04BIXtHJ5Bys4gATYPEpgTTGEhyGyEHzGc=; b=IONWbxOoO8jxUIODTwUx3xstmQEx10dN5l7q5yue9vLKz9dtpp4JTRld7p4g6j31eP 80GHgxJJTGTvKy1lTiaHiBjdAKkwV587L5LH0w3K0QaItauwOQBkBd3xIl8ZZmokyOAO d2CNiRlLs8D+Hr6nPY0E+OmgEdWZEEAZ6q1r0/yNMfe5mxZcbh6gmYQcMq6P5D7Hdm75 8Pnhmv5PH+lhZiOJJ+5mNNDWqYJiXBqdcnEmLjbiil7nT2IcM/Hacro+DrikaAk4qVpM NgmgSAJMaxoUtCnpnVGeA6Vch+szmex2Hc20s3f6qN+YdL/npsxNsC4VOb+jGJaorEM6 cddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dYbEVhE9h04BIXtHJ5Bys4gATYPEpgTTGEhyGyEHzGc=; b=Pfs0HhmThDsHvAAHxDZNytXmFH6KevuA0dUlWz8fpp213+e52UksTXy1DWHNgY2bAF ldYZH9f142EFlf2l7LzYmGNLsoTYPizdNdOTy4IYikGL5H5qadpZpUMoq/JmWoh9O8sR DyelLjfryxkSBRTco6bGjjsJfOt7TgKN09OyNj1qc5Fh3yMr1DV+aKl8f0cqlZ7RF2q+ fRVTj3qv5E+eMdd4IwLFM8xV09URMlTHC/nwzkmCPff/RPIUv5jUiZskiFjHYt/LBO6r D+5e3j+NsuYAQT0zv9//6psoyCmxKz3G3nwJzkavYd/UUzLVJEq2aJtBI/Mau9jHfJXC /8mw== X-Gm-Message-State: AOAM533hTPcsKC6ZH9ay15J3rBIJjMXwmFBMV9skRGhwR/TzIAFJtKE3 cTw6uqQ8dd7wXGsI4iGNDXsIFjUOWF6Bxr7nlwh3BA== X-Google-Smtp-Source: ABdhPJzVhxEoC7Pql11JouHsElFreNt7hekLGInns43oidr0WYHDMMpAZrSX5XwAMdUrgch50vtzrZPuv/6J7EVp/Hc= X-Received: by 2002:a25:dc42:: with SMTP id y63mr39552878ybe.402.1636260810821; Sat, 06 Nov 2021 21:53:30 -0700 (PDT) MIME-Version: 1.0 References: <6c1c908e-6a9a-c50d-0fa3-be61770ef97c@intel.com> <3060108.LiUVKm96O0@thomas> In-Reply-To: <3060108.LiUVKm96O0@thomas> From: Syam Prasad N Pearson Date: Sun, 7 Nov 2021 04:53:02 +0530 Message-ID: Subject: Re: [dpdk-dev] Doubt regarding DPDK hash Library implementation To: Thomas Monjalon Cc: "Medvedkin, Vladimir" , "Kinsella, Ray" , "users@dpdk.org" , "dev@dpdk.org" , "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" Content-Type: multipart/alternative; boundary="00000000000063ace205d02ba8f7" X-Mailman-Approved-At: Sun, 07 Nov 2021 16:33:56 +0100 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --00000000000063ace205d02ba8f7 Content-Type: text/plain; charset="UTF-8" Thank you all. On Thu, Nov 4, 2021 at 10:19 PM Thomas Monjalon wrote: > 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. > > > -- Regards, Syam Pearson Syam Pearson Gadgeon Smart Systems m: +91-97460-44420 (India) w: www.gadgeon.com www.delpheon.io [image: www.linkedin.com/in/kirankumar-c-32349964] --00000000000063ace205d02ba8f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you all.

On Thu, Nov 4, 2021 at 10:19 PM Thomas M= onjalon <thomas@monjalon.net&= gt; wrote:
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_cuc= koo_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 has= h
> buckets due to their alignment.

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




--
Regards,Syam Pearson
=
Syam Pearson
Gadgeon Smart Syste= ms
m:+91-97460-44420 (India)
w:www.gadgeon.= com
www.delpheon.io=C2= =A0=C2=A0
=C2=A0=C2=A03D"www.linkedin.com/in/kira=

--00000000000063ace205d02ba8f7--