table: add dedicated params struct for cuckoo hash
authorJasvinder Singh <jasvinder.singh@intel.com>
Tue, 8 May 2018 14:17:18 +0000 (15:17 +0100)
committerCristian Dumitrescu <cristian.dumitrescu@intel.com>
Tue, 8 May 2018 14:19:58 +0000 (16:19 +0200)
commit8ea41438832a360aed2b7ba49fb75e310a2ff1dc
tree481e8e2e8eb9b65725fc722908d75dc1cec047e2
parent7959831b4d1b52f6525acb63ce0d94eeeb396855
table: add dedicated params struct for cuckoo hash

Add dedicated parameter structure for cuckoo hash. The cuckoo hash from
librte_hash uses slightly different prototype for the hash function (no
key_mask parameter, 32-bit seed and return value) that require either
of the following approaches:
   1/ Function pointer conversion: gcc 8.1 warning [1], misleading [2]
   2/ Union within the parameter structure: pollutes a very generic API
      parameter structure with some implementation dependent detail
      (i.e. key mask not available for one of the available
      implementations)
   3/ Using opaque pointer for hash function: same issue from 2/
   4/ Different parameter structure: avoid issue from 2/; hopefully,
      it won't be long before librte_hash implements the key mask feature,
      so the generic API structure could be used.

[1] http://www.dpdk.org/ml/archives/dev/2018-April/094950.html
[2] http://www.dpdk.org/ml/archives/dev/2018-April/096250.html

Fixes: 5a80bf0ae613 ("table: add cuckoo hash")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
lib/librte_table/Makefile
lib/librte_table/meson.build
lib/librte_table/rte_table_hash.h
lib/librte_table/rte_table_hash_cuckoo.c
lib/librte_table/rte_table_hash_cuckoo.h [new file with mode: 0644]
test/test-pipeline/main.h
test/test-pipeline/pipeline_hash.c
test/test/test_table.c
test/test/test_table.h
test/test/test_table_combined.c
test/test/test_table_tables.c