> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Medvedkin, Vladimir > Sent: Monday, March 16, 2020 7:28 PM > > Hi Morten, > > > On 16/03/2020 14:39, Morten Brørup wrote: > >> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Vladimir Medvedkin > >> Sent: Monday, March 16, 2020 2:38 PM > >> > >> Currently DPDK has a special implementation of a hash table for > >> 4 byte keys which is called FBK hash. Unfortunately its main drawback > >> is that it only supports 2 byte values. > >> The new implementation called DWK (double word key) hash > >> supports 8 byte values, which is enough to store a pointer. > >> > >> It would also be nice to get feedback on whether to leave the old FBK > >> and new DWK implementations, or whether to deprecate the old one? > > <rant on> > > > > Who comes up with these names?!? > > > > FBK (Four Byte Key) and DWK (Double Word Key) is supposed to mean the > same. Could you use 32 somewhere in the name instead, like in int32_t, > instead of using a growing list of creative synonyms for the same thing? > Pretty please, with a cherry on top! > > > That's true, at first I named it as fbk2, but then it was decided to > rename it "dwk", so that there was no confusion with the existing FBK > library. Naming suggestions are welcome! >
OK... let me suggest a prefix with both key and value sizes in the name: Instead of rte_dwk_hash_xxx, use rte_hash_k32v64_xxx. However, that suggests that it is a generic hash... and your hash algorithm certainly has other properties too; so perhaps a specific name, saying something about the underlying algorithm, makes more sense after all. And the documentation will show its properties anyway. Whatever you choose, Double Word is certainly not a good name.... a word is 32 bits and a double word is 64 bits in many non-Intel CPU architectures, including some supported by DPDK. > > > > And if the value size is fixed too, perhaps the name should also indicate > the value size. > > > > <rant off> > > > > It's a shame we don't have C++ class templates available in DPDK... > > > > In other news, Mellanox has sent an RFC for an "indexed memory pool" > library [1] to conserve memory by using uintXX_t instead of pointers, so > perhaps a variant of a 32 bit key hash library with 32 bit values (in > addition to 16 bit values in FBK and 64 bit in DWK) would be nice > combination with that library. > > > > [1]: http://mails.dpdk.org/archives/dev/2019-October/147513.html > > > > > > Med venlig hilsen / kind regards > > - Morten Brørup > > > -- > Regards, > Vladimir >