Re: [dpdk-dev] cuckoo hash in dpdk

2017-08-25 Thread Andriy Berestovskyy
Hey Pragash, You can pass your own hash function to rte_hash_create() otherwise a default one will be used, see http://dpdk.org/browse/dpdk/tree/lib/librte_hash/rte_cuckoo_hash.c#n281 The default hash function is rte_hash_crc() or in some cases rte_jhash(), see http://dpdk.org/browse/dpdk/tree/lib

Re: [dpdk-dev] cuckoo hash in dpdk

2017-08-24 Thread Pragash Vijayaragavan
Thats great, what about the hash functions. On 24 Aug 2017 10:54, "Andriy Berestovskyy" wrote: > Hey Pragash, > I am not the author of the code, but I guess it is done that way > because modern compilers do recognize power of two constants and do > substitute division and modulo operations with c

Re: [dpdk-dev] cuckoo hash in dpdk

2017-08-24 Thread Andriy Berestovskyy
Hey Pragash, I am not the author of the code, but I guess it is done that way because modern compilers do recognize power of two constants and do substitute division and modulo operations with corresponding bit manipulations. Just try to compile a small program like the following: volatile unsign

Re: [dpdk-dev] cuckoo hash in dpdk

2017-08-23 Thread Pragash Vijayaragavan
t;> >> >> > -Original Message- >> > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Pragash >> > Vijayaragavan >> > Sent: Wednesday, August 23, 2017 3:16 PM >> > To: dev@dpdk.org >> > Cc: Minseok Kwon >> > Subject

Re: [dpdk-dev] cuckoo hash in dpdk

2017-08-23 Thread Pragash Vijayaragavan
om: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Pragash > > Vijayaragavan > > Sent: Wednesday, August 23, 2017 3:16 PM > > To: dev@dpdk.org > > Cc: Minseok Kwon > > Subject: [dpdk-dev] cuckoo hash in dpdk > > > > Hi, > > > > I got the chance t

Re: [dpdk-dev] cuckoo hash in dpdk

2017-08-23 Thread Dumitrescu, Cristian
> -Original Message- > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Pragash > Vijayaragavan > Sent: Wednesday, August 23, 2017 3:16 PM > To: dev@dpdk.org > Cc: Minseok Kwon > Subject: [dpdk-dev] cuckoo hash in dpdk > > Hi, > > I got the chanc

[dpdk-dev] cuckoo hash in dpdk

2017-08-23 Thread Pragash Vijayaragavan
Hi, I got the chance to look at the cuckoo hash used in dpdk and have a query. would using division and modulo operations be slower than bitwise operations on RTE_HASH_BUCKET_ENTRIES, specially since RTE_HASH_BUCKET_ENTRIES is a power of 2. For example, to do a modulo we can do a "AND" operation