From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: "Kinsella, Ray" <ray.kinsella@intel.com>,
Thomas Monjalon <thomas@monjalon.net>,
Syam Prasad N Pearson <syam.pearson@gadgeon.com>
Cc: "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, 4 Nov 2021 17:39:50 +0100 [thread overview]
Message-ID: <6c1c908e-6a9a-c50d-0fa3-be61770ef97c@intel.com> (raw)
In-Reply-To: <PH0PR11MB47769F949D7FD3273A0ABB48908D9@PH0PR11MB4776.namprd11.prod.outlook.com>
Hello,
On 04/11/2021 15:46, Kinsella, Ray wrote:
> I would guess it - I would say it is related to cache alignment.
> Assuming each entry is 8 bytes 😊
>
> Ray K
>
>> -----Original Message-----
>> From: Thomas Monjalon <thomas@monjalon.net>
>> Sent: Thursday 4 November 2021 14:12
>> To: Syam Prasad N Pearson <syam.pearson@gadgeon.com>
>> Cc: users@dpdk.org; dev@dpdk.org; Wang, Yipeng1
>> <yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@intel.com>;
>> Richardson, Bruce <bruce.richardson@intel.com>; Medvedkin, Vladimir
>> <vladimir.medvedkin@intel.com>
>> Subject: Re: [dpdk-dev] Doubt regarding DPDK hash Library
>> implementation
>>
>> +Cc hash lib maintainers
>>
>> 01/11/2021 11:55, Syam Prasad N Pearson:
>>> Dear Sir/Madam,
>>> I am a developer trying to get familiar with the DPDK hash library.
>> I
>>> tried to make and use a hash table successfully.
>>> During the development I came across a variable
>>>
>>> /** 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.
>>> I am using DPDK 20.11.3 LTS.
>>>
>>> Please help.
>>
>>
>
--
Regards,
Vladimir
next prev parent reply other threads:[~2021-11-04 16:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 10:55 Syam Prasad N Pearson
2021-11-04 14:11 ` Thomas Monjalon
2021-11-04 14:46 ` Kinsella, Ray
2021-11-04 16:39 ` Medvedkin, Vladimir [this message]
2021-11-04 16:49 ` Thomas Monjalon
2021-11-06 23:23 ` Syam Prasad N Pearson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6c1c908e-6a9a-c50d-0fa3-be61770ef97c@intel.com \
--to=vladimir.medvedkin@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=ray.kinsella@intel.com \
--cc=sameh.gobriel@intel.com \
--cc=syam.pearson@gadgeon.com \
--cc=thomas@monjalon.net \
--cc=users@dpdk.org \
--cc=yipeng1.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).