[dpdk-dev] Doubt regarding DPDK hash Library implementation

Syam Prasad N Pearson syam.pearson at gadgeon.com
Sun Nov 7 00:23:02 CET 2021


Thank you all.

On Thu, Nov 4, 2021 at 10:19 PM Thomas Monjalon <thomas at monjalon.net> 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
<https://link.aeusercontent.com/mt/lt/D78C05ADDA56BE856A051569556899538/1?targetURL=https%3A%2F%2Fwww.gadgeon.com%2F>
www.delpheon.io
<https://link.aeusercontent.com/mt/lt/D78C05ADDA56BE856A051569556899538/2?targetURL=https%3A%2F%2Fdelpheon.io%2F>

<https://twitter.com/gadgeon>  [image:
www.linkedin.com/in/kirankumar-c-32349964]
<http://www.linkedin.com/in/syam-prasad-n-pearson-4903b5a8>


More information about the dev mailing list